Skip to content

Commit 8f5f3fa

Browse files
committed
rgw_attrs: fixes for 3 more iam/perms mappings
Help from Pritha and Casey appreciated Plus, fix 3 explicit mapping tests in test_rgw_iam_policy.cc. Signed-off-by: Matt Benjamin <[email protected]>
1 parent 6c534ba commit 8f5f3fa

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/rgw/rgw_iam_policy.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ static const actpair actpairs[] =
9595
{ "s3:GetObjectAcl", s3GetObjectAcl },
9696
{ "s3:GetObject", s3GetObject },
9797
{ "s3:GetObjectAttributes", s3GetObjectAttributes },
98+
{ "s3:GetObjectVersionAttributes", s3GetObjectVersionAttributes },
9899
{ "s3:GetObjectTorrent", s3GetObjectTorrent },
99100
{ "s3:GetObjectVersionAcl", s3GetObjectVersionAcl },
100101
{ "s3:GetObjectVersion", s3GetObjectVersion },
@@ -1484,6 +1485,9 @@ const char* action_bit_string(uint64_t action) {
14841485
case s3GetObjectAttributes:
14851486
return "s3:GetObjectAttributes";
14861487

1488+
case s3GetObjectVersionAttributes:
1489+
return "s3:GetObjectVersionAttributes";
1490+
14871491
case s3DescribeJob:
14881492
return "s3:DescribeJob";
14891493

src/rgw/rgw_iam_policy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ inline int op_to_perm(std::uint64_t op) {
250250
case s3GetObjectRetention:
251251
case s3GetObjectLegalHold:
252252
case s3GetObjectAttributes:
253+
case s3GetObjectVersionAttributes:
253254
case s3ListAllMyBuckets:
254255
case s3ListBucket:
255256
case s3ListBucketMultipartUploads:

src/test/rgw/test_rgw_iam_policy.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ using rgw::IAM::s3GetObjectTagging;
7575
using rgw::IAM::s3GetObjectVersion;
7676
using rgw::IAM::s3GetObjectVersionTagging;
7777
using rgw::IAM::s3GetObjectVersionTorrent;
78+
using rgw::IAM::s3GetObjectAttributes;
79+
using rgw::IAM::s3GetObjectVersionAttributes;
7880
using rgw::IAM::s3GetPublicAccessBlock;
7981
using rgw::IAM::s3GetReplicationConfiguration;
8082
using rgw::IAM::s3ListAllMyBuckets;
@@ -419,6 +421,8 @@ TEST_F(PolicyTest, Parse3) {
419421
act2[s3GetObjectVersionAcl] = 1;
420422
act2[s3GetObjectTorrent] = 1;
421423
act2[s3GetObjectVersionTorrent] = 1;
424+
act2[s3GetObjectAttributes] = 1;
425+
act2[s3GetObjectVersionAttributes] = 1;
422426
act2[s3GetAccelerateConfiguration] = 1;
423427
act2[s3GetBucketAcl] = 1;
424428
act2[s3GetBucketOwnershipControls] = 1;
@@ -487,6 +491,8 @@ TEST_F(PolicyTest, Eval3) {
487491
s3allow[s3GetObjectVersion] = 1;
488492
s3allow[s3GetObjectAcl] = 1;
489493
s3allow[s3GetObjectVersionAcl] = 1;
494+
s3allow[s3GetObjectAttributes] = 1;
495+
s3allow[s3GetObjectVersionAttributes] = 1;
490496
s3allow[s3GetObjectTorrent] = 1;
491497
s3allow[s3GetObjectVersionTorrent] = 1;
492498
s3allow[s3GetAccelerateConfiguration] = 1;
@@ -883,6 +889,8 @@ TEST_F(ManagedPolicyTest, AmazonS3ReadOnlyAccess)
883889
act[s3GetObjectVersionAcl] = 1;
884890
act[s3GetObjectTorrent] = 1;
885891
act[s3GetObjectVersionTorrent] = 1;
892+
act[s3GetObjectAttributes] = 1;
893+
act[s3GetObjectVersionAttributes] = 1;
886894
act[s3GetAccelerateConfiguration] = 1;
887895
act[s3GetBucketAcl] = 1;
888896
act[s3GetBucketOwnershipControls] = 1;

0 commit comments

Comments
 (0)