@@ -9,9 +9,10 @@ let assert = require('assert');
9
9
* options:
10
10
* {
11
11
* bucket: // S3 bucket to use
12
- * credentials : {
12
+ * awsOptions : {
13
13
* accessKeyId: // ...
14
14
* secretAccessKey: // ...
15
+ * ..any other AWS option; see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#constructor-property
15
16
* // --or--
16
17
* mock: <obj>, // use mock S3 object
17
18
* },
@@ -22,7 +23,7 @@ let assert = require('assert');
22
23
let Bucket = function ( options ) {
23
24
assert ( options , 'options must be given' ) ;
24
25
assert ( options . bucket , 'bucket must be specified' ) ;
25
- assert ( options . credentials , 'credentials must be specified' ) ;
26
+ assert ( options . awsOptions , 'awsOptions must be specified' ) ;
26
27
assert ( ! options . bucketCDN || typeof options . bucketCDN === 'string' ,
27
28
'Expected bucketCDN to be a hostname or empty string for none' ) ;
28
29
assert ( options . monitor , 'options.monitor is required' ) ;
@@ -36,14 +37,14 @@ let Bucket = function(options) {
36
37
// Ensure access to the bucket property
37
38
this . bucket = options . bucket ;
38
39
// Create S3 client
39
- if ( ! options . credentials . mock ) {
40
+ if ( ! options . awsOptions . mock ) {
40
41
this . s3 = new aws . S3 ( _ . defaults ( {
41
42
params : {
42
43
Bucket : options . bucket ,
43
44
} ,
44
- } , options . credentials ) ) ;
45
+ } , options . awsOptions ) ) ;
45
46
} else {
46
- this . s3 = options . credentials . mock ;
47
+ this . s3 = options . awsOptions . mock ;
47
48
}
48
49
// Store bucket CDN
49
50
this . bucketCDN = options . bucketCDN ;
0 commit comments