Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 26338e3

Browse files
committed
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
1 parent dd6cb51 commit 26338e3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ protected URL getObjectURL(String containerName, String key) throws Exception {
147147
public void testPutCannedAccessPolicyPublic() throws Exception {
148148
String containerName = getContainerName();
149149
try {
150+
allowPublicReadable(containerName);
151+
150152
String key = "hello";
151153
S3Object object = getApi().newS3Object();
152154
object.getMetadata().setKey(key);
@@ -236,6 +238,8 @@ public void run() {
236238
public void testUpdateObjectACL() throws InterruptedException, ExecutionException, TimeoutException, IOException {
237239
String containerName = getContainerName();
238240
try {
241+
allowPublicReadable(containerName);
242+
239243
String objectKey = "private-acl";
240244

241245
// Private object

apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public void testUpdateBucketACL() throws InterruptedException, ExecutionExceptio
118118
assertEquals(acl.getGrants().size(), 1);
119119
assertTrue(acl.hasPermission(ownerId, FULL_CONTROL));
120120

121+
allowPublicReadable(bucketName);
121122
addGrantsToACL(acl);
122123
assertEquals(acl.getGrants().size(), 4);
123124
assertTrue(getApi().putBucketACL(bucketName, acl));

0 commit comments

Comments
 (0)