[MM-27367] fix ldap group decoding in client (#15192)
Summary
The data returned by the get ldap groups api endpoint was being decoded incorrectly in the Go client.
Ticket Link
https://mattermost.atlassian.net/browse/MM-27367
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e33ab02e1a
Коммит
94e50c30e3
@@ -3875,7 +3875,19 @@ func (c *Client4) GetLdapGroups() ([]*Group, *Response) {
|
|||||||
}
|
}
|
||||||
defer closeBody(r)
|
defer closeBody(r)
|
||||||
|
|
||||||
return GroupsFromJson(r.Body), BuildResponse(r)
|
responseData := struct {
|
||||||
|
Count int `json:"count"`
|
||||||
|
Groups []*Group `json:"groups"`
|
||||||
|
}{}
|
||||||
|
if err := json.NewDecoder(r.Body).Decode(&responseData); err != nil {
|
||||||
|
appErr := NewAppError("Api4.GetLdapGroups", "api.marshal_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
return nil, BuildErrorResponse(r, appErr)
|
||||||
|
}
|
||||||
|
for i := range responseData.Groups {
|
||||||
|
responseData.Groups[i].DisplayName = *responseData.Groups[i].Name
|
||||||
|
}
|
||||||
|
|
||||||
|
return responseData.Groups, BuildResponse(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LinkLdapGroup creates or undeletes a Mattermost group and associates it to the given LDAP group DN.
|
// LinkLdapGroup creates or undeletes a Mattermost group and associates it to the given LDAP group DN.
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user