storage/static.go: expand environment variables in client ID and secret#1664
Conversation
…c clients Having ID and Secret in clear inside configuration files for static clients is not ideal. This commit allows setting these from environment variables. Signed-off-by: Yann Soubeyrand <[email protected]>
|
Apologies for after-the-fact commentary - but I have tested this and it works. For the benefit of others who might stumble across this (and for the authors and maintainers) - the use of the env var in static client config is different that the use of env var in other areas of the same config file. for example, in configuring the google connector - you'd do this: Later - in the same configmap, to ref "secretEnv" - you'd do this: Note - no $ before the env var ref, when (by convention) the variable name ends in Env. I've built from source, and can confirm this does work. Ultimately i'd love to see more consistency in the use of env vars across the configmap yaml, but I do appreciate everyone's work. This was a blocker for me - as of yesterday, and found your PR today. thanks ! |
|
@paul-theorem you can see #1428 (comment) for an explanation of the inconsistency. |
|
@lhotrifork This has changed the behaviour of the config validation slightly, you could previously omit the For example, this is no longer a valid config: (from argo-cd) |
|
@thesuperzapper an ugly but working workaround is to add |
Fixes gabibbo97#36 Relative to dexidp/dex#1664 Requires Dex >= v2.23.0
Having ID and Secret in clear inside configuration files for static
clients is not ideal. This commit allows setting these from environment
variables.
Signed-off-by: Yann Soubeyrand [email protected]
Rebased Yann's changes from: #1428