-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add Azure Key Vault settings source #272
Open
AndreuCodina
wants to merge
27
commits into
pydantic:main
Choose a base branch
from
AndreuCodina:feature/azure-key-vault-source-settings-source
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+301
−25
Open
Changes from 15 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8cab66d
Add Azure Key Vault settings source
AndreuCodina ab2c17f
Add Azure Key Vault settings source
AndreuCodina 192da43
Add Azure Key Vault settings source
AndreuCodina 8202ebe
Add optional dependencies
AndreuCodina 357df2b
Fix lint errors
AndreuCodina 30681de
Fix lint error
AndreuCodina 468a55b
Fix mypy errors
AndreuCodina 221731f
Imports inside a function
AndreuCodina 92b6c34
Fix lint errors
AndreuCodina 3e74b93
Merge branch 'main' into feature/azure-key-vault-source-settings-source
AndreuCodina 574debf
make refresh-lockfiles
AndreuCodina 9452ba3
make refresh-lockfiles
AndreuCodina df7e900
Add unit tests
AndreuCodina be0e201
Fix lint errors
AndreuCodina 9d08fa1
Merge branch 'main' into feature/azure-key-vault-source-settings-source
AndreuCodina 46de93c
make refresh-lockfiles with Python 3.8
AndreuCodina 5edb8f5
Resolve PR comments
AndreuCodina a4157e3
Merge branch 'pydantic:main' into feature/azure-key-vault-source-sett…
AndreuCodina 4b3df3f
Add tests
AndreuCodina 643264f
Fix lint errors
AndreuCodina 794487c
Fix lint errors
AndreuCodina 176233d
Merge branch 'pydantic:main' into feature/azure-key-vault-source-sett…
AndreuCodina 24a1fed
Add alias support
AndreuCodina 468bf15
Fix CI errors
AndreuCodina 97ade35
Fix CI errors
AndreuCodina a6cb2b8
make refresh-lockfiles
AndreuCodina 9dbb8f0
Typo
AndreuCodina File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,73 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.8 | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
AndreuCodina marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# by the following command: | ||
# | ||
# pip-compile --extra=toml --extra=yaml --no-emit-index-url --output-file=requirements/pyproject.txt pyproject.toml | ||
# pip-compile --extra=azure-key-vault --extra=toml --extra=yaml --no-emit-index-url --output-file=requirements/pyproject.txt pyproject.toml | ||
# | ||
annotated-types==0.6.0 | ||
# via pydantic | ||
pydantic==2.7.0 | ||
azure-core==1.30.1 | ||
# via | ||
# azure-identity | ||
# azure-keyvault-secrets | ||
azure-identity==1.16.0 | ||
# via pydantic-settings (pyproject.toml) | ||
azure-keyvault-secrets==4.8.0 | ||
# via pydantic-settings (pyproject.toml) | ||
certifi==2024.2.2 | ||
# via requests | ||
cffi==1.16.0 | ||
# via cryptography | ||
charset-normalizer==3.3.2 | ||
# via requests | ||
cryptography==42.0.5 | ||
# via | ||
# azure-identity | ||
# msal | ||
# pyjwt | ||
idna==3.7 | ||
# via requests | ||
isodate==0.6.1 | ||
# via azure-keyvault-secrets | ||
msal==1.28.0 | ||
# via | ||
# azure-identity | ||
# msal-extensions | ||
msal-extensions==1.1.0 | ||
# via azure-identity | ||
packaging==24.0 | ||
# via msal-extensions | ||
portalocker==2.8.2 | ||
# via msal-extensions | ||
pycparser==2.22 | ||
# via cffi | ||
pydantic==2.7.1 | ||
# via pydantic-settings (pyproject.toml) | ||
pydantic-core==2.18.1 | ||
pydantic-core==2.18.2 | ||
# via pydantic | ||
pyjwt[crypto]==2.8.0 | ||
# via | ||
# msal | ||
# pyjwt | ||
python-dotenv==1.0.1 | ||
# via pydantic-settings (pyproject.toml) | ||
pyyaml==6.0.1 | ||
# via pydantic-settings (pyproject.toml) | ||
requests==2.31.0 | ||
# via | ||
# azure-core | ||
# msal | ||
six==1.16.0 | ||
# via | ||
# azure-core | ||
# isodate | ||
tomli==2.0.1 | ||
# via pydantic-settings (pyproject.toml) | ||
typing-extensions==4.11.0 | ||
# via | ||
# annotated-types | ||
# azure-core | ||
# azure-keyvault-secrets | ||
# pydantic | ||
# pydantic-core | ||
urllib3==2.2.1 | ||
# via requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to use _extract_field_info to respect the field alias if defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is complex and I don't see the point in aliasing secret names. Can we iterate in the next version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the basic functionality that we already have in all of the source classes.
You need to move the
_extract_field_info
toPydanticBaseSettingsSource
class and then call it here. it returns a list of tuples that containfield_key
,env_name
andvalue_is_complex
. you can use theenv_name
to fetch the value from key vault . there are some use-cases of_extract_field_info
in the code, you can check them as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the alias support.