-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading ENV vars still not working #305
Comments
Did you set the enabled flag to true? |
Version 0.0.80 includes the changes required. There might still be a bug somewhere, but it should work. Maybe double check that enabled flag is set to true (for both the authentiactor and pre auth) and also post the log message you're seeing here! |
INFO[0000] Config file loaded successfully. path=../../security/oathkeeper/config.yaml |
Using ory/x 0.0.82 seems to get rid of that error |
Also, regardless of what version of ory/x, if I set the env var
it is still using the value from the config.yaml |
Let's bump ory/x then :) Would you be up for a PR? |
Yes, but I still can't get the INTROSPECTION_URL env var to work |
Could you provide a reproducible case & configuration? That would help a lot! |
config.yaml
rules.json
Run the following commands
Error I get when calling the proxy
|
Ok thanks, I'll look into it |
Is it a workaround for you to remove the setting from the config.yaml for now? |
I think issue may be that GetStringMap doesn't replace the values with the env vars here https://github.com/ory/oathkeeper/blob/master/driver/configuration/provider_viper.go#L188 |
So I checked the code and as far as I can tell, it's set up correctly: https://github.com/ory/x/blob/master/viperx/bind_env.go#L37-L39 Basically, we're using I was under the impression that env vars take precedence over config file values. Reading through the viper code, it also appears that that's the case: https://github.com/ory/viper/blob/master/viper.go#L1148-L1176 Basically I'm really not sure what's causing this, it would be awesome if you could help debug this! I'm unfortunately very busy with other porojects atm :/ |
I've been looking into this...
|
We're extracting all of the configuration keys from the configuration json schema and then do some transformation to add them to viper as env vars. You can find the code here: https://github.com/ory/x/blob/master/viperx/bind_env.go#L19-L51 |
The extracting works fine, so |
Ah I see - nice find! I also saw the PR. I think we can solve it a bit more generic so that this also works on other levels and with over keys not named |
Good call, PR is updated |
Describe the bug
Setting env var of say
AUTHENTICATORS_OAUTH2_INTROSPECTION_CONFIG_PRE_AUTHORIZATION_CLIENT_ID
doesn't load the configI think the ory/x dependency just needs updated to 0.0.85
The text was updated successfully, but these errors were encountered: