This is an automated email from the ASF dual-hosted git repository.

gaul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jclouds.git


The following commit(s) were added to refs/heads/master by this push:
     new 26338e30d7 JCLOUDS-1644: Create AWS S3 buckets with ownership and 
public access block
26338e30d7 is described below

commit 26338e30d7f61b599f9d240a4f49511c76b34e70
Author: Andrew Gaul <[email protected]>
AuthorDate: Tue Jan 21 20:13:01 2025 -0800

    JCLOUDS-1644: Create AWS S3 buckets with ownership and public access block
    
    AWS changed the defaults when creating buckets to prevent public-read
    and other canned ACLs.  Background:
    https://stackoverflow.com/a/76102067/2800111
---
 apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java         | 4 ++++
 apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java | 1 +
 2 files changed, 5 insertions(+)

diff --git a/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java 
b/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java
index 11707d942c..f451e1069b 100644
--- a/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java
+++ b/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java
@@ -147,6 +147,8 @@ public class S3ClientLiveTest extends 
BaseBlobStoreIntegrationTest {
    public void testPutCannedAccessPolicyPublic() throws Exception {
       String containerName = getContainerName();
       try {
+         allowPublicReadable(containerName);
+
          String key = "hello";
          S3Object object = getApi().newS3Object();
          object.getMetadata().setKey(key);
@@ -236,6 +238,8 @@ public class S3ClientLiveTest extends 
BaseBlobStoreIntegrationTest {
    public void testUpdateObjectACL() throws InterruptedException, 
ExecutionException, TimeoutException, IOException {
       String containerName = getContainerName();
       try {
+         allowPublicReadable(containerName);
+
          String objectKey = "private-acl";
 
          // Private object
diff --git a/apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java 
b/apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java
index 3e2b8bca17..0c7309342c 100644
--- a/apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java
+++ b/apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java
@@ -118,6 +118,7 @@ public class BucketsLiveTest extends 
BaseBlobStoreIntegrationTest {
          assertEquals(acl.getGrants().size(), 1);
          assertTrue(acl.hasPermission(ownerId, FULL_CONTROL));
 
+         allowPublicReadable(bucketName);
          addGrantsToACL(acl);
          assertEquals(acl.getGrants().size(), 4);
          assertTrue(getApi().putBucketACL(bucketName, acl));

Reply via email to