[MM-25645] api4/user: add migrate_auth endpoints (#14966)

* api4/user: add migrate_auth endpoints

* api4/user: reflect review comments

* add translations

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2020-08-31 14:56:36 +03:00
коммит произвёл GitHub
родитель f12ca27bac
Коммит c30fea5f2d
5 изменённых файлов: 164 добавлений и 0 удалений

Просмотреть файл

@@ -5182,3 +5182,29 @@ func TestConvertUserToBot(t *testing.T) {
require.NotNil(t, bot)
})
}
func TestMigrateAuthToLDAP(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
_, err := th.Client.MigrateAuthToLdap("email", "a", false)
CheckForbiddenStatus(t, err)
th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) {
_, err = client.MigrateAuthToLdap("email", "a", false)
CheckNotImplementedStatus(t, err)
})
}
func TestMigrateAuthToSAML(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
_, err := th.Client.MigrateAuthToSaml("email", map[string]string{"1": "a"}, true)
CheckForbiddenStatus(t, err)
th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) {
_, err = client.MigrateAuthToSaml("email", map[string]string{"1": "a"}, true)
CheckNotImplementedStatus(t, err)
})
}