-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Refactor ImdsCredential to use ManagedIdentityClient #18120
Conversation
if len(scopes) != 1: | ||
raise ValueError("This credential requires exactly one scope per token request.") | ||
|
||
resource = scopes[0] | ||
if resource.endswith("/.default"): | ||
resource = resource[: -len("/.default")] | ||
params = dict({"api-version": "2018-02-01", "resource": resource}, **self._identity_config) |
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.
Is this scopes restriction still being applied after the refactor?
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.
Yes, ManagedIdentityClient.request_token
calls _scopes_to_resource
, which is a copy of this.
…into azure_purview_catalog * 'master' of https://github.com/Azure/azure-sdk-for-python: [Tables] hot fix for pipelines (Azure#18273) [Tables] Updates for apiview & sphinx docs (Azure#18134) override purview deps in shared reqs (Azure#18270) [Service Bus] fix deadletter sample + update README (Azure#18261) Update credential docstrings (Azure#18205) Refactor ImdsCredential to use ManagedIdentityClient (Azure#18120) [Key Vault] Target multiple API versions with tests (keys) (Azure#18149) Initial ModelsRepositoryClient (Azure#17180) [Communication]: Enabled Phone Number Search Test (Azure#18247) [Key Vault] Update default MHSM location for tests Update identity migration guide (Azure#18239) [AutoRelease] t2-managedservices-2021-04-22-08436(wave4) (Azure#18224) [AutoRelease] t2-hybridnetwork-2021-04-20-93742 (Azure#18169) Add Key Vault cert suppression (Azure#18245) update to aab1fb9 (Azure#18246) Enable retain runs. (Azure#18200) [formrecognizer] add testcases for labeled tables - fixed/variable rows (Azure#18214) Add caching support to verify-links (Azure#18231) add reading order for logging (Azure#18233) [purview] allow purview pylint failures (Azure#18237)
Looks like a lot of new code because I moved ImdsCredential to a new module but it's actually a modest refactor (that enables throwing out some old code and, I hope, making this all a little easier to understand 🥳)
Closes #13674