kiwigrid / k8s-sidecar

This is a docker container intended to run inside a kubernetes cluster to collect config maps with a specified label and store the included files in a local folder.
MIT License
563 stars 181 forks source link

Support for file based configuration of REQ_USERNAME and REQ_PASSWORD #318

Closed wasim-nihal closed 3 months ago

wasim-nihal commented 8 months ago

Currently the user can configure the basic auth credentials like username and password for REQ_URL or '*.url' only via environment variables. But in most of the organizations including that of mine, such sensitive data cannot via set via hardcoding or using environment variables.

So it is better to have a file based configuration, something like introducing environment variables like REQ_USERNAME_FILE and REQ_PASSWORD_FILE or introduce cli flags namely (--req-username-file and --req-password-file) for taking in the files (paths) for username and password respectively and use for basic auth configuration. This would be beneficial in the context of k8s where these files containing credentials can be mounted using k8s secrets and subsequently used by this sidecar.

I am currently working on this feature and if the community feels it useful, I would be happy to submit a pull request for the same.

wasim-nihal commented 7 months ago

Hi @jekkel / @ChristianGeie, could you please let me know if the proposed changes are acceptable for the community? I would like to submit a PR for the same.