ncarlier/webhookd

[Feature Request]: basic auth for multiple users

smox opened this issue · 3 comments

smox commented

Hello,

I want that different systems can call different scripts on one target system.
According to you documentation it is only possible to create one user in webhookd.
I don't want that every system is allowed to call every script on the target system.

Is it possible to get a feature to create more than one user?

For example:
user1 -> allowed to access scripts in ./scripts/user1
user2 -> allowed to access scripts in ./scripts/user2

and so on?

smox commented

Nevermind, I will place a webserver (e.g apache, nginx, traefik, ...) in front of it and protect the route with it. I guess this will work. You can close it if you want.

You can have several users in the htpassd file. However the only way to limit a script for a given user would be to decode the Authorization header and validate the username in the script.

Last commit adds X-WebAuth-User header (x_webauth_user shell variable) to the script. Maybe it can help to allow a script to continue or not it's execution.