aws-signature
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-rc1 • Public • Published

aws-signature

This project serves utility functions to calculate aws version 4 signature to do AWS_IAM authorisation.

Installation

npm i aws-signature -S

How to import

import {signRequest} from aws-signature

const signedRequest = signRequest({
            service: 'execute-api',
            region: 'us-east-1',
            endpoint: 'http://localhost/foo/bar?q=foo',
            method: 'PUT',
            contentType: 'application/json',
            body: {
                sample: 'sampleJsonBody'
            },
            headers: {
                'x-api-key': 'wkjfnkw8efwnef'
            },
            credentials: {
                accessKeyId: 'foo',
                secretAccessKey: 'bar',
                sessonToken: 'foobar'
            }
        });

const headers = signedRequest['headers']; // contains signature headers

Readme

Keywords

Package Sidebar

Install

npm i aws-signature

Weekly Downloads

1

Version

1.0.0-rc1

License

MIT

Unpacked Size

14.2 kB

Total Files

12

Last publish

Collaborators

  • chaitanya11