]> 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>
Fri, 14 Mar 2025 00:23:10 +0000 (20:23 -0400)
commit4cd40c7f715304519fe91b1d6f296ce06ef6c2ef
treefca295e0c8fb47d96d1f2f05e20423d3d22277b2
parente56665c7977020f5edb3aed643dca867fe93e656
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>
src/rgw/rgw_arn.cc
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/test/rgw/test_rgw_iam_policy.cc