]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw/rest: wrap iam/sns/sts Error responses with ErrorResponse
authorCasey Bodley <cbodley@redhat.com>
Thu, 11 Jan 2024 22:10:06 +0000 (17:10 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Apr 2024 19:34:27 +0000 (15:34 -0400)
commitfe0bf0de789e9f1b1938ea2c5b70b983e0619593
tree8f4f0c9d5335a53a2eb189aa4b4886e86dd681cd
parentf8cc79d77aa1df33e27d521cad333d1a014ccbe6
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>
(cherry picked from commit 195ecb3732e0d7f78dc74cc9b7f2ac3d7ed919a0)
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_rest_iam.h
src/rgw/rgw_rest_pubsub.cc
src/rgw/rgw_rest_sts.cc