-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for webhook authentication #820
base: main
Are you sure you want to change the base?
Conversation
We're now going with a simple verification_token method |
@rafaelsideguide can you review this when you get a chance? tks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the response still using snake case
|
Plus one for this update, we can't use webhooks without basic security features |
Adds a verification_token field to the crawl URL, used with the webhook field. It accepts a nonce string for the server to verify upon receiving webhooks, ensuring they originate from a legitimate source.
Adds HMAC-SHA256 verification on webhooks
If provided with a "secretKey" in the request body, the webhook response will now contain a header,
"Webhook-Signature": "sha256=<hash>"
The <hash> being a SHA256 hash with the secretKey on the raw request body string.
Example of verifying the request body with express.jsMake sure to use the body string before it is parsed to JSON (JSON.parse() or equivalent). Ideally in a middleware.
Fixes #813