adnanh / webhook

webhook is a lightweight incoming webhook server to run shell commands
MIT License
10.29k stars 827 forks source link

How to pass a mutative token for validation #416

Open xblockchain opened 4 years ago

xblockchain commented 4 years ago

For example,the webhook implemented with a programmable app,and user has a token to pass for identifing his passport,the token will be different each request,not just pass a github/bitbucket json config,you can't write a mutative token as a immutable parameter with validation.

Any idea for this?

moorereason commented 4 years ago

You'll likely need to rely on an outside program to validate the token. Today, I'd say you would need to pass all of that off to the execute-command.

@adnanh is working on a "pre-hook" feature that could be used to do the token validation (with an outside program) and inject the JSON validation results into the rules conditions.

But out of curiosity, how is your token calculated? What would you need in order to validate the token?

xblockchain commented 4 years ago

@moorereason A single App for trigger auto deploy the repository,not from github/bitbucket,that need identity the user's passport,he should be has a permission to execute the trigger action,so a token should be designed for this.

By the way,if a outside program designed,it seems a little complicated,if the developer will program with the new feature via adnanh,why not do the whole plan himself,adnanh will be not necessary

moorereason commented 4 years ago

Looking at this request again today, I'm not sure I understand exactly what you're wanting.

Can you mock up an example of how you would like this to work?

adnanh commented 3 years ago

@moorereason an example could be a TOTP implementation, something #356 could help with.