as

aws-sign

Calculates Authorization for Amazon AWS REST requests

Showing:

Popularity

Downloads/wk

34.2K

GitHub Stars

21

Maintenance

Last Commit

1yr ago

Contributors

4

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial