aws-sdk
Advanced tools
Comparing version 0.9.4-pre.5 to 0.9.5-pre.6
@@ -15,4 +15,2 @@ # @title Installing | ||
**Please Note**: Installing the `aws-sdk` npm package on Windows may display errors while trying to install the optional dependency for `libxmljs`. This error can be **safely ignored**. | ||
## Verifying the Installation | ||
@@ -19,0 +17,0 @@ |
@@ -20,2 +20,3 @@ # @title Services | ||
* [AWS.IAM.Client](http://docs.amazonwebservices.com/AWSJavaScriptSDK/latest/frames.html#!http%3A//docs.amazonwebservices.com/AWSJavaScriptSDK/latest/AWS/IAM/Client.html) | ||
* [AWS.OpsWorks.Client](http://docs.amazonwebservices.com/AWSJavaScriptSDK/latest/frames.html#!http%3A//docs.amazonwebservices.com/AWSJavaScriptSDK/latest/AWS/OpsWorks/Client.html) | ||
* [AWS.RDS.Client](http://docs.amazonwebservices.com/AWSJavaScriptSDK/latest/frames.html#!http%3A//docs.amazonwebservices.com/AWSJavaScriptSDK/latest/AWS/RDS/Client.html) | ||
@@ -22,0 +23,0 @@ * [AWS.Redshift.Client](http://docs.amazonwebservices.com/AWSJavaScriptSDK/latest/frames.html#!http%3A//docs.amazonwebservices.com/AWSJavaScriptSDK/latest/AWS/Redshift/Client.html) |
@@ -18,2 +18,3 @@ /** | ||
this.Before("@elastictranscoder", function (callback) { | ||
this.iam = new this.AWS.IAM.Client(); | ||
this.client = new this.AWS.ElasticTranscoder.Client(); | ||
@@ -24,9 +25,2 @@ callback(); | ||
this.Given(/^I create a pipeline$/, function(callback) { | ||
var config = JSON.parse(this.AWS.util.readFileSync('configuration')); | ||
if (!config.elastictranscoderIntegrationRole) { | ||
return callback.pending(); | ||
} | ||
var world = this; | ||
@@ -43,3 +37,3 @@ var timestamp = world.AWS.util.date.unixTimestamp() * 1000; | ||
OutputBucket: world.bucket, | ||
Role: config.elastictranscoderIntegrationRole, | ||
Role: world.iamRoleArn, | ||
Notifications: {"Progressing":"","Completed":"","Warning":"","Error":""} | ||
@@ -46,0 +40,0 @@ }; |
@@ -18,3 +18,3 @@ /** | ||
this.Before("@iam", function (callback) { | ||
this.client = new this.AWS.IAM.Client(); | ||
this.iam = new this.AWS.IAM.Client(); | ||
callback(); | ||
@@ -24,3 +24,4 @@ }); | ||
this.Given(/^I have an IAM username "([^"]*)"$/, function(name, callback) { | ||
this.iamUser = name + '-' + new Date().getTime(); | ||
this.iamUserArn = ''; | ||
this.iamUser = this.uniqueName(name); | ||
callback(); | ||
@@ -30,7 +31,14 @@ }); | ||
this.Given(/^I create an IAM user with the username$/, function(callback) { | ||
this.request(null, 'createUser', {UserName: this.iamUser}, callback, false); | ||
var world = this; | ||
var next = function() { | ||
if (world.data) this.iamUserArn = world.data.User.Arn; | ||
else this.iamUserArn = null; | ||
callback(); | ||
}; | ||
next.fail = callback.fail; | ||
this.request('iam', 'createUser', {UserName: this.iamUser}, next, false); | ||
}); | ||
this.Given(/^I list the IAM users$/, function(callback) { | ||
this.request(null, 'listUsers', {}, callback); | ||
this.request('iam', 'listUsers', {}, callback); | ||
}); | ||
@@ -47,4 +55,31 @@ | ||
this.Then(/^I delete the IAM user$/, function(callback) { | ||
this.request(null, 'deleteUser', {UserName: this.iamUser}, callback); | ||
this.request('iam', 'deleteUser', {UserName: this.iamUser}, callback); | ||
}); | ||
this.Given(/^I create an IAM role with name prefix "([^"]*)"$/, function(name, callback) { | ||
this.iamRoleName = this.uniqueName(name); | ||
var world = this; | ||
var assumeRolePolicyDocument = '{"Version":"2008-10-17","Statement":[' + | ||
'{"Effect":"Allow","Principal":{"Service":["ec2.amazonaws.com"]},' + | ||
'"Action":["sts:AssumeRole"]}]}'; | ||
var params = {RoleName: this.iamRoleName, | ||
AssumeRolePolicyDocument: assumeRolePolicyDocument}; | ||
var next = function() { | ||
world.iamRoleArn = world.data.Role.Arn; | ||
callback(); | ||
} | ||
next.fail = callback.fail; | ||
this.request('iam', 'createRole', params, next); | ||
}); | ||
this.Then(/^the IAM role should exist$/, function(callback) { | ||
this.assert.compare(this.iamRoleArn.length, '>', 0); | ||
callback(); | ||
}); | ||
this.Then(/^I delete the IAM role$/, function(callback) { | ||
this.request('iam', 'deleteRole', {RoleName: this.iamRoleName}, callback); | ||
}); | ||
}; |
@@ -30,2 +30,3 @@ /** | ||
require('./services/iam'); | ||
require('./services/opsworks'); | ||
require('./services/rds'); | ||
@@ -32,0 +33,0 @@ require('./services/redshift'); |
@@ -28,3 +28,3 @@ /** | ||
*/ | ||
VERSION: 'v0.9.4-pre.5', | ||
VERSION: 'v0.9.5-pre.6', | ||
@@ -31,0 +31,0 @@ /** |
@@ -26,5 +26,6 @@ /** | ||
var target = api.targetPrefix + '.' + api.operations[req.operation].n; | ||
var version = api.jsonVersion || '1.0'; | ||
httpRequest.body = JSON.stringify(req.params || {}); | ||
httpRequest.headers['Content-Type'] = 'application/x-amz-json-1.0'; | ||
httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version; | ||
httpRequest.headers['X-Amz-Target'] = target; | ||
@@ -31,0 +32,0 @@ }, |
@@ -16,10 +16,60 @@ /** | ||
try { | ||
// Try to load the libxml based builder -- libxmljs is in the | ||
// "optional dependencies" for this package. When it is not present | ||
// we will defualt to the pure-javascript xmlbuilder library. | ||
// instead use the pure-javascript xmlbuilder | ||
require('./builder_libxmljs'); | ||
} catch (error) { | ||
require('./builder_xmlbuilder'); | ||
} | ||
var AWS = require('../core'); | ||
var builder = require('xmlbuilder'); | ||
var inherit = AWS.util.inherit; | ||
/** | ||
* @api private | ||
*/ | ||
AWS.XML.Builder = inherit({ | ||
constructor: function XMLBuilder(root, rules, options) { | ||
this.root = root; | ||
this.rules = rules; | ||
this.xmlns = options.xmlNamespace; | ||
this.timestampFormat = options.timestampFormat; | ||
}, | ||
toXML: function buildXML(params) { | ||
var xml = builder.create(this.root); | ||
if (this.xmlns) xml.att('xmlns', this.xmlns); | ||
this.serializeStructure(this.rules, params, xml); | ||
return xml.root().toString(); | ||
}, | ||
serializeStructure: function serializeStructure(rules, params, xml) { | ||
AWS.util.each.call(this, rules || {}, function (memberName, memberRule) { | ||
if (params[memberName] !== undefined) { | ||
this.serializeMember(memberName, memberRule, params[memberName], xml); | ||
} | ||
}); | ||
}, | ||
serializeList: function serializeList(name, rules, list, xml) { | ||
if (rules.f) { | ||
AWS.util.arrayEach.call(this, list, function (value) { | ||
this.serializeMember(rules.n || name, rules.m, value, xml); | ||
}); | ||
} else { | ||
xml = xml.ele(name); | ||
AWS.util.arrayEach.call(this, list, function (value) { | ||
var memberName = rules.m.n || 'member'; | ||
this.serializeMember(memberName, rules.m, value, xml); | ||
}); | ||
} | ||
}, | ||
serializeMember: function serializeMember(memberName, rules, params, xml) { | ||
var name = memberName; | ||
if (rules.t === 'o') { // structure (object) | ||
this.serializeStructure(rules.m, params, xml.ele(name)); | ||
} else if (rules.t === 'a') { // list (array) | ||
this.serializeList(name, rules, params, xml); | ||
} else if (rules.t === 't') { // timestamp | ||
xml.ele(name, String(AWS.util.date[this.timestampFormat](params))); | ||
} else { | ||
xml.ele(name, String(params)); | ||
} | ||
} | ||
}); |
{ | ||
"name": "aws-sdk", | ||
"description": "AWS SDK for JavaScript", | ||
"version": "v0.9.4-pre.5", | ||
"version": "v0.9.5-pre.6", | ||
"author": { | ||
@@ -26,5 +26,2 @@ "name":"Amazon Web Services", | ||
}, | ||
"optionalDependencies": { | ||
"libxmljs": "latest" | ||
}, | ||
"main": "lib/aws.js", | ||
@@ -31,0 +28,0 @@ "directories": { |
@@ -15,4 +15,2 @@ # AWS SDK for Node.js [![Build Status](https://travis-ci.org/aws/aws-sdk-js.png?branch=master)](https://travis-ci.org/aws/aws-sdk-js) | ||
**Please Note**: Installing the `aws-sdk` npm package on Windows may display errors while trying to install the optional dependency for `libxmljs`. This error can be **safely ignored**. | ||
## Usage | ||
@@ -132,2 +130,7 @@ | ||
<tr> | ||
<td>AWS OpsWorks</td> | ||
<td>2013-02-18</td> | ||
<td>AWS.OpsWorks</td> | ||
</tr> | ||
<tr> | ||
<td>Amazon Relational Database Service</td> | ||
@@ -134,0 +137,0 @@ <td>2012-07-31</td> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
3148116
2
188
68883
201