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

Safe yaml v3 #723

Merged
merged 6 commits into from
Sep 29, 2021
Merged

Safe yaml v3 #723

merged 6 commits into from
Sep 29, 2021

Conversation

mattbennett
Copy link
Member

@mattbennett mattbennett commented Sep 15, 2021

Equivalent to #722, for v3 branch

--

Updates the logic parsing environment variables in configuration files. Now uses the safe version of pyyaml's parser rather than the unsafe version.

Behaviour is unchanged except for the unsupported case of using nested environment variables without the optional regex package. Previously, depending on the structure of the string, a nested environment variable would sometimes be parsed correctly and sometimes incorrectly. Now, if your config file contains a nested environment variable and you do not have the optional regex package installed, a ConfigurationError will be raised.

switching to safe loading changes the behaviour of the default regex
parser when you give it a config that contains (unsupported) recursive
environment variables.

rather than update the tests to assert a different broken behaviour,
we now raise a configuration error. this will alert the user that their
config file will likely not be parsed correctly, or they're missing
the optional library.
also change description from "recursive" to "nested"
@mattbennett mattbennett marked this pull request as ready for review September 29, 2021 11:37
Copy link
Contributor

@timbu timbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mattbennett mattbennett merged commit 484721c into nameko:v3.0.0-rc Sep 29, 2021
@mattbennett mattbennett deleted the safe-yaml-v3 branch September 29, 2021 14:24
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.

None yet

2 participants