Skip to content

Commit f8e43c9

Browse files
committed
Merge pull request #24 from flecno/acl
Add support for ACL on objects
2 parents b913f10 + 2046c57 commit f8e43c9

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ A file matching this pattern will be uploaded to S3. The active key in S3 will b
7878

7979
*Default:* `'index.html'`
8080

81+
### acl
82+
83+
The ACL to apply to the objects.
84+
85+
*Default:* `'public-read'`
86+
8187
### distDir
8288

8389
The root directory where the file matching `filePattern` will be searched for. By default, this option will use the `distDir` property of the deployment context.

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = {
1616
region: 'us-east-1',
1717
filePattern: 'index.html',
1818
prefix: '',
19+
acl: 'public-read',
1920
distDir: function(context) {
2021
return context.distDir;
2122
},
@@ -33,6 +34,7 @@ module.exports = {
3334
upload: function(context) {
3435
var bucket = this.readConfig('bucket');
3536
var prefix = this.readConfig('prefix');
37+
var acl = this.readConfig('acl');
3638
var revisionKey = this.readConfig('revisionKey');
3739
var distDir = this.readConfig('distDir');
3840
var filePattern = this.readConfig('filePattern');
@@ -42,6 +44,7 @@ module.exports = {
4244
var options = {
4345
bucket: bucket,
4446
prefix: prefix,
47+
acl: acl,
4548
filePattern: filePattern,
4649
filePath: filePath,
4750
revisionKey: revisionKey,

lib/s3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = CoreObject.extend({
3434
var client = this._client;
3535
var plugin = this._plugin;
3636
var bucket = options.bucket;
37-
var acl = options.acl || 'public-read';
37+
var acl = options.acl;
3838
var allowOverwrite = options.allowOverwrite;
3939
var key = path.join(options.prefix, options.filePattern + ":" + options.revisionKey);
4040
var putObject = Promise.denodeify(client.putObject.bind(client));

tests/unit/lib/s3-nodetest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ describe('s3', function() {
7272
options = {
7373
bucket: bucket,
7474
prefix: '',
75+
acl: 'public-read',
7576
filePattern: filePattern,
7677
revisionKey: revisionKey,
7778
filePath: 'tests/unit/fixtures/test.html',

0 commit comments

Comments
 (0)