Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-sign

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-sign

Calculates Authorization header for Amazon AWS REST requests

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
60K
decreased by-6.61%
Maintainers
3
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 20 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc