Skip to content
Browse files

Add support for temporary security tokens

  • Loading branch information...
1 parent f622e49 commit aab9f2159e0a3ce97af8b01c1aed41a061a4cf2f Chase Douglas committed Oct 24, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/dynode/request.js
View
6 lib/dynode/request.js
@@ -6,6 +6,9 @@ var http = require("http"),
var Request = exports.Request = function Request(config) {
this.credentials = {accessKeyId: config.accessKeyId, secretAccessKey: config.secretAccessKey};
+ if ('securityToken' in config)
+ this.credentials.securityToken = config.securityToken;
+
this.config = _.defaults(config, {
prefix : "DynamoDB_20111205.",
region: "us-east-1"
@@ -39,6 +42,9 @@ Request.prototype.send = function(action, messageBody, cb) {
headers.authorization = Signer.authorization(self.credentials, req, date, self.config.region);
+ if ('securityToken' in self.credentials)
+ headers["x-amz-security-token"] = self.credentials.securityToken;
+
var opts = {
method : req.method,
path : req.uri,

0 comments on commit aab9f21

Please sign in to comment.
Something went wrong with that request. Please try again.