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

env_prefix falls back to env vars without prefix #441

Open
hofrob opened this issue Oct 9, 2024 · 0 comments
Open

env_prefix falls back to env vars without prefix #441

hofrob opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hofrob
Copy link

hofrob commented Oct 9, 2024

Using my example from #437: https://github.com/hofrob/pydantic-settings-env-prefix

If you uv run hello the result is:

hello='ABC'

This value is coming from the first line in .env: HELLO=ABC

I don't think the intention of env_prefix is to just fall back to whatever env var it can find that matches the variable without the prefix. If you have nested or complex settings with multiple API keys managed via different env_prefix values, you'll not want to use an API key with the wrong service. I'd consider this API key compromised.

See also this comment: #437 (comment)

@hramezani hramezani added bug Something isn't working and removed unconfirmed labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants