Skip to content

Commit

Permalink
breaking change where s3 credentials need to be handed over
Browse files Browse the repository at this point in the history
  • Loading branch information
frytg committed Aug 13, 2020
1 parent ddc7ef4 commit b565496
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swrlab/node-storage-wrapper",
"version": "0.0.10",
"version": "0.0.11",
"description": "Wrapping AWS S3, GCP GCS, file storage",
"main": "./src/index.js",
"engines": {
Expand Down
12 changes: 9 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ function StorageWrapper(config) {

// load aws sdk
if (config.s3) {
AWS.config.loadFromPath(config.s3);
this.sdk.s3 = new AWS.S3();
this.sdk.s3 = new AWS.S3(config.s3);
}

// configure logging
Expand Down Expand Up @@ -60,7 +59,14 @@ function StorageWrapper(config) {
this.save = require('./save');

// log progress
this.sdk.log(this, 'log', ['storage.index', 'loaded config >', JSON.stringify({ config })]);
this.sdk.log(this, 'log', [
'storage.index',
'loaded config',
JSON.stringify({
gs: config.gs ? config.gs.projectId : null,
s3: config.s3 ? { accessKeyId: config.s3.accessKeyId, region: config.s3.region } : null,
}),
]);
}

// export
Expand Down

0 comments on commit b565496

Please sign in to comment.