Socket
Socket
Sign inDemoInstall

aws4

Package Overview
Dependencies
1
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.1 to 0.2.2

101

example.js

@@ -67,2 +67,8 @@ var http = require('http'),

request(aws4.sign({ service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15' }))
/*
<DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2014-06-15/">
...
*/
request(aws4.sign({ service: 'sns', path: '/?Action=ListTopics' }))

@@ -140,2 +146,20 @@ /*

request(aws4.sign({ service: 'cloudfront', path: '/2014-05-31/distribution' }))
/*
<DistributionList xmlns="http://cloudfront.amazonaws.com/doc/2014-05-31/">
...
*/
request(aws4.sign({ service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15' }))
/*
<DescribeCacheClustersResponse xmlns="http://elasticache.amazonaws.com/doc/2014-07-15/">
...
*/
request(aws4.sign({ service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31' }))
/*
<DescribeJobFlowsResponse xmlns="http://elasticmapreduce.amazonaws.com/doc/2009-03-31">
...
*/
request(aws4.sign({ service: 'storagegateway', body: '{}', headers: {

@@ -177,17 +201,29 @@ 'Content-Type': 'application/x-amz-json-1.1',

// Still not updated to v4...
request(aws4.sign({ service: 'route53domains', body: '{}', headers: {
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
}}))
/*
{"Domains":[]}
...
*/
//request(aws4.sign({ service: 'ec2', path: '/?Action=DescribeRegions&Version=2012-12-01' }))
request(aws4.sign({ service: 'kinesis', body: '{}', headers: {
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Kinesis_20131202.ListStreams'
}}))
/*
{"HasMoreStreams":false,"StreamNames":[]}
...
*/
//request(aws4.sign({ service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2012-11-15' }))
request(aws4.sign({ service: 'cloudtrail', body: '{}', headers: {
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
}}))
/*
{"trailList":[]}
...
*/
//request(aws4.sign({ service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31' }))
//request(aws4.sign({ service: 'importexport', path: '/?Action=ListJobs&Version=2010-06-01' }))
//request(aws4.sign({ service: 'sdb', path: '/?Action=ListDomains&Version=2009-04-15' }))
//request(aws4.sign({ service: 'route53', path: '/2012-02-29/hostedzone' }))
/*
request(aws4.sign({

@@ -201,3 +237,44 @@ service: 'swf',

}))
/*
{"domainInfos":[]}
...
*/
request(aws4.sign({
service: 'cognito-identity',
body: JSON.stringify({
Operation: 'com.amazonaws.cognito.identity.model#ListIdentityPools',
Service: 'com.amazonaws.cognito.identity.model#AWSCognitoIdentityService',
Input: {MaxResults: 1},
}),
headers: {
'Content-Type': 'application/json',
'X-Amz-Target': 'com.amazonaws.cognito.identity.model.AWSCognitoIdentityService.ListIdentityPools'
}
}))
/*
{"Output":{"__type":"com.amazonaws.cognito.identity.model#ListIdentityPoolsResponse","IdentityPools":[],"NextToken":null},"Version":"1.0"}
...
*/
request(aws4.sign({
service: 'mobileanalytics',
path: '/2014-06-05/events',
body: '{"events":[]}',
headers: {
'Content-Type': 'application/json',
}
}))
/*
{"__type":"com.amazon.coral.validate#ValidationException","message":"1 validation error detected.
...
*/
// Still not updated to v4...
//request(aws4.sign({ service: 'route53', path: '/2013-04-01/hostedzone' }))
//request(aws4.sign({ service: 'importexport', path: '/?Action=ListJobs&Version=2010-06-01' }))
//request(aws4.sign({ service: 'sdb', path: '/?Action=ListDomains&Version=2009-04-15' }))

2

package.json
{
"name": "aws4",
"version": "0.2.1",
"version": "0.2.2",
"description": "Signs and prepares requests using AWS Signature Version 4",

@@ -5,0 +5,0 @@ "author": "Michael Hart <michael.hart.au@gmail.com> (http://github.com/mhart)",

@@ -9,3 +9,4 @@ aws4

This signature is supported by an increasing number of Amazon services, including
This signature is supported by nearly all Amazon services, including
[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/),
[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/),

@@ -16,4 +17,9 @@ [SNS](http://docs.aws.amazon.com/sns/latest/api/),

[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html),
[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/),
[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/),
[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/),
[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/),
[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/),
[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/),
[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/),
[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html),

@@ -29,5 +35,14 @@ [CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html),

[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/),
[SES](http://docs.aws.amazon.com/ses/latest/APIReference/) and
[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/).
[SES](http://docs.aws.amazon.com/ses/latest/APIReference/),
[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/),
[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html),
[Cognito](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/),
[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/) and
[Route53 Domain Registration](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html).
Indeed, the only AWS services that *don't* support v4 as of 09-09-2014 are
[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html),
[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html) and
[Route53 Hosted Zones, etc](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html)
It also provides defaults for a number of core AWS headers and

@@ -112,2 +127,8 @@ request parameters, making it a very easy to query AWS services, or

request(aws4.sign({ service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15' }))
/*
<DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2014-06-15/">
...
*/
request(aws4.sign({ service: 'sns', path: '/?Action=ListTopics' }))

@@ -185,2 +206,20 @@ /*

request(aws4.sign({ service: 'cloudfront', path: '/2014-05-31/distribution' }))
/*
<DistributionList xmlns="http://cloudfront.amazonaws.com/doc/2014-05-31/">
...
*/
request(aws4.sign({ service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15' }))
/*
<DescribeCacheClustersResponse xmlns="http://elasticache.amazonaws.com/doc/2014-07-15/">
...
*/
request(aws4.sign({ service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31' }))
/*
<DescribeJobFlowsResponse xmlns="http://elasticmapreduce.amazonaws.com/doc/2009-03-31">
...
*/
request(aws4.sign({ service: 'storagegateway', body: '{}', headers: {

@@ -221,2 +260,72 @@ 'Content-Type': 'application/x-amz-json-1.1',

*/
request(aws4.sign({ service: 'route53domains', body: '{}', headers: {
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
}}))
/*
{"Domains":[]}
...
*/
request(aws4.sign({ service: 'kinesis', body: '{}', headers: {
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Kinesis_20131202.ListStreams'
}}))
/*
{"HasMoreStreams":false,"StreamNames":[]}
...
*/
request(aws4.sign({ service: 'cloudtrail', body: '{}', headers: {
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
}}))
/*
{"trailList":[]}
...
*/
request(aws4.sign({
service: 'swf',
body: '{"registrationStatus":"REGISTERED"}',
headers: {
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'SimpleWorkflowService.ListDomains'
}
}))
/*
{"domainInfos":[]}
...
*/
request(aws4.sign({
service: 'cognito-identity',
body: JSON.stringify({
Operation: 'com.amazonaws.cognito.identity.model#ListIdentityPools',
Service: 'com.amazonaws.cognito.identity.model#AWSCognitoIdentityService',
Input: {MaxResults: 1},
}),
headers: {
'Content-Type': 'application/json',
'X-Amz-Target': 'com.amazonaws.cognito.identity.model.AWSCognitoIdentityService.ListIdentityPools'
}
}))
/*
{"Output":{"__type":"com.amazonaws.cognito.identity.model#ListIdentityPoolsResponse","IdentityPools":[],"NextToken":null},"Version":"1.0"}
...
*/
request(aws4.sign({
service: 'mobileanalytics',
path: '/2014-06-05/events',
body: '{"events":[]}',
headers: {
'Content-Type': 'application/json',
}
}))
/*
{"__type":"com.amazon.coral.validate#ValidationException","message":"1 validation error detected.
...
*/
```

@@ -223,0 +332,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc