-
Notifications
You must be signed in to change notification settings - Fork 3k
[Identity] Update AZURE_TOKEN_CREDENTIALS to allow specific creds #41709
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
Conversation
Now users of DefaultAzureCredential can specify a specific credential in the DAC chain when using the AZURE_TOKEN_CREDENTIALS environment variable. Signed-off-by: Paul Van Eck <[email protected]>
0eec386
to
ad8d6ce
Compare
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.
Pull Request Overview
This PR enables users to select a specific credential within DefaultAzureCredential
by setting the AZURE_TOKEN_CREDENTIALS
environment variable, refactors the credential-exclusion logic into a reusable helper, adds comprehensive tests for both async and sync chains, and updates versioning and metadata to reflect the new beta release.
- Introduced
process_credential_exclusions
in internal utils and wired it into async & syncDefaultAzureCredential
constructors. - Expanded test coverage for async and sync chains to validate specific credential selection, case-insensitivity, invalid values, and user overrides.
- Updated package metadata (setup.py classifier, version, changelog) for the 1.24.0b1 beta release.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
sdk/identity/azure-identity/tests/test_token_credentials_env_async.py | Added async tests covering specific credential selection via env var. |
sdk/identity/azure-identity/tests/test_token_credentials_env.py | Added sync tests covering specific credential selection via env var. |
sdk/identity/azure-identity/setup.py | Changed development status classifier to Beta. |
sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py | Refactored async DefaultAzureCredential to use process_credential_exclusions . |
sdk/identity/azure-identity/azure/identity/_credentials/default.py | Refactored sync DefaultAzureCredential to use process_credential_exclusions . |
sdk/identity/azure-identity/azure/identity/_internal/utils.py | Introduced process_credential_exclusions helper for managing exclusions. |
sdk/identity/azure-identity/azure/identity/_internal/init.py | Exported process_credential_exclusions in internal package init. |
sdk/identity/azure-identity/azure/identity/_version.py | Bumped version to 1.24.0b1 . |
sdk/identity/azure-identity/CHANGELOG.md | Documented new AZURE_TOKEN_CREDENTIALS feature and version update. |
Comments suppressed due to low confidence (2)
sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py:128
- The class docstring for
DefaultAzureCredential
should include a description of the newAZURE_TOKEN_CREDENTIALS
environment variable and how it controls which credential is used, ensuring users know how to configure this feature.
# Define credential configuration mapping (async version)
sdk/identity/azure-identity/azure/identity/_credentials/default.py:136
- Add documentation in the class docstring to explain the supported values of
AZURE_TOKEN_CREDENTIALS
and how the exclusion flags interact, so the syncDefaultAzureCredential
API matches its behavior.
# Define credential configuration mapping
sdk/identity/azure-identity/azure/identity/_credentials/default.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Paul Van Eck <[email protected]>
Signed-off-by: Paul Van Eck <[email protected]>
sdk/identity/azure-identity/tests/test_token_credentials_env.py
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/tests/test_token_credentials_env.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Paul Van Eck <[email protected]>
Now, users of DefaultAzureCredential can specify a specific credential in the DAC chain when using the
AZURE_TOKEN_CREDENTIALS
environment variable.InteractiveBrowserCredential
), if that credential is set in the env var, then its inclusion will be prioritized. For example,AZURE_TOKEN_CREDENTIALS=InteractiveBrowserCredential
will makeDefaultAzureCredential()
useInteractiveBrowserCredential
.Closes: #39784