]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw/iam: simplify match_policy() for colon-delimited use only
authorCasey Bodley <cbodley@redhat.com>
Thu, 13 Mar 2025 23:45:22 +0000 (19:45 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 28 Apr 2025 19:00:01 +0000 (15:00 -0400)
commit04a52dfe96b43aec10d89521afb56b411b0e2d4b
tree7dd31ca3463fe5409603ded1b0e9c477e5f2a59e
parent5447529f8aa744c27edda2cc9f6ab611bf1ba9b8
rgw/iam: simplify match_policy() for colon-delimited use only

remove unused MATCH_POLICY_STRING

ARN::match() was the only caller for MATCH_POLICY_ARN, but it was used
to match the 'region' and 'account' components that were already parsed
out of the colon-separated ARN string. for that use, we don't need the
loop-over-colons behavior of match_policy() so can call match_wildcards()
directly

after doing the same for MATCH_POLICY_RESOURCE, we no longer have any
non-looping callers of match_policy() so can treat 'bool colonblocks' as
unconditionally true

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 4cd40c7f715304519fe91b1d6f296ce06ef6c2ef)
src/rgw/rgw_arn.cc
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/test/rgw/test_rgw_iam_policy.cc