Skip to content

Commit c0d9974

Browse files
committed
Optionally ignore ACLs
[Since April 2023, buckets by default have ACLs off](https://aws.amazon.com/blogs/aws/heads-up-amazon-s3-security-changes-are-coming-in-april-of-2023/).
1 parent 3188539 commit c0d9974

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,14 @@ or Openstack Swift
111111

112112
If `endpoint` set the `region` option will be ignored.
113113

114-
*Default:* `[region].s3.amazonaws.com`
114+
*Default:* `[region].s3.amazonaws.com`
115115

116116
### acl
117117

118118
The ACL to apply to the objects.
119119

120+
Set to `false` to not apply any ACLs.
121+
120122
*Default:* `public-read`
121123

122124
### prefix

index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,17 @@ module.exports = {
9494
brotliCompressedFilePaths: brotliCompressedFiles,
9595
prefix: prefix,
9696
bucket: bucket,
97-
acl: acl,
9897
manifestPath: manifestPath,
9998
cacheControl: cacheControl,
10099
expires: expires,
101100
batchSize: batchSize,
102101
defaultMimeType: defaultMimeType
103102
};
104103

104+
if (acl) {
105+
options.acl = acl;
106+
}
107+
105108
if (serverSideEncryption) {
106109
options.serverSideEncryption = serverSideEncryption;
107110
}

tests/index-test.js

+17
Original file line numberDiff line numberDiff line change
@@ -340,5 +340,22 @@ describe('s3 plugin', function() {
340340
done(reason);
341341
});
342342
});
343+
344+
it('does not add an ACL', function() {
345+
context.config.s3.acl = false
346+
347+
var plugin = subject.createDeployPlugin({
348+
name: 's3'
349+
});
350+
351+
context.uploadClient.upload = function(options) {
352+
return RSVP.resolve(options);
353+
};
354+
plugin.beforeHook(context);
355+
return assert.isFulfilled(plugin.upload(context))
356+
.then(function(options) {
357+
assert.equal(options.acl, undefined, 'acl is not present');
358+
});
359+
});
343360
});
344361
});

0 commit comments

Comments
 (0)