|
|
|
@ -97,11 +97,13 @@ func (a adminAPIHandlers) RemoveUser(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
func (a adminAPIHandlers) ListUsers(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
ctx := newContext(r, w, "ListUsers") |
|
|
|
|
|
|
|
|
|
objectAPI, _ := validateAdminUsersReq(ctx, w, r, iampolicy.ListUsersAdminAction) |
|
|
|
|
objectAPI, cred := validateAdminUsersReq(ctx, w, r, iampolicy.ListUsersAdminAction) |
|
|
|
|
if objectAPI == nil { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
password := cred.SecretKey |
|
|
|
|
|
|
|
|
|
allCredentials, err := globalIAMSys.ListUsers() |
|
|
|
|
if err != nil { |
|
|
|
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) |
|
|
|
@ -114,7 +116,6 @@ func (a adminAPIHandlers) ListUsers(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
password := globalActiveCred.SecretKey |
|
|
|
|
econfigData, err := madmin.EncryptData(password, data) |
|
|
|
|
if err != nil { |
|
|
|
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) |
|
|
|
@ -462,7 +463,7 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque |
|
|
|
|
func (a adminAPIHandlers) GetServiceAccount(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
ctx := newContext(r, w, "GetServiceAccount") |
|
|
|
|
|
|
|
|
|
objectAPI, _ := validateAdminUsersReq(ctx, w, r, iampolicy.GetUserAdminAction) |
|
|
|
|
objectAPI, cred := validateAdminUsersReq(ctx, w, r, iampolicy.GetUserAdminAction) |
|
|
|
|
if objectAPI == nil { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
@ -470,6 +471,8 @@ func (a adminAPIHandlers) GetServiceAccount(w http.ResponseWriter, r *http.Reque |
|
|
|
|
vars := mux.Vars(r) |
|
|
|
|
accessKey := vars["accessKey"] |
|
|
|
|
|
|
|
|
|
password := cred.SecretKey |
|
|
|
|
|
|
|
|
|
creds, err := globalIAMSys.GetServiceAccount(ctx, accessKey) |
|
|
|
|
if err != nil { |
|
|
|
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) |
|
|
|
@ -482,7 +485,6 @@ func (a adminAPIHandlers) GetServiceAccount(w http.ResponseWriter, r *http.Reque |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
password := globalActiveCred.SecretKey |
|
|
|
|
econfigData, err := madmin.EncryptData(password, data) |
|
|
|
|
if err != nil { |
|
|
|
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) |
|
|
|
|