client: accept roles in response for ListUser

Fixes #5046
release-2.3
Anthony Romano 2016-04-12 12:38:29 -07:00 committed by Gyu-Ho Lee
parent 54d0f1d43b
commit d7da3787bc
1 changed files with 7 additions and 1 deletions

View File

@ -36,6 +36,12 @@ type User struct {
Revoke []string `json:"revoke,omitempty"`
}
// userListEntry is the user representation given by the server for ListUsers
type userListEntry struct {
User string `json:"user"`
Roles []Role `json:"roles"`
}
type UserRoles struct {
User string `json:"user"`
Roles []Role `json:"roles"`
@ -198,7 +204,7 @@ func (u *httpAuthUserAPI) ListUsers(ctx context.Context) ([]string, error) {
}
var userList struct {
Users []User `json:"users"`
Users []userListEntry `json:"users"`
}
if err = json.Unmarshal(body, &userList); err != nil {