Skip to content
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

fix unmarshaling of expanded environment variables with special characters #3770

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tuminoid
Copy link
Contributor

Overview

If we expand environment values directly with os.ExpandEnv() over whole config, we might end up in a situation where the environment variable has escape characters that break the resulting JSON, and unmarshalling fails. Instead of expanding the entire config with single call, we recurse through the config and expand the values in leaves one by one.

What this PR does / why we need it

Closes #3689

…cters

If we expand environment values directly with os.ExpandEnv() over whole
config, we might end up in a situation where the environment variable
has escape characters that break the resulting JSON, and unmarshalling
fails. Instead of expanding the entire config with single call, we
recurse through the config and expand the values in leaves one by one.

Signed-off-by: Tuomo Tanskanen <[email protected]>
@tuminoid
Copy link
Contributor Author

tuminoid commented Oct 1, 2024

/cc @nabokihms
Here is the PR for fixing the escaping of special characters from #3689 using the approach we agreed on.

Suggested label is kind/bug.

It should be noted that this may cause issues for existing configs that have passwords with escapes due previous implementation requiring them. This must not be many installations, but maybe good to note regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using DEX_EXPAND_ENV, environment values with " or \ break the resulting JSON
1 participant