-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[App Config] az appconfig: Add support for custom token audience to --auth-mode login parameter
#30739
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
[App Config] az appconfig: Add support for custom token audience to --auth-mode login parameter
#30739
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: disable=too-few-public-methods | ||
| from azure.cli.core.auth.util import resource_to_scopes | ||
|
|
||
|
|
||
| # This class is used to pass in custom token audience that will be respected by the SDK. | ||
| # Users can configure an audience based on their cloud. | ||
| class AppConfigurationCliCredential: | ||
|
|
||
| def __init__(self, credential, resource: str = None): | ||
| self._impl = credential | ||
| self._resource = resource | ||
|
|
||
| def get_token(self, *scopes, **kwargs): | ||
|
|
||
| if self._resource is not None: | ||
| scopes = resource_to_scopes(self._resource) | ||
|
|
||
| return self._impl.get_token(*scopes, **kwargs) |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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.
Accessing protected attribute
_credentialis wrong. The pylint errorprotected-accessshould not be disabled.This has been reverted by #30983.