Skip to content

Commit

Permalink
Changed client to accept access key and secret access key
Browse files Browse the repository at this point in the history
  • Loading branch information
sparkyfen committed Aug 30, 2013
1 parent 784e772 commit 4351a05
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/connect-dynamodb.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@ module.exports = function (connect) {
Store.call(this, options);
this.prefix = null == options.prefix ? 'sess:' : options.prefix;

this.AWSConfigPath = options.AWSConfigPath || './aws-config.json';
this.accessKeyId = options.accessKeyId || '';
this.secretAccessKey = options.secretAccessKey || '';
this.region = options.region || '';
this.endpoint = options.endpoint || '';

if (options.client) {
this.client = options.client;
} else {
AWS.config.loadFromPath(this.AWSConfigPath);
this.client = new AWS.DynamoDB();
this.client = new AWS.DynamoDB({
accessKeyId: this.accessKey,
secretAccessKey: this.secretAccessKey,
region: this.region,
endpoint: this.endpoint
});
}

this.table = options.table || 'sessions';
Expand Down

0 comments on commit 4351a05

Please sign in to comment.