s3: allow single Statement object in policy document (#8212)
* s3: allow single Statement object in policy document Fixes #8201 * s3: add unit test for single Statement object in policy * s3: improve error message for malformed PolicyDocument.Statement * s3: simplify error message for malformed PolicyDocument.Statement
This commit is contained in:
@@ -286,6 +286,18 @@ func TestPolicyValidation(t *testing.T) {
|
||||
}`,
|
||||
expectError: false,
|
||||
},
|
||||
{
|
||||
name: "Valid policy with single statement object",
|
||||
policyJSON: `{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": {
|
||||
"Effect": "Allow",
|
||||
"Action": "s3:GetObject",
|
||||
"Resource": "arn:aws:s3:::test-bucket/*"
|
||||
}
|
||||
}`,
|
||||
expectError: false,
|
||||
},
|
||||
{
|
||||
name: "Invalid version",
|
||||
policyJSON: `{
|
||||
|
||||
Reference in New Issue
Block a user