Skip to content

A library that can be used to sign URIs using an HMAC strategy

Notifications You must be signed in to change notification settings

major-mann/uri-hmac-sign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URI HMAC Signer

A module for signing and validating URIs using HMAC.

Installation

npm i uri-hmac-sign

Usage

const createSigner = require('uri-hmac-sign');
const signer = createSigner({
    key: 'Your signing key goes here',
    algorithm: 'The algorithm to use with the HMAC',
    // Whether to order the querystring parameters (A function will be used as the sort argument),
    order: true,
    // The name of the querystring value that should be used to store the hash in the URI
    querystringName: 'hash' // Defaults to hash
});

let signed = signer.sign('http://your.abso/ute.uri/here');
signer.validate(signed);

signed = signer.sign('/relative/uris/work/well/too');
signer.validate(signed);

About

A library that can be used to sign URIs using an HMAC strategy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published