From c9ce92f635aa932d67ab03047f09f3e7cc6a4804 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Tue, 12 Apr 2016 12:38:29 -0700 Subject: [PATCH] client: accept roles in response for ListUser Fixes #5046 --- client/auth_user.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/auth_user.go b/client/auth_user.go index 6af1c2886..f86f083c6 100644 --- a/client/auth_user.go +++ b/client/auth_user.go @@ -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"` @@ -194,7 +200,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 {