dokku / dokku-http-auth

dokku plugin that gives the ability to manage HTTP basic auth for an application
MIT License
84 stars 20 forks source link

Allow multiple users #9

Closed fruitl00p closed 2 years ago

fruitl00p commented 5 years ago

Instead of regenerating the htpasswd file, it now appends to it to allow for multiple users to be added.

This might need more intelligent updating of existing users instead of just appending them. Also one could argue that there should be a way to remove a user from the auth. (including a warning if auth=on but there are no users left to match against)

fruitl00p commented 5 years ago

@josegonzalez as you correctly mentioned, i've (re)created the PR here. Again I do feel this PR is a bit light and I can imagine how it should be better / more complete, I just don't have the shell-fu to fix it ;)

josegonzalez commented 5 years ago

One thing I'm going to expose in dokku-core fairly soon is the properties functions. Some are already there in bash, but the golang implementation also includes list manipulation (in the future, we may add sets as well).

Using both of these, we can expose managing multiple users fairly easily, and just rebuild the file based on what is stored in the properties plugin.

fruitl00p commented 5 years ago

We could keep this PR open, wait for the addition (which sounds nice!) and rebuild the plugin from there.. (and use this PR to track?)

josegonzalez commented 5 years ago

Sure

malimccalla commented 5 years ago

This would be a great addition! Is there somewhere to track the dokku-core change that this relies on?

josegonzalez commented 2 years ago

The properties functions have since been exposed, so if someone wants to redo this PR to use the above to manage adding/removing users, that would work for me :)

josegonzalez commented 2 years ago

Okay I lied, it was easy enough for me to implement this while cleaning up the plugin. Hope folks enjoy the changes!