fix: allow to override some nested values in config. #374
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently it is not possible to override some values in the config if they are nested such as
SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS
. It is still not possible to override some values that are nested insidearray
but this at least should allow to replace the whole array with some serialized JSON struct. It is not ideal but it should have some more options to deal with injecting secrets into Kratos et al.Related issue(s)
This is a follow up on ory/kratos#1535
Checklist
and signed the CLA.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got green light (please contact
[email protected]) from the maintainers to push
the changes.
works.
appropriate).
Further comments
My initials investigation showed that even if I can generate nested keys for elements inside JSON arrays it is still hard to (impossible? knadh/koanf#74) to make koanf to properly set those variables into the config:
For reference Viper seems to support such cases (see: https://github.com/spf13/viper#accessing-nested-keys) and I know Viper is different kind of beast and has it's own set of problems but perhaps it is wise to look for alternative? Another option might be to use combined config that are merged into one (still not ideal but would help with secrets handling?).