# aws-sign

> Calculates Authorization header for Amazon AWS REST requests

Latest version **1.0.1** (published 2020-11-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install aws-sign
pnpm add aws-sign
yarn add aws-sign
bun add aws-sign
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-11-20 |
| First published | 2012-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Egor Egorov |
| Maintainers | mikeal, nylen, egorfine |

## Links

- npm: https://www.npmjs.com/package/aws-sign
- Repository: https://github.com/egorFiNE/node-aws-sign
- Issues: https://github.com/egorFiNE/node-aws-sign/issues
- npm.io page: https://npm.io/package/aws-sign

## Recent versions

- 1.0.1 (latest) — 2020-11-20
- 1.0.1-beta.0 (beta) — 2020-11-12
- 1.0.0 — 2018-08-16
- 0.5.0 — 2018-08-16
- 0.2.1 — 2018-08-02
- 0.1.2 — 2016-05-19
- 0.3.0 — 2013-04-22
- 0.2.0 — 2013-03-01
- 0.1.1 — 2012-10-24
- 0.1.0 — 2012-10-08
- 0.0.2 — 2012-06-10
- 0.0.1 — 2012-06-10

## README

# node-aws-sign

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

Simple it is:

```javascript
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.

---
_Source: https://npm.io/package/aws-sign · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
