|
|
@ -392,7 +392,7 @@ func (iama *IamApiServer) DoActions(w http.ResponseWriter, r *http.Request) { |
|
|
|
userName := values.Get("UserName") |
|
|
|
response, err = iama.GetUser(s3cfg, userName) |
|
|
|
if err != nil { |
|
|
|
writeIamErrorResponse(w, err, "user", userName, nil) |
|
|
|
writeIamErrorResponse(w, r, err, "user", userName, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
changed = false |
|
|
@ -400,7 +400,7 @@ func (iama *IamApiServer) DoActions(w http.ResponseWriter, r *http.Request) { |
|
|
|
userName := values.Get("UserName") |
|
|
|
response, err = iama.DeleteUser(s3cfg, userName) |
|
|
|
if err != nil { |
|
|
|
writeIamErrorResponse(w, err, "user", userName, nil) |
|
|
|
writeIamErrorResponse(w, r, err, "user", userName, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
case "CreateAccessKey": |
|
|
@ -424,20 +424,20 @@ func (iama *IamApiServer) DoActions(w http.ResponseWriter, r *http.Request) { |
|
|
|
case "GetUserPolicy": |
|
|
|
response, err = iama.GetUserPolicy(s3cfg, values) |
|
|
|
if err != nil { |
|
|
|
writeIamErrorResponse(w, err, "user", values.Get("UserName"), nil) |
|
|
|
writeIamErrorResponse(w, r, err, "user", values.Get("UserName"), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
changed = false |
|
|
|
case "DeleteUserPolicy": |
|
|
|
if response, err = iama.DeleteUserPolicy(s3cfg, values); err != nil { |
|
|
|
writeIamErrorResponse(w, err, "user", values.Get("UserName"), nil) |
|
|
|
writeIamErrorResponse(w, r, err, "user", values.Get("UserName"), nil) |
|
|
|
} |
|
|
|
default: |
|
|
|
errNotImplemented := s3err.GetAPIError(s3err.ErrNotImplemented) |
|
|
|
errorResponse := ErrorResponse{} |
|
|
|
errorResponse.Error.Code = &errNotImplemented.Code |
|
|
|
errorResponse.Error.Message = &errNotImplemented.Description |
|
|
|
s3err.WriteXMLResponse(w, errNotImplemented.HTTPStatusCode, errorResponse) |
|
|
|
s3err.WriteXMLResponse(w, r, errNotImplemented.HTTPStatusCode, errorResponse) |
|
|
|
return |
|
|
|
} |
|
|
|
if changed { |
|
|
@ -445,9 +445,9 @@ func (iama *IamApiServer) DoActions(w http.ResponseWriter, r *http.Request) { |
|
|
|
err := iama.s3ApiConfig.PutS3ApiConfiguration(s3cfg) |
|
|
|
s3cfgLock.Unlock() |
|
|
|
if err != nil { |
|
|
|
writeIamErrorResponse(w, fmt.Errorf(iam.ErrCodeServiceFailureException), "", "", err) |
|
|
|
writeIamErrorResponse(w, r, fmt.Errorf(iam.ErrCodeServiceFailureException), "", "", err) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
s3err.WriteXMLResponse(w, http.StatusOK, response) |
|
|
|
s3err.WriteXMLResponse(w, r, http.StatusOK, response) |
|
|
|
} |