[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 удалений

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

@@ -4053,6 +4053,32 @@ func (c *Client4) GetGroupsByUserId(userId string) ([]*Group, *Response) {
return GroupsFromJson(r.Body), BuildResponse(r)
}
func (c *Client4) MigrateAuthToLdap(fromAuthService string, matchField string, force bool) (bool, *Response) {
r, err := c.DoApiPost(c.GetUsersRoute()+"/migrate_auth/ldap", StringInterfaceToJson(map[string]interface{}{
"from": fromAuthService,
"force": force,
"match_field": matchField,
}))
if err != nil {
return false, BuildErrorResponse(r, err)
}
defer closeBody(r)
return CheckStatusOK(r), BuildResponse(r)
}
func (c *Client4) MigrateAuthToSaml(fromAuthService string, usersMap map[string]string, auto bool) (bool, *Response) {
r, err := c.DoApiPost(c.GetUsersRoute()+"/migrate_auth/saml", StringInterfaceToJson(map[string]interface{}{
"from": fromAuthService,
"auto": auto,
"matches": usersMap,
}))
if err != nil {
return false, BuildErrorResponse(r, err)
}
defer closeBody(r)
return CheckStatusOK(r), BuildResponse(r)
}
// Audits Section
// GetAudits returns a list of audits for the whole system.