It would be great to have the ability to authenticate the webhook requests so that they can't be triggered by undesirable 3rd parties.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | webhook_validator.tar_.gz | 768 bytes | fp |
| #2 | webhook.module-validator-2330651.patch | 1.04 KB | fp |
Comments
Comment #1
fp commentedComment #2
fp commentedHere's a proof of concept. Please let me know your feedback.
Comment #3
skwashd commentedI will have to think about this.
Webhooks are supposed to be stateless, so I am not in favour of adding support for authentication. If you want to implement HTTP Basic Authentication to restrict access to the webhook endpoint/s then do it higher up the stack in your web server or cache server config.
GitHub and some other services implement a pre shared key, so you can check for the key in the processor. This is how I currently validate requests where this is potentially an issue.
I found a couple of issues with your patch too. I haven't looked at your webhook_validator module.
Trailing whitespace.
Use
drupal_access_denied()here.Comment #4
skwashd commentedNo update for 8 years. Closing.