mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(s3): accept the log-delivery-write canned ACL (#2653)
PutBucketAcl/PutObjectAcl rejected x-amz-acl: log-delivery-write with "Unsupported x-amz-acl value", even though it is a standard AWS canned ACL (Terraform's aws_s3_bucket_acl / access-logging modules send it to grant the S3 log-delivery service group permission to write access logs into a bucket). Of the eight AWS canned ACL values, this was the only one missing from cannedObjectAclXml's switch - the rest were already handled. Add the log-delivery-write case, translating it to WRITE and READ_ACP grants for the well-known LogDelivery group URI (http://acs.amazonaws.com/groups/s3/LogDelivery), following the same groupGrant pattern used for public-read/public-read-write.
This commit is contained in:
1 parent
6a1d86e43f
commit
2a014d2add
3 files changed
+36
No files matched your search
@@ -17,6 +17,7 @@ class S3AclIntegrationTest {
|
||||
private static final String BUCKET = "acl-test-bucket";
|
||||
private static final String ALL_USERS_GROUP_URI = "http://acs.amazonaws.com/groups/global/AllUsers";
|
||||
private static final String AUTHENTICATED_USERS_GROUP_URI = "http://acs.amazonaws.com/groups/global/AuthenticatedUsers";
|
||||
private static final String LOG_DELIVERY_GROUP_URI = "http://acs.amazonaws.com/groups/s3/LogDelivery";
|
||||
private static String multipartUploadId;
|
||||
|
||||
@Test
|
||||
@@ -374,4 +375,30 @@ class S3AclIntegrationTest {
|
||||
.body(not(containsString(ALL_USERS_GROUP_URI)))
|
||||
.body(containsString("<Permission>FULL_CONTROL</Permission>"));
|
||||
}
|
||||
|
||||
// Regression coverage for floci-3wz: PutBucketAcl rejected the "log-delivery-write" canned
|
||||
// ACL, the standard value Terraform's aws_s3_bucket_acl / access-logging modules send to grant
|
||||
// the S3 log-delivery service group permission to write access logs into a bucket.
|
||||
|
||||
@Test
|
||||
@Order(17)
|
||||
void putBucketAclAppliesLogDeliveryWriteCannedAcl() {
|
||||
given()
|
||||
.header("x-amz-acl", "log-delivery-write")
|
||||
.when()
|
||||
.put("/" + BUCKET + "?acl")
|
||||
.then()
|
||||
.statusCode(200);
|
||||
|
||||
given()
|
||||
.when()
|
||||
.get("/" + BUCKET + "?acl")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString(LOG_DELIVERY_GROUP_URI))
|
||||
.body(containsString("<Permission>WRITE</Permission>"))
|
||||
.body(containsString("<Permission>READ_ACP</Permission>"))
|
||||
.body(containsString("<Permission>FULL_CONTROL</Permission>"))
|
||||
.body(not(containsString(ALL_USERS_GROUP_URI)));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user