-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Identity] Merge from release #13566
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
…esource storage vm (#12499)
There is no need to sleep before parsing the response from the SCM server. Unless the status needs to continue to loop, this should return instantly.
…der (#13118) * finish * fix style * add extension
…ating or updating (#12074)
…le (#13062) * Adding private DNS zone import export feature * adding live tests * Incorporating review comments * style issue * Fixing local test * Encorporating review comment and adding test
…2018-03-01-hybrid (#13172)
* test LA cluster * Support LA cluster CMK feature * fix test * recording test for cluster CRUD * fix erros in other command modules due to version upgrade for log analytics * fix tests in other command modules due to version upgrade for log analytics * fix tests in other command modules due to version upgrade for log analytics from CI full test * fix test
…h feature (#12999) * {Core} support get msal accesstoken with adal refresh token for vm ssh feature * add License header for _msal.py * use hashlib instead of build-in hash function * refactor get_msal_token function * delete unused code * add query parameter * add test for get_msal_token
* [Compute] az vm availability-set list: Support showing VM list * test * test, 2019-03-01
…eview API version (#12240) * Upgrade openshift models to 2019-10-27-preview API version * Fix private-cluster parameter * Fix management_subnet_cidr property * Fix refresh cluster handling * fix lint * remove manually written history * remove short summary from _help.py as per code review suggestion * Update OSA API version Co-authored-by: Olga Mirensky <[email protected]> Co-authored-by: Feng Zhou <[email protected]>
* [Compute] az vm list-skus: Fix display problem of table format * test
… BYOS features (#13187) * finish code recording finish tests * address comments and rerun tests * refine logic * address comments * fix style
…t-If for ARM template deployment (#12942) * Create formatters for What-If operation result. * Add change type legend formatter. * Implement deployment what-if cmdlets. * Add senarios tests for deployment what-if cmdlets. * Add What-If confirmation switches. * Write help for what-if commands. * Fix an error due to rebasing. * Cleanup code. * Handle no_color mode. * Enable VT mode before rendering What-If results. * Add license headers. * Fix linter errors. * Fix help docs. * Add no_prompt paramter to what-if commands. * Try to fix pylint error in CI pipeline. * Fix pylint error round 2. * Fix the pylint error caused by the first fixing pylint error attempt... * Create an alias -r for --what-if-result-format. * Fix help doc. * Use plural verbs in help messages. * Create an alias -c for --confirm-with-what-if. * Remove aux_subscriptions from RG-level what-if command. * Restore handle_extended_json_format. * Add min_api constraints for What-If commands. * Also catch exception for vt mode enabling. * Fix a regression. * Refactor What-If argument types. * Use get_models to import models. * Fix a test failure for old API versions. * Using get_models in formatter tests. * Add tests for prompt with confirm_with_what_if. * Fix a test name. * Fix a linter error.
) * change title to alert how to pass array parameters * add a dedicated section * fix bug * Update doc/use_cli_effectively.md Co-authored-by: Jiashuo Li <[email protected]> * Update doc/use_cli_effectively.md Co-authored-by: Jiashuo Li <[email protected]> * add JSON example * add them in resource/_help.py * typo Co-authored-by: Jiashuo Li <[email protected]>
* update azure-cli version to 2.6.0 * Apply suggestions from code review Co-authored-by: Yunge Zhu <[email protected]> Co-authored-by: Feng Zhou <[email protected]> Co-authored-by: Xiaojian Xu <[email protected]> Co-authored-by: Bin Ma <[email protected]> Co-authored-by: Yunge Zhu <[email protected]> Co-authored-by: Feng Zhou <[email protected]> Co-authored-by: Xiaojian Xu <[email protected]>
| def retrieve_msal_token(self, tenant, scopes, data, refresh_token): | ||
| """ | ||
| This is added only for vmssh feature. | ||
| It is a temporary solution and will deprecate after MSAL adopted completely. | ||
| """ | ||
| from azure.cli.core._msal import AdalRefreshTokenBasedClientApplication | ||
| tenant = tenant or 'organizations' | ||
| authority = self._ctx.cloud.endpoints.active_directory + '/' + tenant | ||
| app = AdalRefreshTokenBasedClientApplication(_CLIENT_ID, authority=authority) | ||
| result = app.acquire_token_silent(scopes, None, data=data, refresh_token=refresh_token) | ||
|
|
||
| return result["access_token"] |
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.
Identity needs to support this method as CredsCache is removed.
| def get_msal_token(self, scopes, data): | ||
| """ | ||
| This is added only for vmssh feature. | ||
| It is a temporary solution and will deprecate after MSAL adopted completely. | ||
| """ | ||
| account = self.get_subscription() | ||
| username = account[_USER_ENTITY][_USER_NAME] | ||
| tenant = account[_TENANT_ID] or 'common' | ||
| _, refresh_token, _, _ = self.get_refresh_token() | ||
| certificate = self._creds_cache.retrieve_msal_token(tenant, scopes, data, refresh_token) | ||
| return username, certificate |
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.
get_msal_token should use Identity instead of CredsCache.
| except UnicodeDecodeError: | ||
| logger.warning("Please make sure there is no international (Unicode) character in the computer name " | ||
| r"or C:\Windows\System32\drivers\etc\hosts file's 127.0.0.1 entries. " | ||
| "For more details, please see https://github.com/Azure/azure-cli/issues/12957") | ||
| break |
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.
This should be caught in Identity.
|
Identity |
Description
Sync changes from
releasetoidentity.There are several conflicts from
src/azure-cli-core/azure/cli/core/_profile.pyintroduced by @arrownj in #12999.⚠ DO NOT SQUASH MERGE