Skip to content

Commit

Permalink
Merge pull request #83 from pedrokost/feature/signature
Browse files Browse the repository at this point in the history
Add confi option for signatureVersion
  • Loading branch information
ghedamat committed Feb 5, 2017
2 parents 02d61e6 + bbdd056 commit e4c1eb8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ Useful when deploying applications to [fake-s3](https://github.com/jubos/fake-s3

*Default:* `0`


### signatureVersion

`signatureVersion` allows for setting the Signature Version. In the Asia Pacific (Mumbai), Asia Pacific (Seoul), EU (Frankfurt) and China (Beijing) regions, Amazon S3 supports only Signature Version 4. In all other regions, Amazon S3 supports both Signature Version 4 and Signature Version 2.

*Example value*: `'v4'`

*Default*: `undefined`

## Prerequisites

The following properties are expected to be present on the deployment `context` object:
Expand Down
6 changes: 6 additions & 0 deletions lib/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ module.exports = CoreObject.extend({
const secretAccessKey = this._plugin.readConfig('secretAccessKey');
const sessionToken = this._plugin.readConfig('sessionToken');
const profile = this._plugin.readConfig('profile');
const signatureVersion = this._plugin.readConfig('signatureVersion');

if (accessKeyId && secretAccessKey) {
this._plugin.log('Using AWS access key id and secret access key from config', { verbose: true });
s3Options.accessKeyId = accessKeyId;
s3Options.secretAccessKey = secretAccessKey;
}

if (signatureVersion) {
this._plugin.log('Using signature version from config', { verbose: true });
s3Options.signatureVersion = signatureVersion;
}

if (sessionToken) {
this._plugin.log('Using AWS session token from config', { verbose: true });
s3Options.sessionToken = sessionToken;
Expand Down

0 comments on commit e4c1eb8

Please sign in to comment.