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