]> 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>
Tue, 27 May 2025 20:08:27 +0000 (16:08 -0400)
commite3036679b4b37509667e079fc4b10aec28ff24c3
tree516fee610d4a69d8476da62249cbe3e7ebfb2325
parent9ef35d514dba39d08d563f9ad93c7db9461e6eac
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