aws-sign

Calculates Authorization header for Amazon AWS REST requests

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
Last updated 6 years ago by egorfine .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install aws-sign 
SYNC missed versions from official npm registry.

node-aws-sign

Simple module to calculate Authorization header for Amazon AWS REST requests.

Simple it is:

const AwsSign = require('aws-sign');
const signer = new AwsSign({
	accessKeyId: 'AKIAIOSFODNN7EXAMPLE',
	secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
});

const opts = {
	method: 'PUT',
	host: 'johnsmith.s3.amazonaws.com',
	path: '/photos/puppy.jpg',
	headers: { ... },
	... // Other request options, ignored by AwsSign.
};
signer.sign(opts);
https.request(opts, ...);

The following keys are mandatory:

  • method
  • host
  • path

Others are optional. A date header (headers.date) will be added for you if it is not already set.

Non-goals

There is no support for path-style bucket access.

x-amz-date substitution is not supported because Node's http module has no problems setting Date header.

Multiple x-amz- keys are not supported. I.e. the following part of the example won't work:

X-Amz-Meta-ReviewedBy: joe@johnsmith.net
X-Amz-Meta-ReviewedBy: jane@johnsmith.net

Use a single header instead:

X-Amz-Meta-ReviewedBy: joe@johnsmith.net,jane@johnsmith.net

Testing

mocha test/

Installation

npm install aws-sign

Author

Egor Egorov, me@egorfine.com.

License

MIT.

Current Tags

  • 1.0.1-beta.0                                ...           beta (6 years ago)
  • 1.0.1                                ...           latest (6 years ago)

12 Versions

  • 1.0.1 [deprecated]           ...           6 years ago
  • 1.0.1-beta.0 [deprecated]           ...           6 years ago
  • 1.0.0 [deprecated]           ...           8 years ago
  • 0.5.0 [deprecated]           ...           8 years ago
  • 0.2.1 [deprecated]           ...           8 years ago
  • 0.1.2 [deprecated]           ...           11 years ago
  • 0.3.0 [deprecated]           ...           14 years ago
  • 0.2.0 [deprecated]           ...           14 years ago
  • 0.1.1 [deprecated]           ...           14 years ago
  • 0.1.0 [deprecated]           ...           14 years ago
  • 0.0.2 [deprecated]           ...           14 years ago
  • 0.0.1 [deprecated]           ...           14 years ago
Downloads
Total 62
Today 0
This Week 3
This Month 34
Last Day 2
Last Week 8
Last Month 4
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE