0.0.4 • Published 9 years ago

barkingiguana-verify v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

verify.js

Node.js port of https://github.com/barkingiguana/verify

I got fed up of people telling me they couldn't use time based signed actions because there was no client library for Node.js.

I'm sure there are lots of valid criticisms for the approach I've taken in BarkingIguana::Verify. I'd like to hear those and not whining about lack of suitable clients libraries.

Installing

npm install barkingiguana-verify

Usage

verify  = require('barkingiguana-verify');

baseUrl = 'http://example.com';
username = 'craigw';
password = '123456-1234-1234-123456';
intent = verify.expressIntent('DELETE', '/resource/123', { confirm: true });
intentExpiry = new Date();
intentExpiry.setTime(1422724138000);
action = intent.sign(username, password, intentExpiry);
url = baseUrl + action.getSignedPath();

// Now make the request to that URL.
require('request')({ uri: url, method: "DELETE" }, function(error, response, body) {
  console.log("Performed action")
})
0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.0

9 years ago