azure-cli-core 2.76.0__tar.gz → 2.77.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/HISTORY.rst +6 -0
- {azure_cli_core-2.76.0/azure_cli_core.egg-info → azure_cli_core-2.77.0}/PKG-INFO +5 -3
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/__init__.py +3 -2
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_profile.py +8 -5
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_client.py +3 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_command.py +12 -7
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/identity.py +3 -3
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/arm.py +46 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/client_factory.py +6 -3
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/profiles/_shared.py +2 -13
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/sdk/policies.py +53 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/util.py +0 -6
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0/azure_cli_core.egg-info}/PKG-INFO +5 -3
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure_cli_core.egg-info/requires.txt +3 -2
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/setup.py +5 -3
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/LICENSE.txt +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/MANIFEST.in +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/README.rst +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/__init__.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/__init__.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_breaking_change.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_completers.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_config.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_debug.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_environment.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_help.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_help_loaders.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_output.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/_session.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/__init__.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_arg.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_arg_action.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_arg_browser.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_arg_fmt.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_base.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_command_ctx.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_content_builder.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_error_format.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_field_type.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_field_value.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_help.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_http_policy.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_operation.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_paging.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_poller.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_prompt.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_selector.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/_utils.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/exceptions.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/aaz/utils.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/api.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/__init__.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/binary_cache.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/constants.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/credential_adaptor.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/landing_pages/error.html +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/landing_pages/success.html +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/msal_credentials.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/persistence.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/util.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/azclierror.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/azlogging.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/breaking_change.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/cloud.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/command_recommender.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/__init__.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/command_operation.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/constants.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/events.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/parameters.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/progress.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/sensitive.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/template_create.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/transform.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/validators.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/credential_helper.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/decorators.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/extension/__init__.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/extension/_homebrew_patch.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/extension/_index.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/extension/_resolve.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/extension/dynamic_install.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/extension/operations.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/file_util.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/intercept_survey.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/keys.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/local_context.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/mock.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/parser.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/profiles/__init__.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/sdk/__init__.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/style.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/telemetry.py +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure_cli_core.egg-info/SOURCES.txt +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure_cli_core.egg-info/dependency_links.txt +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure_cli_core.egg-info/not-zip-safe +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure_cli_core.egg-info/top_level.txt +0 -0
- {azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/setup.cfg +0 -0
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
Release History
|
|
4
4
|
===============
|
|
5
5
|
|
|
6
|
+
2.77.0
|
|
7
|
+
++++++
|
|
8
|
+
* Resolve CVE-2025-4517 (#31928)
|
|
9
|
+
* Add global policy arguments `--acquire-policy-token` and `--change-reference` to support Change Safety feature (#31741)
|
|
10
|
+
|
|
6
11
|
2.76.0
|
|
7
12
|
++++++
|
|
8
13
|
* Resolve CVE-2024-47081 (#31708)
|
|
14
|
+
* Provide actionable error recommendation when a command fails because of Multi-Factor Authentication (MFA) policy violation (#31699)
|
|
9
15
|
|
|
10
16
|
2.75.0
|
|
11
17
|
++++++
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: azure-cli-core
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.77.0
|
|
4
4
|
Summary: Microsoft Azure Command-Line Tools Core Module
|
|
5
5
|
Home-page: https://github.com/Azure/azure-cli
|
|
6
6
|
Author: Microsoft Corporation
|
|
@@ -15,11 +15,13 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: License :: OSI Approved :: MIT License
|
|
19
20
|
Requires-Python: >=3.9.0
|
|
20
21
|
License-File: LICENSE.txt
|
|
21
22
|
Requires-Dist: argcomplete~=3.5.2
|
|
22
23
|
Requires-Dist: azure-cli-telemetry==1.1.0.*
|
|
24
|
+
Requires-Dist: azure-core~=1.35.0
|
|
23
25
|
Requires-Dist: azure-mgmt-core<2,>=1.2.0
|
|
24
26
|
Requires-Dist: cryptography
|
|
25
27
|
Requires-Dist: distro; sys_platform == "linux"
|
|
@@ -28,8 +30,8 @@ Requires-Dist: jmespath
|
|
|
28
30
|
Requires-Dist: knack~=0.11.0
|
|
29
31
|
Requires-Dist: microsoft-security-utilities-secret-masker~=1.0.0b4
|
|
30
32
|
Requires-Dist: msal-extensions==1.2.0
|
|
31
|
-
Requires-Dist: msal[broker]==1.
|
|
32
|
-
Requires-Dist: msal==1.
|
|
33
|
+
Requires-Dist: msal[broker]==1.34.0b1; sys_platform == "win32"
|
|
34
|
+
Requires-Dist: msal==1.34.0b1; sys_platform != "win32"
|
|
33
35
|
Requires-Dist: packaging>=20.9
|
|
34
36
|
Requires-Dist: pkginfo>=1.5.0.1
|
|
35
37
|
Requires-Dist: psutil>=5.9; sys_platform != "cygwin"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# --------------------------------------------------------------------------------------------
|
|
5
5
|
# pylint: disable=line-too-long
|
|
6
6
|
|
|
7
|
-
__version__ = "2.
|
|
7
|
+
__version__ = "2.77.0"
|
|
8
8
|
|
|
9
9
|
import os
|
|
10
10
|
import sys
|
|
@@ -61,7 +61,7 @@ class AzCli(CLI):
|
|
|
61
61
|
from azure.cli.core.breaking_change import register_upcoming_breaking_change_info
|
|
62
62
|
from azure.cli.core.commands import register_cache_arguments
|
|
63
63
|
from azure.cli.core.commands.arm import (
|
|
64
|
-
register_ids_argument, register_global_subscription_argument)
|
|
64
|
+
register_ids_argument, register_global_subscription_argument, register_global_policy_argument)
|
|
65
65
|
from azure.cli.core.cloud import get_active_cloud
|
|
66
66
|
from azure.cli.core.commands.transform import register_global_transforms
|
|
67
67
|
from azure.cli.core._session import ACCOUNT, CONFIG, SESSION, INDEX, VERSIONS
|
|
@@ -90,6 +90,7 @@ class AzCli(CLI):
|
|
|
90
90
|
register_global_transforms(self)
|
|
91
91
|
register_global_subscription_argument(self)
|
|
92
92
|
register_ids_argument(self) # global subscription must be registered first!
|
|
93
|
+
register_global_policy_argument(self)
|
|
93
94
|
register_cache_arguments(self)
|
|
94
95
|
register_upcoming_breaking_change_info(self)
|
|
95
96
|
|
|
@@ -172,7 +172,7 @@ class Profile:
|
|
|
172
172
|
use_device_code = True
|
|
173
173
|
|
|
174
174
|
if use_device_code:
|
|
175
|
-
user_identity = identity.login_with_device_code(scopes=scopes)
|
|
175
|
+
user_identity = identity.login_with_device_code(scopes=scopes, claims_challenge=claims_challenge)
|
|
176
176
|
else:
|
|
177
177
|
user_identity = identity.login_with_auth_code(scopes=scopes, claims_challenge=claims_challenge)
|
|
178
178
|
else:
|
|
@@ -360,17 +360,20 @@ class Profile:
|
|
|
360
360
|
|
|
361
361
|
managed_identity_type, managed_identity_id = Profile._parse_managed_identity_account(account)
|
|
362
362
|
|
|
363
|
+
non_current_tenant_template = ("For {} account, getting access token for non-current tenants is not "
|
|
364
|
+
"supported. The specified tenant must be the current tenant "
|
|
365
|
+
f"{account[_TENANT_ID]}")
|
|
363
366
|
if in_cloud_console() and account[_USER_ENTITY].get(_CLOUD_SHELL_ID):
|
|
364
367
|
# Cloud Shell
|
|
365
|
-
if tenant:
|
|
366
|
-
raise CLIError(
|
|
368
|
+
if tenant and tenant != account[_TENANT_ID]:
|
|
369
|
+
raise CLIError(non_current_tenant_template.format('Cloud Shell'))
|
|
367
370
|
from .auth.msal_credentials import CloudShellCredential
|
|
368
371
|
cred = CloudShellCredential()
|
|
369
372
|
|
|
370
373
|
elif managed_identity_type:
|
|
371
374
|
# managed identity
|
|
372
|
-
if tenant:
|
|
373
|
-
raise CLIError(
|
|
375
|
+
if tenant and tenant != account[_TENANT_ID]:
|
|
376
|
+
raise CLIError(non_current_tenant_template.format('managed identity'))
|
|
374
377
|
cred = ManagedIdentityAuth.credential_factory(managed_identity_type, managed_identity_id)
|
|
375
378
|
if credential_out:
|
|
376
379
|
credential_out['credential'] = cred
|
|
@@ -73,6 +73,9 @@ class AAZBaseClient(PipelineClient):
|
|
|
73
73
|
base_url = self._build_base_url(ctx, **kwargs)
|
|
74
74
|
if not base_url:
|
|
75
75
|
raise CloudEndpointNotSetException()
|
|
76
|
+
if not kwargs.get('custom_hook_policy'):
|
|
77
|
+
from azure.cli.core.sdk.policies import get_custom_hook_policy
|
|
78
|
+
kwargs['custom_hook_policy'] = get_custom_hook_policy(ctx.cli_ctx)
|
|
76
79
|
super().__init__(
|
|
77
80
|
base_url=base_url,
|
|
78
81
|
config=self._build_configuration(ctx, credential, **kwargs),
|
|
@@ -327,12 +327,15 @@ def register_command_group(
|
|
|
327
327
|
helps[name] = yaml.safe_dump(cls.AZ_HELP)
|
|
328
328
|
|
|
329
329
|
if is_preview:
|
|
330
|
-
cls.AZ_PREVIEW_INFO = partial(PreviewItem,
|
|
330
|
+
cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem,
|
|
331
|
+
target=f'az {name}', object_type='command group'))
|
|
331
332
|
if is_experimental:
|
|
332
|
-
cls.AZ_EXPERIMENTAL_INFO = partial(ExperimentalItem,
|
|
333
|
+
cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem,
|
|
334
|
+
target=f'az {name}', object_type='command group'))
|
|
333
335
|
if deprecated_info:
|
|
334
|
-
cls.AZ_DEPRECATE_INFO = partial(Deprecated,
|
|
335
|
-
|
|
336
|
+
cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated,
|
|
337
|
+
target=f'az {name}', object_type='command group',
|
|
338
|
+
**deprecated_info))
|
|
336
339
|
return cls
|
|
337
340
|
|
|
338
341
|
return decorator
|
|
@@ -369,11 +372,13 @@ def register_command(
|
|
|
369
372
|
if confirmation:
|
|
370
373
|
cls.AZ_CONFIRMATION = confirmation
|
|
371
374
|
if is_preview:
|
|
372
|
-
cls.AZ_PREVIEW_INFO = partial(PreviewItem, target=f'az {name}', object_type='command')
|
|
375
|
+
cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem, target=f'az {name}', object_type='command'))
|
|
373
376
|
if is_experimental:
|
|
374
|
-
cls.AZ_EXPERIMENTAL_INFO = partial(ExperimentalItem,
|
|
377
|
+
cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem,
|
|
378
|
+
target=f'az {name}', object_type='command'))
|
|
375
379
|
if deprecated_info:
|
|
376
|
-
cls.AZ_DEPRECATE_INFO = partial(Deprecated, target=f'az {name}',
|
|
380
|
+
cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}',
|
|
381
|
+
object_type='command', **deprecated_info))
|
|
377
382
|
return cls
|
|
378
383
|
|
|
379
384
|
return decorator
|
|
@@ -171,14 +171,14 @@ class Identity: # pylint: disable=too-many-instance-attributes
|
|
|
171
171
|
claims_challenge=claims_challenge)
|
|
172
172
|
return check_result(result)
|
|
173
173
|
|
|
174
|
-
def login_with_device_code(self, scopes):
|
|
175
|
-
flow = self._msal_app.initiate_device_flow(scopes)
|
|
174
|
+
def login_with_device_code(self, scopes, claims_challenge=None):
|
|
175
|
+
flow = self._msal_app.initiate_device_flow(scopes, claims_challenge=claims_challenge)
|
|
176
176
|
if "user_code" not in flow:
|
|
177
177
|
raise ValueError(
|
|
178
178
|
"Fail to create device flow. Err: %s" % json.dumps(flow, indent=4))
|
|
179
179
|
from azure.cli.core.style import print_styled_text, Style
|
|
180
180
|
print_styled_text((Style.WARNING, flow["message"]), file=sys.stderr)
|
|
181
|
-
result = self._msal_app.acquire_token_by_device_flow(flow)
|
|
181
|
+
result = self._msal_app.acquire_token_by_device_flow(flow, claims_challenge=claims_challenge)
|
|
182
182
|
return check_result(result)
|
|
183
183
|
|
|
184
184
|
def login_with_username_password(self, username, password, scopes):
|
|
@@ -187,6 +187,52 @@ def resource_exists(cli_ctx, subscription, resource_group, name, namespace, type
|
|
|
187
187
|
return existing
|
|
188
188
|
|
|
189
189
|
|
|
190
|
+
def register_global_policy_argument(cli_ctx):
|
|
191
|
+
|
|
192
|
+
def add_global_policy_argument(_, **kwargs):
|
|
193
|
+
command_table = kwargs.get('commands_loader').command_table
|
|
194
|
+
|
|
195
|
+
if not command_table:
|
|
196
|
+
return
|
|
197
|
+
|
|
198
|
+
class ChangeReferenceAction(argparse.Action): # pylint:disable=too-few-public-methods
|
|
199
|
+
|
|
200
|
+
def __call__(self, parser, namespace, value, option_string=None):
|
|
201
|
+
# save change reference to CLI context
|
|
202
|
+
cmd = getattr(namespace, 'cmd', None) or getattr(namespace, '_cmd', None)
|
|
203
|
+
cmd.cli_ctx.data['_change_reference'] = value
|
|
204
|
+
|
|
205
|
+
class AcquirePolicyTokenAction(argparse.Action): # pylint:disable=too-few-public-methods
|
|
206
|
+
|
|
207
|
+
def __call__(self, parser, namespace, value, option_string=None):
|
|
208
|
+
# save change reference to CLI context
|
|
209
|
+
cmd = getattr(namespace, 'cmd', None) or getattr(namespace, '_cmd', None)
|
|
210
|
+
cmd.cli_ctx.data['_acquire_policy_token'] = True
|
|
211
|
+
|
|
212
|
+
for command in command_table.values():
|
|
213
|
+
if command.name.split()[-1] in ['list', 'show']:
|
|
214
|
+
continue
|
|
215
|
+
|
|
216
|
+
change_reference_kwargs = {
|
|
217
|
+
'help': 'The related change reference ID for this resource operation',
|
|
218
|
+
'arg_group': 'Global Policy',
|
|
219
|
+
'action': ChangeReferenceAction,
|
|
220
|
+
}
|
|
221
|
+
acquire_policy_token_kwargs = {
|
|
222
|
+
'help': 'Acquiring an Azure Policy token automatically for this resource operation',
|
|
223
|
+
'arg_group': 'Global Policy',
|
|
224
|
+
'nargs': 0,
|
|
225
|
+
'action': AcquirePolicyTokenAction,
|
|
226
|
+
}
|
|
227
|
+
command.add_argument('_change_reference', '--change-reference', **change_reference_kwargs)
|
|
228
|
+
command.add_argument('_acquire_policy_token', '--acquire-policy-token', **acquire_policy_token_kwargs)
|
|
229
|
+
|
|
230
|
+
policy_token_feature_enabled = cli_ctx.config.getboolean('core', 'enable_policy_token', False)
|
|
231
|
+
if policy_token_feature_enabled:
|
|
232
|
+
from knack import events
|
|
233
|
+
cli_ctx.register_event(events.EVENT_INVOKER_POST_CMD_TBL_CREATE, add_global_policy_argument)
|
|
234
|
+
|
|
235
|
+
|
|
190
236
|
# pylint: disable=too-many-statements
|
|
191
237
|
def register_ids_argument(cli_ctx):
|
|
192
238
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
from azure.cli.core import _debug
|
|
7
7
|
from azure.cli.core.auth.util import resource_to_scopes
|
|
8
8
|
from azure.cli.core.extension import EXTENSIONS_MOD_PREFIX
|
|
9
|
-
from azure.cli.core.profiles import ResourceType, CustomResourceType, get_api_version
|
|
9
|
+
from azure.cli.core.profiles import ResourceType, CustomResourceType, get_api_version
|
|
10
10
|
from azure.cli.core.profiles._shared import get_client_class, SDKProfile
|
|
11
11
|
from azure.cli.core.util import get_az_user_agent, is_track2
|
|
12
12
|
from knack.log import get_logger
|
|
@@ -166,6 +166,9 @@ def _prepare_client_kwargs_track2(cli_ctx):
|
|
|
166
166
|
from azure.cli.core.sdk.policies import RecordTelemetryUserAgentPolicy
|
|
167
167
|
client_kwargs['user_agent_policy'] = RecordTelemetryUserAgentPolicy(**client_kwargs)
|
|
168
168
|
|
|
169
|
+
from azure.cli.core.sdk.policies import get_custom_hook_policy
|
|
170
|
+
client_kwargs['custom_hook_policy'] = get_custom_hook_policy(cli_ctx)
|
|
171
|
+
|
|
169
172
|
# Replace NetworkTraceLoggingPolicy to redact 'Authorization' and 'x-ms-authorization-auxiliary' headers.
|
|
170
173
|
# NetworkTraceLoggingPolicy: log raw network trace, with all headers.
|
|
171
174
|
from azure.cli.core.sdk.policies import SafeNetworkTraceLoggingPolicy
|
|
@@ -275,8 +278,8 @@ def get_data_service_client(cli_ctx, service_type, account_name, account_key, co
|
|
|
275
278
|
if location_mode:
|
|
276
279
|
client.location_mode = location_mode
|
|
277
280
|
except ValueError as exc:
|
|
278
|
-
_ERROR_STORAGE_MISSING_INFO =
|
|
279
|
-
|
|
281
|
+
_ERROR_STORAGE_MISSING_INFO = ('You need to provide an account name and either an account_key or sas_token '
|
|
282
|
+
'when creating a storage service.')
|
|
280
283
|
if _ERROR_STORAGE_MISSING_INFO in str(exc):
|
|
281
284
|
raise ValueError(exc)
|
|
282
285
|
raise CLIError('Unable to obtain data client. Check your connection parameters.')
|
|
@@ -89,7 +89,6 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods
|
|
|
89
89
|
# can be provided with "ResourceType.XXX" to initialize the client object. This usually happens
|
|
90
90
|
# when related commands start to support Multi-API
|
|
91
91
|
|
|
92
|
-
DATA_COSMOS_TABLE = ('azure.multiapi.cosmosdb', None)
|
|
93
92
|
MGMT_ADVISOR = ('azure.mgmt.advisor', None)
|
|
94
93
|
MGMT_MEDIA = ('azure.mgmt.media', None)
|
|
95
94
|
MGMT_BACKUP = ('azure.mgmt.recoveryservicesbackup', None)
|
|
@@ -116,7 +115,6 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods
|
|
|
116
115
|
MGMT_SQLVM = ('azure.mgmt.sqlvirtualmachine', None)
|
|
117
116
|
MGMT_MANAGEDSERVICES = ('azure.mgmt.managedservices', None)
|
|
118
117
|
MGMT_NETAPPFILES = ('azure.mgmt.netappfiles', None)
|
|
119
|
-
DATA_STORAGE = ('azure.multiapi.storage', None)
|
|
120
118
|
DATA_STORAGE_BLOB = ('azure.multiapi.storagev2.blob', None)
|
|
121
119
|
DATA_STORAGE_FILEDATALAKE = ('azure.multiapi.storagev2.filedatalake', None)
|
|
122
120
|
DATA_STORAGE_FILESHARE = ('azure.multiapi.storagev2.fileshare', None)
|
|
@@ -187,10 +185,7 @@ AZURE_API_PROFILES = {
|
|
|
187
185
|
ResourceType.MGMT_RESOURCE_MANAGEDAPPLICATIONS: '2019-07-01',
|
|
188
186
|
ResourceType.MGMT_NETWORK_PRIVATEDNS: None,
|
|
189
187
|
ResourceType.MGMT_KEYVAULT: None,
|
|
190
|
-
ResourceType.MGMT_AUTHORIZATION:
|
|
191
|
-
'role_definitions': '2022-05-01-preview',
|
|
192
|
-
'provider_operations_metadata': '2018-01-01-preview'
|
|
193
|
-
}),
|
|
188
|
+
ResourceType.MGMT_AUTHORIZATION: None,
|
|
194
189
|
ResourceType.MGMT_CONTAINERREGISTRY: SDKProfile('2025-03-01-preview', {
|
|
195
190
|
'agent_pools': '2025-03-01-preview',
|
|
196
191
|
'tasks': '2025-03-01-preview',
|
|
@@ -209,12 +204,10 @@ AZURE_API_PROFILES = {
|
|
|
209
204
|
ResourceType.DATA_KEYVAULT_ADMINISTRATION_SETTING: None,
|
|
210
205
|
ResourceType.DATA_KEYVAULT_ADMINISTRATION_BACKUP: '7.5-preview.1',
|
|
211
206
|
ResourceType.DATA_KEYVAULT_ADMINISTRATION_ACCESS_CONTROL: '7.4',
|
|
212
|
-
ResourceType.DATA_STORAGE: '2018-11-09',
|
|
213
207
|
ResourceType.DATA_STORAGE_BLOB: '2022-11-02',
|
|
214
208
|
ResourceType.DATA_STORAGE_FILEDATALAKE: '2021-08-06',
|
|
215
209
|
ResourceType.DATA_STORAGE_FILESHARE: '2025-05-05',
|
|
216
210
|
ResourceType.DATA_STORAGE_QUEUE: '2018-03-28',
|
|
217
|
-
ResourceType.DATA_COSMOS_TABLE: '2017-04-17',
|
|
218
211
|
ResourceType.DATA_STORAGE_TABLE: None,
|
|
219
212
|
ResourceType.MGMT_SERVICEBUS: None,
|
|
220
213
|
ResourceType.MGMT_EVENTHUB: None,
|
|
@@ -227,7 +220,7 @@ AZURE_API_PROFILES = {
|
|
|
227
220
|
ResourceType.MGMT_ARO: '2023-11-22',
|
|
228
221
|
ResourceType.MGMT_DATABOXEDGE: '2021-02-01-preview',
|
|
229
222
|
ResourceType.MGMT_CUSTOMLOCATION: '2021-03-15-preview',
|
|
230
|
-
ResourceType.MGMT_CONTAINERSERVICE:
|
|
223
|
+
ResourceType.MGMT_CONTAINERSERVICE: None,
|
|
231
224
|
ResourceType.MGMT_APPCONTAINERS: '2022-10-01',
|
|
232
225
|
}
|
|
233
226
|
}
|
|
@@ -236,10 +229,6 @@ AZURE_API_PROFILES = {
|
|
|
236
229
|
# We should avoid using ad hoc API versions,
|
|
237
230
|
# use the version in a profile as much as possible.
|
|
238
231
|
AD_HOC_API_VERSIONS = {
|
|
239
|
-
ResourceType.MGMT_IOTHUB: {
|
|
240
|
-
# src/azure-cli/azure/cli/command_modules/iot/custom.py#iot_hub_devicestream_show
|
|
241
|
-
'iot_hub_resource': '2019-07-01-preview',
|
|
242
|
-
},
|
|
243
232
|
ResourceType.MGMT_APPSERVICE: {
|
|
244
233
|
# src/azure-cli/azure/cli/command_modules/appservice/_constants.py:68
|
|
245
234
|
'app_service_certificate_orders': '2022-09-01'
|
|
@@ -103,3 +103,56 @@ class RecordTelemetryUserAgentPolicy(UserAgentPolicy):
|
|
|
103
103
|
super().on_request(request)
|
|
104
104
|
from azure.cli.core.telemetry import set_user_agent
|
|
105
105
|
set_user_agent(request.http_request.headers[self._USERAGENT])
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# pylint: disable=line-too-long
|
|
109
|
+
def get_custom_hook_policy(cli_ctx):
|
|
110
|
+
def _acquire_policy_token_request_hook(request):
|
|
111
|
+
http_request = request.http_request
|
|
112
|
+
if getattr(http_request, 'method', '') == 'GET':
|
|
113
|
+
return
|
|
114
|
+
ACQUIRE_POLICY_TOKEN_URL = '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/acquirePolicyToken?api-version=2025-03-01'
|
|
115
|
+
policy_token = None
|
|
116
|
+
|
|
117
|
+
from azure.cli.core.azclierror import ServiceError
|
|
118
|
+
try:
|
|
119
|
+
import json
|
|
120
|
+
from azure.cli.core.util import send_raw_request
|
|
121
|
+
uri = getattr(http_request, 'url')
|
|
122
|
+
method = getattr(http_request, 'method')
|
|
123
|
+
content = getattr(http_request, 'content') if hasattr(http_request, 'content') else getattr(http_request, 'body')
|
|
124
|
+
if content and isinstance(content, str):
|
|
125
|
+
try:
|
|
126
|
+
content = json.loads(content)
|
|
127
|
+
except json.decoder.JSONDecodeError:
|
|
128
|
+
pass
|
|
129
|
+
|
|
130
|
+
acquire_policy_token_body = {
|
|
131
|
+
"operation": {
|
|
132
|
+
"uri": uri,
|
|
133
|
+
"httpMethod": method,
|
|
134
|
+
"content": content
|
|
135
|
+
},
|
|
136
|
+
"changeReference": cli_ctx.data.get('_change_reference', None)
|
|
137
|
+
}
|
|
138
|
+
acquire_policy_token_response = send_raw_request(cli_ctx, 'POST',
|
|
139
|
+
ACQUIRE_POLICY_TOKEN_URL,
|
|
140
|
+
headers=['Content-Type=application/json',
|
|
141
|
+
'x-ms-force-sync=true'],
|
|
142
|
+
body=json.dumps(acquire_policy_token_body))
|
|
143
|
+
if acquire_policy_token_response.status_code == 200 and acquire_policy_token_response.content:
|
|
144
|
+
response_content = json.loads(acquire_policy_token_response.content)
|
|
145
|
+
policy_token = response_content.get('token', None)
|
|
146
|
+
if not policy_token:
|
|
147
|
+
raise ServiceError(f"No token returned. Response:{acquire_policy_token_response.content}")
|
|
148
|
+
except Exception as ex:
|
|
149
|
+
raise ServiceError(f"Failed to acquire policy token, exception: {ex}")
|
|
150
|
+
if policy_token:
|
|
151
|
+
request.http_request.headers['x-ms-policy-external-evaluations'] = policy_token
|
|
152
|
+
|
|
153
|
+
acquire_policy_token = cli_ctx.data.get('_acquire_policy_token', False)
|
|
154
|
+
change_reference = cli_ctx.data.get('_change_reference', None)
|
|
155
|
+
if change_reference or acquire_policy_token:
|
|
156
|
+
from azure.core.pipeline.policies import CustomHookPolicy
|
|
157
|
+
return CustomHookPolicy(raw_request_hook=_acquire_policy_token_request_hook)
|
|
158
|
+
return None
|
|
@@ -1164,12 +1164,6 @@ ConfiguredDefaultSetter = ScopedConfig
|
|
|
1164
1164
|
|
|
1165
1165
|
|
|
1166
1166
|
def _ssl_context():
|
|
1167
|
-
if sys.version_info < (3, 4) or (in_cloud_console() and platform.system() == 'Windows'):
|
|
1168
|
-
try:
|
|
1169
|
-
return ssl.SSLContext(ssl.PROTOCOL_TLS) # added in python 2.7.13 and 3.6
|
|
1170
|
-
except AttributeError:
|
|
1171
|
-
return ssl.SSLContext(ssl.PROTOCOL_TLSv1)
|
|
1172
|
-
|
|
1173
1167
|
return ssl.create_default_context()
|
|
1174
1168
|
|
|
1175
1169
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: azure-cli-core
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.77.0
|
|
4
4
|
Summary: Microsoft Azure Command-Line Tools Core Module
|
|
5
5
|
Home-page: https://github.com/Azure/azure-cli
|
|
6
6
|
Author: Microsoft Corporation
|
|
@@ -15,11 +15,13 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: License :: OSI Approved :: MIT License
|
|
19
20
|
Requires-Python: >=3.9.0
|
|
20
21
|
License-File: LICENSE.txt
|
|
21
22
|
Requires-Dist: argcomplete~=3.5.2
|
|
22
23
|
Requires-Dist: azure-cli-telemetry==1.1.0.*
|
|
24
|
+
Requires-Dist: azure-core~=1.35.0
|
|
23
25
|
Requires-Dist: azure-mgmt-core<2,>=1.2.0
|
|
24
26
|
Requires-Dist: cryptography
|
|
25
27
|
Requires-Dist: distro; sys_platform == "linux"
|
|
@@ -28,8 +30,8 @@ Requires-Dist: jmespath
|
|
|
28
30
|
Requires-Dist: knack~=0.11.0
|
|
29
31
|
Requires-Dist: microsoft-security-utilities-secret-masker~=1.0.0b4
|
|
30
32
|
Requires-Dist: msal-extensions==1.2.0
|
|
31
|
-
Requires-Dist: msal[broker]==1.
|
|
32
|
-
Requires-Dist: msal==1.
|
|
33
|
+
Requires-Dist: msal[broker]==1.34.0b1; sys_platform == "win32"
|
|
34
|
+
Requires-Dist: msal==1.34.0b1; sys_platform != "win32"
|
|
33
35
|
Requires-Dist: packaging>=20.9
|
|
34
36
|
Requires-Dist: pkginfo>=1.5.0.1
|
|
35
37
|
Requires-Dist: psutil>=5.9; sys_platform != "cygwin"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
argcomplete~=3.5.2
|
|
2
2
|
azure-cli-telemetry==1.1.0.*
|
|
3
|
+
azure-core~=1.35.0
|
|
3
4
|
azure-mgmt-core<2,>=1.2.0
|
|
4
5
|
cryptography
|
|
5
6
|
humanfriendly~=10.0
|
|
@@ -18,10 +19,10 @@ requests[socks]
|
|
|
18
19
|
psutil>=5.9
|
|
19
20
|
|
|
20
21
|
[:sys_platform != "win32"]
|
|
21
|
-
msal==1.
|
|
22
|
+
msal==1.34.0b1
|
|
22
23
|
|
|
23
24
|
[:sys_platform == "linux"]
|
|
24
25
|
distro
|
|
25
26
|
|
|
26
27
|
[:sys_platform == "win32"]
|
|
27
|
-
msal[broker]==1.
|
|
28
|
+
msal[broker]==1.34.0b1
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
from codecs import open
|
|
9
9
|
from setuptools import setup, find_packages
|
|
10
10
|
|
|
11
|
-
VERSION = "2.
|
|
11
|
+
VERSION = "2.77.0"
|
|
12
12
|
|
|
13
13
|
# If we have source, validate that our version numbers match
|
|
14
14
|
# This should prevent uploading releases with mismatched versions.
|
|
@@ -39,12 +39,14 @@ CLASSIFIERS = [
|
|
|
39
39
|
'Programming Language :: Python :: 3.10',
|
|
40
40
|
'Programming Language :: Python :: 3.11',
|
|
41
41
|
'Programming Language :: Python :: 3.12',
|
|
42
|
+
'Programming Language :: Python :: 3.13',
|
|
42
43
|
'License :: OSI Approved :: MIT License',
|
|
43
44
|
]
|
|
44
45
|
|
|
45
46
|
DEPENDENCIES = [
|
|
46
47
|
'argcomplete~=3.5.2',
|
|
47
48
|
'azure-cli-telemetry==1.1.0.*',
|
|
49
|
+
'azure-core~=1.35.0',
|
|
48
50
|
'azure-mgmt-core>=1.2.0,<2',
|
|
49
51
|
'cryptography',
|
|
50
52
|
# On Linux, the distribution (Ubuntu, Debian, etc) and version are logged in telemetry
|
|
@@ -54,8 +56,8 @@ DEPENDENCIES = [
|
|
|
54
56
|
'knack~=0.11.0',
|
|
55
57
|
'microsoft-security-utilities-secret-masker~=1.0.0b4',
|
|
56
58
|
'msal-extensions==1.2.0',
|
|
57
|
-
'msal[broker]==1.
|
|
58
|
-
'msal==1.
|
|
59
|
+
'msal[broker]==1.34.0b1; sys_platform == "win32"',
|
|
60
|
+
'msal==1.34.0b1; sys_platform != "win32"',
|
|
59
61
|
'packaging>=20.9',
|
|
60
62
|
'pkginfo>=1.5.0.1',
|
|
61
63
|
# psutil can't install on cygwin: https://github.com/Azure/azure-cli/issues/9399
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/landing_pages/error.html
RENAMED
|
File without changes
|
{azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/auth/landing_pages/success.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure/cli/core/commands/command_operation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{azure_cli_core-2.76.0 → azure_cli_core-2.77.0}/azure_cli_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|