🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

aws-signature

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-signature

Module to calculate aws signature

1.0.0-rc1
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

aws

FAQs

Package last updated on 13 Aug 2019

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