]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw/rest: iam user policy api cleanup
authorCasey Bodley <cbodley@redhat.com>
Thu, 11 Jan 2024 23:06:36 +0000 (18:06 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Apr 2024 19:34:27 +0000 (15:34 -0400)
commit44e1734a2b44e11e4a4e6eb4565feb4e39fcb69a
treeb67467b1be95570fe09005959090d18678ccde77
parent469fc904cfdd00b4c8d5b4c4e0dc7782ef6e0307
rgw/rest: iam user policy api cleanup

make get_params() virtual and protected. base class always validates
UserName

add common init_processing() function that calls get_params() and loads
the user by UserName. this step happens before verify_permission()

set s->err.message in several error paths

add the xmlns="https://iam.amazonaws.com/doc/2010-05-08/" part to the
responses

return ERR_LIMIT_EXCEEDED instead of ERR_INVALID_REQUEST when
RGWPutUserPolicy exceeds the policy limit

where RGW_ATTR_USER_POLICY is missing, treat it the same way we treat an
empty map of policies. this avoids separate error paths

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 93428aa6e49da8cdd602d761eaff693449bf57f2)
src/rgw/rgw_rest_iam.cc
src/rgw/rgw_rest_iam.h
src/rgw/rgw_rest_user_policy.cc
src/rgw/rgw_rest_user_policy.h