mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -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
@@ -56,6 +56,7 @@ public class S3Service implements Resettable, ResourceProvider {
|
||||
private String ownerId() { return regionResolver != null ? regionResolver.getAccountId() : "000000000000"; }
|
||||
private static final String DEFAULT_OWNER_DISPLAY_NAME = "floci";
|
||||
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 final String LEGACY_ACCESS_KEY_ID = "test";
|
||||
private static final Set<String> SUPPORTED_SERVER_SIDE_ENCRYPTION_VALUES = Set.of("AES256", "aws:kms", "aws:kms:dsse", "aws:fsx");
|
||||
private static final String SSE_C_ALGORITHM = "AES256";
|
||||
@@ -2797,6 +2798,13 @@ public class S3Service implements Resettable, ResourceProvider {
|
||||
case "authenticated-read" -> objectAclXml(
|
||||
ownerFullControlGrant(),
|
||||
groupGrant(AUTHENTICATED_USERS_GROUP_URI, "READ"));
|
||||
// Standard canned ACL used by S3 server-access-logging (and Terraform's
|
||||
// aws_s3_bucket_acl / access-logging modules) to grant the S3 log-delivery service
|
||||
// group permission to write log objects into this bucket and read their own ACL.
|
||||
case "log-delivery-write" -> objectAclXml(
|
||||
ownerFullControlGrant(),
|
||||
groupGrant(LOG_DELIVERY_GROUP_URI, "WRITE"),
|
||||
groupGrant(LOG_DELIVERY_GROUP_URI, "READ_ACP"));
|
||||
default -> throw new AwsException("InvalidArgument",
|
||||
"Unsupported x-amz-acl value: " + cannedAcl, 400);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user