Skip to content

Commit 99cec73

Browse files
committed
Merge pull request #20 from flecno/acl
Add support for ACL on objects
2 parents f7cc58c + b95e839 commit 99cec73

File tree

7 files changed

+15
-2
lines changed

7 files changed

+15
-2
lines changed

.jshintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"-Promise"
66
],
77
"browser": true,
8+
"node": true,
89
"boss": true,
910
"curly": true,
1011
"debug": false,

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ The region the AWS `bucket` is located in.
8383

8484
*Default:* `undefined`
8585

86+
### acl
87+
88+
The ACL to apply to the objects.
89+
90+
*Default:* `public-read`
91+
8692
### prefix
8793

8894
A directory within the `bucket` that the files should be uploaded in to.

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
defaultConfig: {
1616
filePattern: '**/*.{js,css,png,gif,ico,jpg,map,xml,txt,svg,swf,eot,ttf,woff,woff2}',
1717
prefix: '',
18+
acl: 'public-read',
1819
distDir: function(context) {
1920
return context.distDir;
2021
},
@@ -44,6 +45,7 @@ module.exports = {
4445
var distFiles = this.readConfig('distFiles');
4546
var gzippedFiles = this.readConfig('gzippedFiles');
4647
var bucket = this.readConfig('bucket');
48+
var acl = this.readConfig('acl');
4749
var prefix = this.readConfig('prefix');
4850
var manifestPath = this.readConfig('manifestPath');
4951

@@ -59,6 +61,7 @@ module.exports = {
5961
gzippedFilePaths: gzippedFiles,
6062
prefix: prefix,
6163
bucket: bucket,
64+
acl: acl,
6265
manifestPath: manifestPath
6366
};
6467

lib/s3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module.exports = CoreObject.extend({
6565
var cwd = options.cwd;
6666
var bucket = options.bucket;
6767
var prefix = options.prefix;
68-
var acl = options.acl || 'public-read';
68+
var acl = options.acl;
6969
var gzippedFilePaths = options.gzippedFilePaths || [];
7070
var cacheControl = 'max-age='+TWO_YEAR_CACHE_PERIOD_IN_SEC+', public';
7171
var expires = EXPIRE_IN_2030;

tests/.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
"currentPath",
2424
"currentRouteName"
2525
],
26-
"node": false,
26+
"node": true,
2727
"browser": false,
28+
"mocha": true,
2829
"boss": true,
2930
"curly": false,
3031
"debug": false,

tests/unit/index-nodetest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ describe('s3 plugin', function() {
3838
bucket: 'cccc',
3939
region: 'dddd',
4040
filePattern: '*.{css,js}',
41+
acl: 'authenticated-read',
4142
prefix: '',
4243
distDir: function(context) {
4344
return context.distDir;

tests/unit/lib/s3-nodetest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ describe('s3', function() {
9696
filePaths: ['app.css'],
9797
cwd: process.cwd() + '/tests/fixtures/dist',
9898
prefix: 'js-app',
99+
acl: 'public-read',
99100
bucket: 'some-bucket'
100101
};
101102

0 commit comments

Comments
 (0)