Registry / devops / aws-sign

aws-sign

JSON →
library1.0.1jsnpmunverified

Simple Node.js module to calculate the AWS Authorization header for REST requests to Amazon S3. Version 1.0.1 is the latest stable release. This package has not been updated since 2013 and is considered legacy. It only supports AWS Signature Version 2, not the newer Signature Version 4 used by most AWS services today. It does not support path-style bucket access, multiple x-amz- headers, or x-amz-date substitution. For new projects, use the official AWS SDK or a library like aws4 that supports Signature V4.

npm install aws-sign
INSTALL
IMPORT
SIG · AWS-SIGN
A
aws-sign
devopsjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const AwsSign = require('aws-sign');
import AwsSign from 'aws-sign';
This package is CommonJS only; no ESM or TypeScript definitions provided.
AwsSign
const AwsSign = require('aws-sign'); const signer = new AwsSign({...});
const signer = new AwsSign(); // missing credentials.
The constructor requires an object with accessKeyId and secretAccessKey.
sign method
signer.sign({ method: 'PUT', host: 'example.com', path: '/' });
signer.sign({}); // missing required keys.
The sign method mutates the options object by adding the Authorization header. Requires method, host, and path.

Demonstrates creating a signer with AWS credentials and signing a request to S3.

const AwsSign = require('aws-sign'); const signer = new AwsSign({ accessKeyId: process.env.ACCESS_KEY_ID ?? '', secretAccessKey: process.env.SECRET_ACCESS_KEY ?? '' }); const opts = { method: 'PUT', host: 'johnsmith.s3.amazonaws.com', path: '/photos/puppy.jpg', headers: { 'Content-Type': 'image/jpeg', 'Content-Length': '94328' } }; signer.sign(opts); console.log(opts.headers['Authorization']);
Debug
Known issues
deprecatedThis package uses AWS Signature Version 2, which is deprecated by AWS. Most AWS services now require Signature Version 4.
fix
Use the official AWS SDK or a library like aws4 that supports Signature V4.
affects: *
gotchaMultiple x-amz- headers with the same key are not supported; only last value is used.
fix
Combine values into a single header with comma-separated values.
affects: *
gotchaPath-style bucket access (e.g., http://s3.amazonaws.com/bucket/key) is not supported.
fix
Use virtual-hosted style (bucket.s3.amazonaws.com).
affects: *
Errors
Common errors & fixes
Error: Missing required key: method
The sign method was called without the required method, host, or path properties.
fix
Ensure opts object has method, host, and path set before calling signer.sign(opts).
TypeError: Cannot read property 'accessKeyId' of undefined
The AwsSign constructor was called without arguments or with an undefined object.
fix
Instantiate with an object containing accessKeyId and secretAccessKey: new AwsSign({ accessKeyId: '...', secretAccessKey: '...' })
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
cryptorequiredUsed for HMAC-SHA1 signing (built-in Node.js module, no npm install needed).
Agent activity
14 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
aws-sign — npm install aws-sign · libregistry