webhook icon indicating copy to clipboard operation
webhook copied to clipboard

trigger rule for matching a parameter to a value from a file?

Open classabbyamp opened this issue 5 years ago • 2 comments

basically what I want to do is to store a secret key in a file that webhook would read, then compare that value to a header on the incoming webhook.

Is there a way to do that? Is there another way to do it with some other method, without hard-coding the value of the token in the hooks.json file?

classabbyamp avatar Oct 10 '20 01:10 classabbyamp

webhook doesn't provide an easy way to do that, currently. Could be possible to write your own solution with https://github.com/adnanh/webhook/issues/356 once it's completed.

moorereason avatar Oct 10 '20 17:10 moorereason

Two alternatives come to mind that you could use currently:

  • Set up your hook to call a wrapper that checks the headers for the secret key, which it can read from the file when the hook fires.

  • Enable hot reloading of the hooks file and have a script that transforms a base template of it by adding a comparison requirement.

VariableVixen avatar Oct 10 '20 18:10 VariableVixen