X-Hub-Signature check
A function to check the integrity of a body payload against it's x-hub-signature header for a given shared secret. Used by Facebook Messenger Webhook POST requests
Usage
With express.js
;;; const expressConfig = port: 8088 postPath: '/fbwebhook' messages: `Server running on port ` ;const xHubConfig = algo: 'sha1' secret: 'MY_APP_SECRET' messages: wrongSignature: 'Content signature don\'t match' ;const app = ;const postEndPoint = ;app;app;app;
With claudia-api-builder
;; const api = ;const xHubConfig = algo: 'sha1' secret: 'MY_APP_SECRET' messages: wrongSignature: 'Content signature don\'t match' api; ;
With claudia-api-builder and a callback
;; const api = ;const myCallback = { return foo: 'bar' ;}const xHubConfig = algo: 'sha1' secret: 'MY_APP_SECRET' messages: wrongSignature: 'Content signature don\'t match' next: myCallback api; ;