-
Notifications
You must be signed in to change notification settings - Fork 3.2k
AAD Auth: Adds an options to override AAD audience scope through environment variable. #42228
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
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 adds AAD audience scope override functionality to the Azure Cosmos DB SDK, allowing clients to override the default AAD scope using the AZURE_COSMOS_AAD_SCOPE_OVERRIDE environment variable. This enables access to applications with different scope requirements.
Key changes:
- Added environment variable constant for AAD scope override
- Modified both sync and async connection classes to check for scope override
- Added comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
_constants.py |
Added new constant for the AAD scope override environment variable |
_cosmos_client_connection.py |
Implemented scope override logic in sync connection class |
_cosmos_client_connection_async.py |
Implemented scope override logic in async connection class |
test_aad.py |
Added test case for scope override functionality in sync tests |
test_aad_async.py |
Added test case for scope override functionality in async tests |
sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py
Show resolved
Hide resolved
tvaron3
left a comment
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.
LGTM thanks
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
Add AAD audience scope override functionality when this environment variable is set AADScopeOverride = "AZURE_COSMOS_AAD_SCOPE_OVERRIDE". If no environment variable is et then it uses the existing default scope value.
This will help clients in accessing applications which have a different scope.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines