diff options
author | Casey Bodley <cbodley@redhat.com> | 2024-01-11 23:10:06 +0100 |
---|---|---|
committer | Casey Bodley <cbodley@redhat.com> | 2024-04-10 19:09:14 +0200 |
commit | 195ecb3732e0d7f78dc74cc9b7f2ac3d7ed919a0 (patch) | |
tree | 962aa30f1c0a85acd0c40d3c7c7aa493ae77eace /src/rgw/rgw_common.h | |
parent | rgw/rados: user metadata links to account index (diff) | |
download | ceph-195ecb3732e0d7f78dc74cc9b7f2ac3d7ed919a0.tar.xz ceph-195ecb3732e0d7f78dc74cc9b7f2ac3d7ed919a0.zip |
rgw/rest: wrap iam/sns/sts Error responses with ErrorResponse
all iam/sns/sts requests wrap the s3 <Error> xml response in another
<ErrorResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
without this, boto3 fails to fully parse error responses, leading to
generic Unknown ClientError exceptions of the form:
botocore.exceptions.ClientError: An error occurred (Unknown) when calling the PutUserPolicy operation: Unknown
with the ErrorResponse part, boto3 throws more specific exceptions that
include the error Code and Message:
botocore.errorfactory.NoSuchEntityException: An error occurred (NoSuchEntity) when calling the PutUserPolicy operation: No such UserName in the account
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/rgw_common.h')
-rw-r--r-- | src/rgw/rgw_common.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index c7b09e401f1..b1dd29e9057 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -213,7 +213,16 @@ static inline const char* to_mime_type(const RGWFormat f) #define RGW_REST_WEBSITE 0x8 #define RGW_REST_STS 0x10 #define RGW_REST_IAM 0x20 -#define RGW_REST_SNS 0x30 +#define RGW_REST_SNS 0x40 + +inline constexpr const char* RGW_REST_IAM_XMLNS = + "https://iam.amazonaws.com/doc/2010-05-08/"; + +inline constexpr const char* RGW_REST_SNS_XMLNS = + "https://sns.amazonaws.com/doc/2010-03-31/"; + +inline constexpr const char* RGW_REST_STS_XMLNS = + "https://sts.amazonaws.com/doc/2011-06-15/"; #define RGW_SUSPENDED_USER_AUID (uint64_t)-2 |