0.0.1 • Published 7 years ago
webhook-auth v0.0.1
Authentication on Webhooks
Sign or Verify HTTP Requests
Usage
auth = require('@finco-services/webhook-auth');
To verify...
// ... Express boilerplate ...
app.use('/v1', (req, res) => {
if (!auth.verify(sign, req)) {
return;
}
// work on the request...
});
To sign...
const body = {...} // an object to transmit
const headers = auth.sign(secret, {body: body});
let req = {
body: body,
headers: headers
};
request.port(url, req);
0.0.1
7 years ago