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

feat!: change config source priorities #25

Merged
merged 3 commits into from
Nov 2, 2023

Conversation

kazauwa
Copy link
Contributor

@kazauwa kazauwa commented Oct 7, 2023

This change addresses issue #17 and changes the priorities of config sources as follows:

  1. Environment variable
  2. .vault_token file (for Vault token only)
  3. Value specified in a Config class

This makes pydantic-vault consistent with Pydantic and 12 Factor App.

@kazauwa
Copy link
Contributor Author

kazauwa commented Oct 7, 2023

Hey @nymous!

I took the liberty of changing the priority of a .vault_token file to make it higher than the value in a Config class. This is how it works in Pydantic and generally follows the idea we discussed in the related issue.
Though we only agreed on changing the priorities of environment variables, I believe we won't achieve complete consistency with Pydantic without this change. Let me know what you think about this. If you're not happy with it, it's in a separate commit and can be easily reverted.

@nymous
Copy link
Owner

nymous commented Oct 31, 2023

Hi!
Many thanks for your contribution! With the changelog entry and everything 👌

I also find the .vault-token change in line with the rest, perfect.
I just updated the README to document the new priority order, if you're ok with it then I will be happy to merge!

@kazauwa
Copy link
Contributor Author

kazauwa commented Nov 1, 2023

Looks good to me! Let's merge it!

@nymous nymous changed the title Change config source priorities feat!: change config source priorities Nov 2, 2023
@nymous nymous merged commit d7cb0d8 into nymous:master Nov 2, 2023
6 checks passed
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.

2 participants