versitygw icon indicating copy to clipboard operation
versitygw copied to clipboard

Bucket policy document principal structure

Open jonaustin09 opened this issue 9 months ago • 0 comments

Describe the bug PutBucketPolicy document validation should validate the following structure for Principal property in Statements:

"Principal": {
  "AWS": "*"
}

To Reproduce

aws --endpoint-url http://localhost:7070 s3api put-bucket-policy --bucket MyBucket --policy file://policy.json

policy.json

{
   "Statement": [
      {
         "Effect": "Allow",
         "Principal": {
            "AWS": "arn:aws:iam::123456789012:root"
         },
         "Action": [
            "s3:DeleteObject",
            "s3:PutObject"
         ],
         "Resource": "arn:aws:s3:::MyBucket/*"
      }
   ]
}

Expected behavior The action shouldn't return 400 validation error

jonaustin09 avatar May 14 '24 20:05 jonaustin09