Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add integration test for session token support

  • Loading branch information...
commit 464d873064a6d20eb3336b2331ca3dbd10d44af8 1 parent aab9f21
Chase Douglas authored
Showing with 34 additions and 2 deletions.
  1. +3 −2 package.json
  2. +31 −0 test/integration/dynode-test.js
View
5 package.json
@@ -21,11 +21,12 @@
},
"devDependencies": {
"mocha" : "1.3.x",
- "chai": "1.1.x"
+ "chai": "1.1.x",
+ "awssum": "0.12.x"
},
"scripts": {
"test" : "make test"
},
"engines": { "node": ">= 0.6.0" },
"main": "./lib/dynode"
-}
+}
View
31 test/integration/dynode-test.js
@@ -1,6 +1,7 @@
var dynode = require("../../lib/dynode"),
DynamoDB = require('../test-helper'),
util = require('utile'),
+ awssum = require('awssum'),
should = require('chai').should();
describe('Dynode Integration Tests', function() {
@@ -276,4 +277,34 @@ describe('Dynode Integration Tests', function() {
});
});
+ describe("Using IAM Session Token", function() {
+ it("Should list all tables", function(done) {
+ var amazon = awssum.load('amazon/amazon');
+ var Sts = awssum.load('amazon/sts').Sts;
+
+ var sts = new Sts({
+ accessKeyId: process.env.AWS_ACCEESS_KEY_ID,
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
+ region: amazon.US_EAST_1
+ });
+
+ sts.GetSessionToken({DurationSeconds: 900}, function(err, results) {
+ should.not.exist(err);
+ var token = results.Body.GetSessionTokenResponse.GetSessionTokenResult.Credentials.SessionToken;
+
+ dynode.auth({
+ accessKeyId: process.env.AWS_ACCEESS_KEY_ID,
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
+ token: token
+ });
+
+
+ dynode.listTables({}, function(err, tables) {
+ should.not.exist(err);
+ tables.should.have.property("TableNames");
+ done();
+ });
+ });
+ });
+ });
});
Please sign in to comment.
Something went wrong with that request. Please try again.