Refactor ImdsCredential to use ManagedIdentityClient#18120
Merged
chlowell merged 5 commits intoAzure:masterfrom Apr 23, 2021
Merged
Refactor ImdsCredential to use ManagedIdentityClient#18120chlowell merged 5 commits intoAzure:masterfrom
chlowell merged 5 commits intoAzure:masterfrom
Conversation
mccoyp
reviewed
Apr 20, 2021
Comment on lines
-196
to
-202
| 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) |
Member
There was a problem hiding this comment.
Is this scopes restriction still being applied after the refactor?
Member
Author
There was a problem hiding this comment.
Yes, ManagedIdentityClient.request_token calls _scopes_to_resource, which is a copy of this.
mccoyp
approved these changes
Apr 21, 2021
iscai-msft
added a commit
to iscai-msft/azure-sdk-for-python
that referenced
this pull request
Apr 23, 2021
…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)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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