azure-cli-core 2.86.0__tar.gz → 2.88.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.86.0 → azure_cli_core-2.88.0}/HISTORY.rst +12 -0
- {azure_cli_core-2.86.0/azure_cli_core.egg-info → azure_cli_core-2.88.0}/PKG-INFO +6 -5
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/__init__.py +10 -43
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_profile.py +5 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_arg_fmt.py +10 -1
- azure_cli_core-2.88.0/azure/cli/core/auth/agentic_session.py +67 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/msal_credentials.py +21 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/azlogging.py +30 -1
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/breaking_change.py +2 -2
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/cloud.py +1 -1
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commandIndex.latest.json +1 -10
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/arm.py +6 -1
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/helpIndex.latest.json +3 -11
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/profiles/_shared.py +1 -2
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/sdk/policies.py +12 -3
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/style.py +0 -2
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/telemetry.py +7 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/util.py +91 -14
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0/azure_cli_core.egg-info}/PKG-INFO +6 -5
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure_cli_core.egg-info/SOURCES.txt +1 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure_cli_core.egg-info/requires.txt +4 -4
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/setup.py +9 -5
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/LICENSE.txt +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/MANIFEST.in +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/README.rst +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/__init__.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/__init__.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_breaking_change.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_completers.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_config.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_debug.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_environment.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_help.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_help_loaders.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_output.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/_session.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/__init__.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_arg.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_arg_action.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_arg_browser.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_base.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_client.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_command.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_command_ctx.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_content_builder.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_error_format.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_field_type.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_field_value.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_help.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_http_policy.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_operation.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_paging.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_poller.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_prompt.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_selector.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/_utils.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/exceptions.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/aaz/utils.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/api.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/__init__.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/binary_cache.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/constants.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/credential_adaptor.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/identity.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/landing_pages/error.html +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/landing_pages/success.html +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/persistence.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/util.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/azclierror.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/command_recommender.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/__init__.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/client_factory.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/command_operation.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/constants.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/events.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/parameters.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/progress.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/sensitive.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/template_create.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/transform.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/commands/validators.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/credential_helper.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/decorators.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/extension/__init__.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/extension/_homebrew_patch.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/extension/_index.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/extension/_resolve.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/extension/dynamic_install.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/extension/operations.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/file_util.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/intercept_survey.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/keys.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/local_context.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/mock.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/parser.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/profiles/__init__.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/sdk/__init__.py +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure_cli_core.egg-info/dependency_links.txt +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure_cli_core.egg-info/not-zip-safe +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure_cli_core.egg-info/top_level.txt +0 -0
- {azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/setup.cfg +0 -0
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
Release History
|
|
4
4
|
===============
|
|
5
5
|
|
|
6
|
+
2.88.0
|
|
7
|
+
++++++
|
|
8
|
+
* Resolve CVE-2026-48526 (#33562)
|
|
9
|
+
* Update global policy argument `--acquire-policy-token` to pick up new api-version and propagate correlation-id (#33661)
|
|
10
|
+
|
|
11
|
+
2.87.0
|
|
12
|
+
++++++
|
|
13
|
+
* Resolve CVE-2026-44431 (#33351)
|
|
14
|
+
* Resolve CVE-2026-44432 (#33351)
|
|
15
|
+
* `az login`: Support Entra agentic session differentiation for Copilot agent requests (#33309)
|
|
16
|
+
* Resolve CVE-2026-45409 (#33401)
|
|
17
|
+
|
|
6
18
|
2.86.0
|
|
7
19
|
++++++
|
|
8
20
|
* Resolve CVE-2025-15467 (#33201)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: azure-cli-core
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.88.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,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
19
|
Classifier: License :: OSI Approved :: MIT License
|
|
19
20
|
Requires-Python: >=3.10.0
|
|
20
21
|
License-File: LICENSE.txt
|
|
@@ -26,13 +27,13 @@ Requires-Dist: cryptography
|
|
|
26
27
|
Requires-Dist: distro; sys_platform == "linux"
|
|
27
28
|
Requires-Dist: humanfriendly~=10.0
|
|
28
29
|
Requires-Dist: jmespath
|
|
29
|
-
Requires-Dist: knack~=0.
|
|
30
|
+
Requires-Dist: knack~=0.14.0
|
|
30
31
|
Requires-Dist: microsoft-security-utilities-secret-masker~=1.0.0b4
|
|
31
32
|
Requires-Dist: msal-extensions==1.3.1
|
|
32
|
-
Requires-Dist: msal[broker]==1.
|
|
33
|
-
Requires-Dist: msal==1.
|
|
33
|
+
Requires-Dist: msal[broker]==1.36.0; sys_platform == "win32"
|
|
34
|
+
Requires-Dist: msal==1.36.0; sys_platform != "win32"
|
|
34
35
|
Requires-Dist: packaging>=20.9
|
|
35
|
-
Requires-Dist: pkginfo>=1.
|
|
36
|
+
Requires-Dist: pkginfo>=1.12.0
|
|
36
37
|
Requires-Dist: psutil>=5.9; sys_platform != "cygwin"
|
|
37
38
|
Requires-Dist: PyJWT>=2.1.0
|
|
38
39
|
Requires-Dist: pyopenssl>=17.1.0
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# --------------------------------------------------------------------------------------------
|
|
5
5
|
# pylint: disable=line-too-long
|
|
6
6
|
|
|
7
|
-
__version__ = "2.
|
|
7
|
+
__version__ = "2.88.0"
|
|
8
8
|
|
|
9
9
|
import os
|
|
10
10
|
import sys
|
|
@@ -37,10 +37,6 @@ REFRESH_EXTENSION_HELP_OVERLAY_SENTINEL = '__refresh_extension_help_overlay__'
|
|
|
37
37
|
ALWAYS_LOADED_MODULES = []
|
|
38
38
|
# Extensions that will always be loaded if installed. They don't expose commands but hook into CLI core.
|
|
39
39
|
ALWAYS_LOADED_EXTENSIONS = ['azext_ai_examples', 'azext_next']
|
|
40
|
-
# Timeout (in seconds) for loading a single module. Acts as a safety valve to prevent indefinite hangs
|
|
41
|
-
MODULE_LOAD_TIMEOUT_SECONDS = 60
|
|
42
|
-
# Maximum number of worker threads for parallel module loading.
|
|
43
|
-
MAX_WORKER_THREAD_COUNT = 4
|
|
44
40
|
|
|
45
41
|
|
|
46
42
|
def _get_top_level_command(args):
|
|
@@ -322,6 +318,7 @@ class MainCommandsLoader(CLICommandsLoader):
|
|
|
322
318
|
|
|
323
319
|
start_time = time.perf_counter()
|
|
324
320
|
logger.debug("Loading command modules...")
|
|
321
|
+
logger.debug(self.header_mod)
|
|
325
322
|
results = self._load_modules(args, command_modules)
|
|
326
323
|
|
|
327
324
|
count, cumulative_group_count, cumulative_command_count = \
|
|
@@ -664,42 +661,14 @@ class MainCommandsLoader(CLICommandsLoader):
|
|
|
664
661
|
loader._update_command_definitions() # pylint: disable=protected-access
|
|
665
662
|
|
|
666
663
|
def _load_modules(self, args, command_modules):
|
|
667
|
-
"""Load command modules
|
|
668
|
-
import concurrent.futures
|
|
669
|
-
from concurrent.futures import ThreadPoolExecutor
|
|
664
|
+
"""Load command modules sequentially."""
|
|
670
665
|
from azure.cli.core.commands import BLOCKED_MODS
|
|
671
666
|
|
|
672
667
|
results = []
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
try:
|
|
678
|
-
for future in concurrent.futures.as_completed(future_to_module, timeout=MODULE_LOAD_TIMEOUT_SECONDS):
|
|
679
|
-
try:
|
|
680
|
-
result = future.result()
|
|
681
|
-
results.append(result)
|
|
682
|
-
except (ImportError, AttributeError, TypeError, ValueError) as ex:
|
|
683
|
-
mod = future_to_module[future]
|
|
684
|
-
logger.warning("Module '%s' load failed: %s", mod, ex)
|
|
685
|
-
results.append(ModuleLoadResult(mod, {}, {}, 0, ex))
|
|
686
|
-
except Exception as ex: # pylint: disable=broad-exception-caught
|
|
687
|
-
mod = future_to_module[future]
|
|
688
|
-
logger.warning("Module '%s' load failed with unexpected exception: %s", mod, ex)
|
|
689
|
-
results.append(ModuleLoadResult(mod, {}, {}, 0, ex))
|
|
690
|
-
except concurrent.futures.TimeoutError:
|
|
691
|
-
for future, mod in future_to_module.items():
|
|
692
|
-
if future.done():
|
|
693
|
-
try:
|
|
694
|
-
result = future.result()
|
|
695
|
-
results.append(result)
|
|
696
|
-
except Exception as ex: # pylint: disable=broad-exception-caught
|
|
697
|
-
logger.warning("Module '%s' load failed: %s", mod, ex)
|
|
698
|
-
results.append(ModuleLoadResult(mod, {}, {}, 0, ex))
|
|
699
|
-
else:
|
|
700
|
-
logger.warning("Module '%s' load timeout after %s seconds", mod, MODULE_LOAD_TIMEOUT_SECONDS)
|
|
701
|
-
results.append(ModuleLoadResult(mod, {}, {}, 0,
|
|
702
|
-
Exception(f"Module '{mod}' load timeout")))
|
|
668
|
+
for mod in command_modules:
|
|
669
|
+
if mod in BLOCKED_MODS:
|
|
670
|
+
continue
|
|
671
|
+
results.append(self._load_single_module(mod, args))
|
|
703
672
|
|
|
704
673
|
return results
|
|
705
674
|
|
|
@@ -712,6 +681,8 @@ class MainCommandsLoader(CLICommandsLoader):
|
|
|
712
681
|
module_command_table, module_group_table, command_loader = _load_module_command_loader(self, args, mod)
|
|
713
682
|
import_module_breaking_changes(mod)
|
|
714
683
|
elapsed_time = time.perf_counter() - start_time
|
|
684
|
+
logger.debug(self.item_format_string, mod, elapsed_time,
|
|
685
|
+
len(module_group_table), len(module_command_table))
|
|
715
686
|
return ModuleLoadResult(mod, module_command_table, module_group_table, elapsed_time, command_loader=command_loader)
|
|
716
687
|
except Exception as ex: # pylint: disable=broad-except
|
|
717
688
|
tb_str = traceback.format_exc()
|
|
@@ -744,13 +715,9 @@ class MainCommandsLoader(CLICommandsLoader):
|
|
|
744
715
|
self.command_table.update(result.command_table)
|
|
745
716
|
self.command_group_table.update(result.group_table)
|
|
746
717
|
|
|
747
|
-
logger.debug(self.item_format_string, result.module_name, result.elapsed_time,
|
|
748
|
-
len(result.group_table), len(result.command_table))
|
|
749
|
-
|
|
750
718
|
def _process_results_with_timing(self, results):
|
|
751
719
|
"""Process pre-loaded module results with timing and progress reporting."""
|
|
752
|
-
logger.debug("Loaded command modules
|
|
753
|
-
logger.debug(self.header_mod)
|
|
720
|
+
logger.debug("Loaded command modules:")
|
|
754
721
|
|
|
755
722
|
count = 0
|
|
756
723
|
cumulative_group_count = 0
|
|
@@ -441,6 +441,11 @@ class Profile:
|
|
|
441
441
|
def get_msal_token(self, scopes, data):
|
|
442
442
|
"""Get VM SSH certificate. DO NOT use it for other purposes. To get an access token, use get_raw_token instead.
|
|
443
443
|
"""
|
|
444
|
+
account = self.get_subscription()
|
|
445
|
+
managed_identity_type, _ = Profile._parse_managed_identity_account(account)
|
|
446
|
+
if managed_identity_type or (in_cloud_console() and account[_USER_ENTITY].get(_CLOUD_SHELL_ID)):
|
|
447
|
+
raise AuthenticationError("VM SSH currently doesn't support managed identity or Cloud Shell.")
|
|
448
|
+
|
|
444
449
|
credential, _, _ = self.get_login_credentials(sdk_credential=False)
|
|
445
450
|
from .auth.constants import ACCESS_TOKEN
|
|
446
451
|
certificate_string = credential.acquire_token(scopes, data=data)[ACCESS_TOKEN]
|
|
@@ -760,10 +760,19 @@ class AAZPaginationTokenArgFormat(AAZBaseArgFormat):
|
|
|
760
760
|
raise AAZInvalidArgValueError("Decoded object is not a dictionary.")
|
|
761
761
|
|
|
762
762
|
try:
|
|
763
|
-
|
|
763
|
+
next_link, _ = obj["next_link"], obj["offset"]
|
|
764
764
|
except KeyError:
|
|
765
765
|
raise AAZInvalidArgValueError("`next_link` or `offset` doesn't exist.")
|
|
766
766
|
|
|
767
|
+
# `next_link` is a URL that the next page request is sent to with an Azure access token.
|
|
768
|
+
# Validate it shares the same origin as a trusted endpoint of the active cloud to prevent
|
|
769
|
+
# the token from being sent to an attacker-controlled host such as
|
|
770
|
+
# `https://management.azure.com.attacker`.
|
|
771
|
+
if next_link is not None:
|
|
772
|
+
from azure.cli.core.util import is_trusted_cloud_endpoint
|
|
773
|
+
if not is_trusted_cloud_endpoint(next_link, ctx.cli_ctx):
|
|
774
|
+
raise AAZInvalidArgValueError("`next_link` '{}' is not a valid endpoint.".format(next_link))
|
|
775
|
+
|
|
767
776
|
assert isinstance(value, AAZSimpleValue)
|
|
768
777
|
data = value._data
|
|
769
778
|
if data == AAZUndefined or data is None or value._is_patch:
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# --------------------------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
# --------------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
Support for Entra Agentic Sessions.
|
|
8
|
+
|
|
9
|
+
When CLI runs inside an agent context (e.g., Copilot, Azure MCP), the orchestrator sets the
|
|
10
|
+
COPILOT_AGENT_SESSION_ID environment variable. CLI reads it and passes it to MSAL as both:
|
|
11
|
+
- A query parameter (`client_session`) so ESTS can identify the agentic session
|
|
12
|
+
- A claims challenge so ESTS embeds an agentic marker claim in the token (and MSAL bypasses
|
|
13
|
+
the access token cache to ensure a fresh, agent-tagged token is always fetched)
|
|
14
|
+
|
|
15
|
+
This enables downstream systems (RBAC, Defender, Purview) to enforce differentiated policies
|
|
16
|
+
for agent-driven vs. human-driven operations.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
import json
|
|
20
|
+
import os
|
|
21
|
+
|
|
22
|
+
from knack.log import get_logger
|
|
23
|
+
|
|
24
|
+
logger = get_logger(__name__)
|
|
25
|
+
|
|
26
|
+
COPILOT_AGENT_SESSION_ID = "COPILOT_AGENT_SESSION_ID"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def build_agentic_session_params():
|
|
30
|
+
"""Read COPILOT_AGENT_SESSION_ID and build the agentic claims challenge.
|
|
31
|
+
|
|
32
|
+
:returns: (session_id, claims_challenge) — both None when env var is not set.
|
|
33
|
+
"""
|
|
34
|
+
session_id = os.environ.get(COPILOT_AGENT_SESSION_ID) or None
|
|
35
|
+
if not session_id:
|
|
36
|
+
return None, None
|
|
37
|
+
|
|
38
|
+
logger.debug("Agentic session detected (COPILOT_AGENT_SESSION_ID is set)")
|
|
39
|
+
|
|
40
|
+
claims_challenge = json.dumps({
|
|
41
|
+
"access_token": {
|
|
42
|
+
"xms_cli_sid": {"values": [session_id]}
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
return session_id, claims_challenge
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def merge_access_token_claims(existing_claims, new_claims):
|
|
49
|
+
"""Merge new claims into an existing claims_challenge JSON string.
|
|
50
|
+
|
|
51
|
+
:param existing_claims: Existing claims_challenge JSON string (or None).
|
|
52
|
+
:param new_claims: New claims_challenge JSON string to merge in. Must not be None or empty,
|
|
53
|
+
and must contain a non-empty ``access_token`` object.
|
|
54
|
+
:returns: Merged claims_challenge JSON string.
|
|
55
|
+
:raises ValueError: If ``new_claims`` is None, empty, or does not contain a non-empty
|
|
56
|
+
``access_token`` object.
|
|
57
|
+
"""
|
|
58
|
+
if not new_claims:
|
|
59
|
+
raise ValueError("new_claims must not be None or empty")
|
|
60
|
+
new_access_token = json.loads(new_claims).get("access_token")
|
|
61
|
+
if not new_access_token:
|
|
62
|
+
raise ValueError("new_claims must contain a non-empty access_token")
|
|
63
|
+
|
|
64
|
+
claims_dict = json.loads(existing_claims) if existing_claims else {}
|
|
65
|
+
claims_dict["access_token"] = claims_dict.get("access_token") or {}
|
|
66
|
+
claims_dict["access_token"].update(new_access_token)
|
|
67
|
+
return json.dumps(claims_dict)
|
|
@@ -50,6 +50,27 @@ class UserCredential: # pylint: disable=too-few-public-methods
|
|
|
50
50
|
logger.debug("UserCredential.acquire_token: scopes=%r, claims_challenge=%r, kwargs=%r",
|
|
51
51
|
scopes, claims_challenge, kwargs)
|
|
52
52
|
|
|
53
|
+
# Apply agentic session parameters for user identity flows
|
|
54
|
+
from .agentic_session import build_agentic_session_params, merge_access_token_claims
|
|
55
|
+
agentic_session_id, agentic_claims = build_agentic_session_params()
|
|
56
|
+
if agentic_session_id:
|
|
57
|
+
# Both paths: client_session in data and params so eSTS can identify the agentic session
|
|
58
|
+
kwargs["data"] = kwargs.get("data") or {}
|
|
59
|
+
kwargs["data"]["client_session"] = agentic_session_id
|
|
60
|
+
kwargs["params"] = kwargs.get("params") or {}
|
|
61
|
+
kwargs["params"]["client_session"] = agentic_session_id
|
|
62
|
+
|
|
63
|
+
if getattr(self._msal_app, '_enable_broker', False):
|
|
64
|
+
# Broker path: claims_challenge flows to MSALRuntime cache key via set_decoded_claims.
|
|
65
|
+
# This causes MSAL to skip its local AT cache and forward claims to the broker,
|
|
66
|
+
# where requestedClaims becomes part of the C++ cache key.
|
|
67
|
+
claims_challenge = merge_access_token_claims(claims_challenge, agentic_claims)
|
|
68
|
+
# Non-broker path: client_session in data flows into ext_cache_key (SHA256 hash),
|
|
69
|
+
# which partitions the MSAL Python token cache. No claims_challenge needed.
|
|
70
|
+
|
|
71
|
+
from azure.cli.core.telemetry import set_agentic_session
|
|
72
|
+
set_agentic_session(True)
|
|
73
|
+
|
|
53
74
|
if claims_challenge:
|
|
54
75
|
logger.info('Acquiring new access token silently with claims challenge: %s', claims_challenge)
|
|
55
76
|
result = self._msal_app.acquire_token_silent_with_error(
|
|
@@ -26,6 +26,7 @@ omitted Warning Debug Critical Debug
|
|
|
26
26
|
import os
|
|
27
27
|
import logging
|
|
28
28
|
import datetime
|
|
29
|
+
from logging.handlers import RotatingFileHandler
|
|
29
30
|
|
|
30
31
|
from azure.cli.core.commands.events import EVENT_INVOKER_PRE_CMD_TBL_TRUNCATE
|
|
31
32
|
|
|
@@ -38,6 +39,20 @@ _UNKNOWN_COMMAND = "unknown_command"
|
|
|
38
39
|
_CMD_LOG_LINE_PREFIX = "CMD-LOG-LINE-BEGIN"
|
|
39
40
|
|
|
40
41
|
|
|
42
|
+
class SecureFileHandler(logging.FileHandler):
|
|
43
|
+
"""A FileHandler that creates the log file with 600 permissions (owner read/write only)."""
|
|
44
|
+
def _open(self):
|
|
45
|
+
fd = os.open(self.baseFilename, os.O_WRONLY | os.O_CREAT | os.O_APPEND, 0o600)
|
|
46
|
+
return os.fdopen(fd, self.mode, encoding=self.encoding)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class SecureRotatingFileHandler(RotatingFileHandler):
|
|
50
|
+
"""A RotatingFileHandler that creates log files with 600 permissions (owner read/write only)."""
|
|
51
|
+
def _open(self):
|
|
52
|
+
fd = os.open(self.baseFilename, os.O_WRONLY | os.O_CREAT | os.O_APPEND, 0o600)
|
|
53
|
+
return os.fdopen(fd, self.mode, encoding=self.encoding)
|
|
54
|
+
|
|
55
|
+
|
|
41
56
|
class AzCliLogging(CLILogging):
|
|
42
57
|
COMMAND_METADATA_LOGGER = 'az_command_data_logger'
|
|
43
58
|
|
|
@@ -58,6 +73,20 @@ class AzCliLogging(CLILogging):
|
|
|
58
73
|
# when debug log is shown.
|
|
59
74
|
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.CRITICAL)
|
|
60
75
|
|
|
76
|
+
def _init_logfile_handlers(self, root_logger, cli_loggers):
|
|
77
|
+
# Override knack's CLILogging._init_logfile_handlers() (called by CLILogging.configure())
|
|
78
|
+
# to use SecureRotatingFileHandler, ensuring log files are created with 0o600 permissions.
|
|
79
|
+
ensure_dir(self.log_dir)
|
|
80
|
+
log_file_path = os.path.join(self.log_dir, self.logfile_name)
|
|
81
|
+
logfile_handler = SecureRotatingFileHandler(log_file_path, maxBytes=10 * 1024 * 1024, backupCount=5,
|
|
82
|
+
encoding=LOG_FILE_ENCODING)
|
|
83
|
+
lfmt = logging.Formatter('%(process)d : %(asctime)s : %(levelname)s : %(name)s : %(message)s')
|
|
84
|
+
logfile_handler.setFormatter(lfmt)
|
|
85
|
+
logfile_handler.setLevel(logging.DEBUG)
|
|
86
|
+
root_logger.addHandler(logfile_handler)
|
|
87
|
+
for cli_logger in cli_loggers:
|
|
88
|
+
cli_logger.addHandler(logfile_handler)
|
|
89
|
+
|
|
61
90
|
def get_command_log_dir(self):
|
|
62
91
|
return self.command_log_dir
|
|
63
92
|
|
|
@@ -112,7 +141,7 @@ class AzCliLogging(CLILogging):
|
|
|
112
141
|
log_file_path = os.path.join(self.command_log_dir, log_name)
|
|
113
142
|
get_logger(__name__).debug("metadata file logging enabled - writing logs to '%s'.", log_file_path)
|
|
114
143
|
|
|
115
|
-
logfile_handler =
|
|
144
|
+
logfile_handler = SecureFileHandler(log_file_path, encoding=LOG_FILE_ENCODING)
|
|
116
145
|
|
|
117
146
|
lfmt = logging.Formatter(_CMD_LOG_LINE_PREFIX + ' %(process)d | %(asctime)s | %(levelname)s | %(name)s | %(message)s') # pylint: disable=line-too-long
|
|
118
147
|
logfile_handler.setFormatter(lfmt)
|
|
@@ -15,8 +15,8 @@ from knack.util import StatusTag, color_map
|
|
|
15
15
|
|
|
16
16
|
logger = get_logger()
|
|
17
17
|
|
|
18
|
-
NEXT_BREAKING_CHANGE_RELEASE = '2.
|
|
19
|
-
NEXT_BREAKING_CHANGE_DATE = '
|
|
18
|
+
NEXT_BREAKING_CHANGE_RELEASE = '2.92.0'
|
|
19
|
+
NEXT_BREAKING_CHANGE_DATE = 'Nov 2026'
|
|
20
20
|
DEFAULT_BREAKING_CHANGE_TAG = '[Breaking Change]'
|
|
21
21
|
|
|
22
22
|
|
|
@@ -502,7 +502,7 @@ AZURE_BLEU_CLOUD = Cloud(
|
|
|
502
502
|
active_directory_resource_id='https://management.sovcloud-api.fr/',
|
|
503
503
|
active_directory_graph_resource_id='https://graph.svc.sovcloud.fr/',
|
|
504
504
|
microsoft_graph_resource_id='https://graph.svc.sovcloud.fr',
|
|
505
|
-
vm_image_alias_doc='https://
|
|
505
|
+
vm_image_alias_doc='https://azcliprod.blob.core.windows.net/cli/vm/aliases_master.json',
|
|
506
506
|
media_resource_id='https://rest.media.sovcloud-api.fr',
|
|
507
507
|
ossrdbms_resource_id='https://ossrdbms-aad.database.sovcloud-api.fr',
|
|
508
508
|
portal='https://portal.sovcloud-azure.fr'),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.88.0",
|
|
3
3
|
"cloudProfile": "latest",
|
|
4
4
|
"commandIndex": {
|
|
5
5
|
"account": [
|
|
@@ -15,9 +15,6 @@
|
|
|
15
15
|
"advisor": [
|
|
16
16
|
"azure.cli.command_modules.advisor"
|
|
17
17
|
],
|
|
18
|
-
"afd": [
|
|
19
|
-
"azure.cli.command_modules.cdn"
|
|
20
|
-
],
|
|
21
18
|
"aks": [
|
|
22
19
|
"azure.cli.command_modules.acs",
|
|
23
20
|
"azure.cli.command_modules.serviceconnector"
|
|
@@ -61,9 +58,6 @@
|
|
|
61
58
|
"capacity": [
|
|
62
59
|
"azure.cli.command_modules.vm"
|
|
63
60
|
],
|
|
64
|
-
"cdn": [
|
|
65
|
-
"azure.cli.command_modules.cdn"
|
|
66
|
-
],
|
|
67
61
|
"cloud": [
|
|
68
62
|
"azure.cli.command_modules.cloud"
|
|
69
63
|
],
|
|
@@ -104,9 +98,6 @@
|
|
|
104
98
|
"databoxedge": [
|
|
105
99
|
"azure.cli.command_modules.databoxedge"
|
|
106
100
|
],
|
|
107
|
-
"demo": [
|
|
108
|
-
"azure.cli.command_modules.util"
|
|
109
|
-
],
|
|
110
101
|
"deployment": [
|
|
111
102
|
"azure.cli.command_modules.resource"
|
|
112
103
|
],
|
|
@@ -774,6 +774,11 @@ def create_role_assignment(cli_ctx, principal_id, identity_role=None, identity_s
|
|
|
774
774
|
import time
|
|
775
775
|
from azure.core.exceptions import HttpResponseError
|
|
776
776
|
|
|
777
|
+
# Coerce AAZSimpleValue/model values to plain strings for SDK 5.0.0b2 compatibility
|
|
778
|
+
principal_id = str(principal_id) if principal_id else principal_id
|
|
779
|
+
identity_role = str(identity_role) if identity_role else identity_role
|
|
780
|
+
identity_scope = str(identity_scope) if identity_scope else identity_scope
|
|
781
|
+
|
|
777
782
|
identity_role_id = resolve_role_id(cli_ctx, identity_role, identity_scope)
|
|
778
783
|
assignments_client = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_AUTHORIZATION).role_assignments
|
|
779
784
|
RoleAssignmentCreateParameters = get_sdk(cli_ctx, ResourceType.MGMT_AUTHORIZATION,
|
|
@@ -818,7 +823,7 @@ def resolve_role_id(cli_ctx, role, scope):
|
|
|
818
823
|
except ValueError:
|
|
819
824
|
pass
|
|
820
825
|
if not role_id: # retrieve role id
|
|
821
|
-
role_defs = list(client.list(scope, "roleName eq '{}'".format(role)))
|
|
826
|
+
role_defs = list(client.list(scope, filter="roleName eq '{}'".format(role)))
|
|
822
827
|
if not role_defs:
|
|
823
828
|
raise CLIError("Role '{}' doesn't exist.".format(role))
|
|
824
829
|
if len(role_defs) > 1:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.88.0",
|
|
3
3
|
"cloudProfile": "latest",
|
|
4
4
|
"helpIndex": {
|
|
5
5
|
"groups": {
|
|
@@ -19,10 +19,6 @@
|
|
|
19
19
|
"summary": "Manage Azure Advisor.",
|
|
20
20
|
"tags": ""
|
|
21
21
|
},
|
|
22
|
-
"afd": {
|
|
23
|
-
"summary": "Manage Azure Front Door Standard/Premium.",
|
|
24
|
-
"tags": ""
|
|
25
|
-
},
|
|
26
22
|
"aks": {
|
|
27
23
|
"summary": "Azure Kubernetes Service.",
|
|
28
24
|
"tags": ""
|
|
@@ -75,10 +71,6 @@
|
|
|
75
71
|
"summary": "Manage capacity.",
|
|
76
72
|
"tags": ""
|
|
77
73
|
},
|
|
78
|
-
"cdn": {
|
|
79
|
-
"summary": "Manage Azure Content Delivery Networks (CDNs).",
|
|
80
|
-
"tags": ""
|
|
81
|
-
},
|
|
82
74
|
"cloud": {
|
|
83
75
|
"summary": "Manage registered Azure clouds.",
|
|
84
76
|
"tags": ""
|
|
@@ -89,7 +81,7 @@
|
|
|
89
81
|
},
|
|
90
82
|
"compute-fleet": {
|
|
91
83
|
"summary": "Manage for Azure Compute Fleet.",
|
|
92
|
-
"tags": "
|
|
84
|
+
"tags": ""
|
|
93
85
|
},
|
|
94
86
|
"compute-recommender": {
|
|
95
87
|
"summary": "Manage sku/zone/region recommender info for compute resources.",
|
|
@@ -292,7 +284,7 @@
|
|
|
292
284
|
"tags": ""
|
|
293
285
|
},
|
|
294
286
|
"search": {
|
|
295
|
-
"summary": "Manage Search.",
|
|
287
|
+
"summary": "Manage Azure AI Search.",
|
|
296
288
|
"tags": ""
|
|
297
289
|
},
|
|
298
290
|
"security": {
|
|
@@ -97,7 +97,6 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods
|
|
|
97
97
|
MGMT_BATCHAI = ('azure.mgmt.batchai', None)
|
|
98
98
|
MGMT_BILLING = ('azure.mgmt.billing', None)
|
|
99
99
|
MGMT_BOTSERVICE = ('azure.mgmt.botservice', None)
|
|
100
|
-
MGMT_CDN = ('azure.mgmt.cdn', None)
|
|
101
100
|
MGMT_COGNITIVESERVICES = ('azure.mgmt.cognitiveservices', None)
|
|
102
101
|
MGMT_CONTAINERINSTANCE = ('azure.mgmt.containerinstance', None)
|
|
103
102
|
MGMT_COSMOSDB = ('azure.mgmt.cosmosdb', None)
|
|
@@ -208,7 +207,7 @@ AZURE_API_PROFILES = {
|
|
|
208
207
|
ResourceType.MGMT_EVENTHUB: None,
|
|
209
208
|
ResourceType.MGMT_MONITOR: None,
|
|
210
209
|
ResourceType.MGMT_MSI: '2024-11-30',
|
|
211
|
-
ResourceType.MGMT_APPSERVICE:
|
|
210
|
+
ResourceType.MGMT_APPSERVICE: None,
|
|
212
211
|
ResourceType.MGMT_IOTHUB: None,
|
|
213
212
|
ResourceType.MGMT_IOTDPS: None,
|
|
214
213
|
ResourceType.MGMT_IOTCENTRAL: None,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import logging
|
|
7
7
|
import re
|
|
8
8
|
import types
|
|
9
|
+
import uuid
|
|
9
10
|
|
|
10
11
|
from azure.core.pipeline.policies import SansIOHTTPPolicy, UserAgentPolicy
|
|
11
12
|
from knack.log import get_logger
|
|
@@ -111,7 +112,7 @@ def get_custom_hook_policy(cli_ctx):
|
|
|
111
112
|
http_request = request.http_request
|
|
112
113
|
if getattr(http_request, 'method', '') == 'GET':
|
|
113
114
|
return
|
|
114
|
-
ACQUIRE_POLICY_TOKEN_URL = '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/acquirePolicyToken?api-version=2025-
|
|
115
|
+
ACQUIRE_POLICY_TOKEN_URL = '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/acquirePolicyToken?api-version=2025-11-01'
|
|
115
116
|
policy_token = None
|
|
116
117
|
|
|
117
118
|
from azure.cli.core.azclierror import ServiceError
|
|
@@ -135,10 +136,18 @@ def get_custom_hook_policy(cli_ctx):
|
|
|
135
136
|
},
|
|
136
137
|
"changeReference": cli_ctx.data.get('_change_reference', None)
|
|
137
138
|
}
|
|
139
|
+
|
|
140
|
+
# Reuse the original request's x-ms-correlation-request-id so the acquirePolicyToken call shares the same correlation ID as the operation it is gating.
|
|
141
|
+
headers = ['Content-Type=application/json', 'x-ms-force-sync=true']
|
|
142
|
+
correlation_id = http_request.headers.get('x-ms-correlation-request-id')
|
|
143
|
+
if not correlation_id:
|
|
144
|
+
correlation_id = str(uuid.uuid4())
|
|
145
|
+
http_request.headers['x-ms-correlation-request-id'] = correlation_id
|
|
146
|
+
headers.append('x-ms-correlation-request-id={}'.format(correlation_id))
|
|
147
|
+
|
|
138
148
|
acquire_policy_token_response = send_raw_request(cli_ctx, 'POST',
|
|
139
149
|
ACQUIRE_POLICY_TOKEN_URL,
|
|
140
|
-
headers=
|
|
141
|
-
'x-ms-force-sync=true'],
|
|
150
|
+
headers=headers,
|
|
142
151
|
body=json.dumps(acquire_policy_token_body))
|
|
143
152
|
if acquire_policy_token_response.status_code == 200 and acquire_policy_token_response.content:
|
|
144
153
|
response_content = json.loads(acquire_policy_token_response.content)
|
|
@@ -13,8 +13,6 @@ https://devdivdesignguide.azurewebsites.net/command-line-interface/color-guideli
|
|
|
13
13
|
|
|
14
14
|
Console Virtual Terminal Sequences:
|
|
15
15
|
https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#text-formatting
|
|
16
|
-
|
|
17
|
-
For a complete demo, see `src/azure-cli/azure/cli/command_modules/util/custom.py` and run `az demo style`.
|
|
18
16
|
"""
|
|
19
17
|
|
|
20
18
|
import sys
|
|
@@ -79,6 +79,7 @@ class TelemetrySession: # pylint: disable=too-many-instance-attributes
|
|
|
79
79
|
self.enable_broker_on_windows = None
|
|
80
80
|
self.msal_telemetry = None
|
|
81
81
|
self.login_experience_v2 = None
|
|
82
|
+
self.agentic_session = False
|
|
82
83
|
|
|
83
84
|
def add_event(self, name, properties):
|
|
84
85
|
for key in self.instrumentation_key:
|
|
@@ -239,6 +240,7 @@ class TelemetrySession: # pylint: disable=too-many-instance-attributes
|
|
|
239
240
|
set_custom_properties(result, 'EnableBrokerOnWindows', str(self.enable_broker_on_windows))
|
|
240
241
|
set_custom_properties(result, 'MsalTelemetry', self.msal_telemetry)
|
|
241
242
|
set_custom_properties(result, 'LoginExperienceV2', str(self.login_experience_v2))
|
|
243
|
+
set_custom_properties(result, 'AgenticSession', str(self.agentic_session))
|
|
242
244
|
|
|
243
245
|
return result
|
|
244
246
|
|
|
@@ -497,6 +499,11 @@ def set_msal_telemetry(msal_telemetry):
|
|
|
497
499
|
@decorators.suppress_all_exceptions()
|
|
498
500
|
def set_login_experience_v2(login_experience_v2):
|
|
499
501
|
_session.login_experience_v2 = login_experience_v2
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
@decorators.suppress_all_exceptions()
|
|
505
|
+
def set_agentic_session(agentic_session):
|
|
506
|
+
_session.agentic_session = agentic_session
|
|
500
507
|
# endregion
|
|
501
508
|
|
|
502
509
|
|
|
@@ -576,11 +576,10 @@ def get_file_yaml(file_path, throw_on_empty=True):
|
|
|
576
576
|
|
|
577
577
|
|
|
578
578
|
def read_file_content(file_path, allow_binary=False):
|
|
579
|
-
from codecs import open as codecs_open
|
|
580
579
|
# Note, always put 'utf-8-sig' first, so that BOM in WinOS won't cause trouble.
|
|
581
580
|
for encoding in ['utf-8-sig', 'utf-8', 'utf-16', 'utf-16le', 'utf-16be']:
|
|
582
581
|
try:
|
|
583
|
-
with
|
|
582
|
+
with open(file_path, mode='r', encoding=encoding) as f:
|
|
584
583
|
logger.debug("attempting to read file %s as %s", file_path, encoding)
|
|
585
584
|
return f.read()
|
|
586
585
|
except (UnicodeError, UnicodeDecodeError):
|
|
@@ -1042,21 +1041,13 @@ def send_raw_request(cli_ctx, method, url, headers=None, uri_parameters=None, #
|
|
|
1042
1041
|
if not skip_authorization_header and url.lower().startswith('https://'):
|
|
1043
1042
|
# Prepare `resource` for `get_raw_token`
|
|
1044
1043
|
if not resource:
|
|
1045
|
-
# If url
|
|
1044
|
+
# If url's origin matches the ARM endpoint, like `https://management.azure.com/`,
|
|
1046
1045
|
# use `active_directory_resource_id` for resource, like `https://management.core.windows.net/`.
|
|
1047
1046
|
# This follows the same behavior as `azure.cli.core.commands.client_factory._get_mgmt_service_client`
|
|
1048
|
-
if url
|
|
1047
|
+
if is_same_origin(url, endpoints.resource_manager):
|
|
1049
1048
|
resource = endpoints.active_directory_resource_id
|
|
1050
1049
|
else:
|
|
1051
|
-
|
|
1052
|
-
for p in [x for x in dir(endpoints) if not x.startswith('_')]:
|
|
1053
|
-
try:
|
|
1054
|
-
value = getattr(endpoints, p)
|
|
1055
|
-
except CloudEndpointNotSetException:
|
|
1056
|
-
continue
|
|
1057
|
-
if isinstance(value, str) and url.lower().startswith(value.lower()):
|
|
1058
|
-
resource = value
|
|
1059
|
-
break
|
|
1050
|
+
resource = match_cloud_endpoint(url, cli_ctx)
|
|
1060
1051
|
if resource:
|
|
1061
1052
|
# Prepare `subscription` for `get_raw_token`
|
|
1062
1053
|
# If this is an ARM request, try to extract subscription ID from the URL.
|
|
@@ -1064,7 +1055,7 @@ def send_raw_request(cli_ctx, method, url, headers=None, uri_parameters=None, #
|
|
|
1064
1055
|
# TODO: In the future when multi-tenant subscription is supported, we won't be able to uniquely identify
|
|
1065
1056
|
# the token from subscription anymore.
|
|
1066
1057
|
token_subscription = None
|
|
1067
|
-
if url
|
|
1058
|
+
if is_same_origin(url, endpoints.resource_manager):
|
|
1068
1059
|
token_subscription = _extract_subscription_id(url)
|
|
1069
1060
|
if token_subscription:
|
|
1070
1061
|
logger.debug('Retrieving token for resource %s, subscription %s', resource, token_subscription)
|
|
@@ -1211,6 +1202,92 @@ def urlretrieve(url):
|
|
|
1211
1202
|
return req.read()
|
|
1212
1203
|
|
|
1213
1204
|
|
|
1205
|
+
def is_same_origin(url, endpoint):
|
|
1206
|
+
"""Check whether ``url`` and ``endpoint`` share the same origin (scheme + host + port).
|
|
1207
|
+
|
|
1208
|
+
This performs an exact origin comparison rather than substring or prefix matching, so a
|
|
1209
|
+
malicious host such as ``https://management.azure.com.attacker`` is not mistaken for
|
|
1210
|
+
the trusted endpoint ``https://management.azure.com``. It is intended for validating that a
|
|
1211
|
+
URL points to a trusted endpoint before sensitive data (e.g., an Azure access token) is sent
|
|
1212
|
+
to it.
|
|
1213
|
+
|
|
1214
|
+
:param url: The URL to validate, e.g., ``https://management.azure.com/subscriptions/...``.
|
|
1215
|
+
:param endpoint: The trusted endpoint to validate against, e.g., ``https://management.azure.com/``.
|
|
1216
|
+
:return: ``True`` if both share the same origin, otherwise ``False``.
|
|
1217
|
+
:rtype: bool
|
|
1218
|
+
"""
|
|
1219
|
+
from urllib.parse import urlparse
|
|
1220
|
+
|
|
1221
|
+
if not isinstance(url, str) or not isinstance(endpoint, str):
|
|
1222
|
+
return False
|
|
1223
|
+
|
|
1224
|
+
try:
|
|
1225
|
+
url_parts = urlparse(url)
|
|
1226
|
+
endpoint_parts = urlparse(endpoint)
|
|
1227
|
+
|
|
1228
|
+
except (TypeError, ValueError):
|
|
1229
|
+
return False
|
|
1230
|
+
|
|
1231
|
+
# Require a real host on both sides to avoid false positives against non-URL endpoint values.
|
|
1232
|
+
# `hostname` (rather than `netloc`) is used so that userinfo tricks like
|
|
1233
|
+
# `https://management.azure.com@attacker` resolve to the actual host `attacker`.
|
|
1234
|
+
if not url_parts.hostname or not endpoint_parts.hostname:
|
|
1235
|
+
return False
|
|
1236
|
+
|
|
1237
|
+
def _effective_port(parts):
|
|
1238
|
+
# Treat a missing port as the scheme's default port so that, e.g.,
|
|
1239
|
+
# `https://management.azure.com:443/` and `https://management.azure.com/` are equivalent.
|
|
1240
|
+
if parts.port is not None:
|
|
1241
|
+
return parts.port
|
|
1242
|
+
|
|
1243
|
+
return {'http': 80, 'https': 443}.get(parts.scheme.lower())
|
|
1244
|
+
|
|
1245
|
+
try:
|
|
1246
|
+
if _effective_port(url_parts) != _effective_port(endpoint_parts):
|
|
1247
|
+
return False
|
|
1248
|
+
|
|
1249
|
+
except ValueError:
|
|
1250
|
+
return False
|
|
1251
|
+
|
|
1252
|
+
return (url_parts.scheme.lower() == endpoint_parts.scheme.lower() and
|
|
1253
|
+
url_parts.hostname.lower() == endpoint_parts.hostname.lower())
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
def match_cloud_endpoint(url, cli_ctx):
|
|
1257
|
+
"""Return the active cloud endpoint that shares the same origin as ``url``.
|
|
1258
|
+
|
|
1259
|
+
:param url: The URL to match, e.g., ``https://management.azure.com/subscriptions/...``.
|
|
1260
|
+
:param cli_ctx: The CLI context whose active cloud's endpoints are treated as trusted.
|
|
1261
|
+
:return: The matching endpoint value, or ``None`` if no endpoint shares ``url``'s origin.
|
|
1262
|
+
:rtype: str or None
|
|
1263
|
+
"""
|
|
1264
|
+
from azure.cli.core.cloud import CloudEndpointNotSetException
|
|
1265
|
+
|
|
1266
|
+
endpoints = cli_ctx.cloud.endpoints
|
|
1267
|
+
for p in [x for x in dir(endpoints) if not x.startswith('_')]:
|
|
1268
|
+
try:
|
|
1269
|
+
value = getattr(endpoints, p)
|
|
1270
|
+
|
|
1271
|
+
except CloudEndpointNotSetException:
|
|
1272
|
+
continue
|
|
1273
|
+
|
|
1274
|
+
if isinstance(value, str) and is_same_origin(url, value):
|
|
1275
|
+
return value
|
|
1276
|
+
|
|
1277
|
+
return None
|
|
1278
|
+
|
|
1279
|
+
|
|
1280
|
+
def is_trusted_cloud_endpoint(url, cli_ctx):
|
|
1281
|
+
"""Check whether ``url`` shares the same origin as any endpoint of the active cloud.
|
|
1282
|
+
|
|
1283
|
+
:param url: The URL to validate, e.g., ``https://management.azure.com/subscriptions/...``.
|
|
1284
|
+
:param cli_ctx: The CLI context whose active cloud's endpoints are treated as trusted.
|
|
1285
|
+
:return: ``True`` if ``url`` shares the same origin as any cloud endpoint, otherwise ``False``.
|
|
1286
|
+
:rtype: bool
|
|
1287
|
+
"""
|
|
1288
|
+
return match_cloud_endpoint(url, cli_ctx) is not None
|
|
1289
|
+
|
|
1290
|
+
|
|
1214
1291
|
def parse_proxy_resource_id(rid):
|
|
1215
1292
|
"""Parses a resource_id into its various parts.
|
|
1216
1293
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: azure-cli-core
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.88.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,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
19
|
Classifier: License :: OSI Approved :: MIT License
|
|
19
20
|
Requires-Python: >=3.10.0
|
|
20
21
|
License-File: LICENSE.txt
|
|
@@ -26,13 +27,13 @@ Requires-Dist: cryptography
|
|
|
26
27
|
Requires-Dist: distro; sys_platform == "linux"
|
|
27
28
|
Requires-Dist: humanfriendly~=10.0
|
|
28
29
|
Requires-Dist: jmespath
|
|
29
|
-
Requires-Dist: knack~=0.
|
|
30
|
+
Requires-Dist: knack~=0.14.0
|
|
30
31
|
Requires-Dist: microsoft-security-utilities-secret-masker~=1.0.0b4
|
|
31
32
|
Requires-Dist: msal-extensions==1.3.1
|
|
32
|
-
Requires-Dist: msal[broker]==1.
|
|
33
|
-
Requires-Dist: msal==1.
|
|
33
|
+
Requires-Dist: msal[broker]==1.36.0; sys_platform == "win32"
|
|
34
|
+
Requires-Dist: msal==1.36.0; sys_platform != "win32"
|
|
34
35
|
Requires-Dist: packaging>=20.9
|
|
35
|
-
Requires-Dist: pkginfo>=1.
|
|
36
|
+
Requires-Dist: pkginfo>=1.12.0
|
|
36
37
|
Requires-Dist: psutil>=5.9; sys_platform != "cygwin"
|
|
37
38
|
Requires-Dist: PyJWT>=2.1.0
|
|
38
39
|
Requires-Dist: pyopenssl>=17.1.0
|
|
@@ -60,6 +60,7 @@ azure/cli/core/aaz/_utils.py
|
|
|
60
60
|
azure/cli/core/aaz/exceptions.py
|
|
61
61
|
azure/cli/core/aaz/utils.py
|
|
62
62
|
azure/cli/core/auth/__init__.py
|
|
63
|
+
azure/cli/core/auth/agentic_session.py
|
|
63
64
|
azure/cli/core/auth/binary_cache.py
|
|
64
65
|
azure/cli/core/auth/constants.py
|
|
65
66
|
azure/cli/core/auth/credential_adaptor.py
|
|
@@ -5,11 +5,11 @@ azure-mgmt-core<2,>=1.2.0
|
|
|
5
5
|
cryptography
|
|
6
6
|
humanfriendly~=10.0
|
|
7
7
|
jmespath
|
|
8
|
-
knack~=0.
|
|
8
|
+
knack~=0.14.0
|
|
9
9
|
microsoft-security-utilities-secret-masker~=1.0.0b4
|
|
10
10
|
msal-extensions==1.3.1
|
|
11
11
|
packaging>=20.9
|
|
12
|
-
pkginfo>=1.
|
|
12
|
+
pkginfo>=1.12.0
|
|
13
13
|
PyJWT>=2.1.0
|
|
14
14
|
pyopenssl>=17.1.0
|
|
15
15
|
py-deviceid
|
|
@@ -19,10 +19,10 @@ requests[socks]
|
|
|
19
19
|
psutil>=5.9
|
|
20
20
|
|
|
21
21
|
[:sys_platform != "win32"]
|
|
22
|
-
msal==1.
|
|
22
|
+
msal==1.36.0
|
|
23
23
|
|
|
24
24
|
[:sys_platform == "linux"]
|
|
25
25
|
distro
|
|
26
26
|
|
|
27
27
|
[:sys_platform == "win32"]
|
|
28
|
-
msal[broker]==1.
|
|
28
|
+
msal[broker]==1.36.0
|
|
@@ -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.88.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,6 +39,7 @@ CLASSIFIERS = [
|
|
|
39
39
|
'Programming Language :: Python :: 3.11',
|
|
40
40
|
'Programming Language :: Python :: 3.12',
|
|
41
41
|
'Programming Language :: Python :: 3.13',
|
|
42
|
+
'Programming Language :: Python :: 3.14',
|
|
42
43
|
'License :: OSI Approved :: MIT License',
|
|
43
44
|
]
|
|
44
45
|
|
|
@@ -52,13 +53,16 @@ DEPENDENCIES = [
|
|
|
52
53
|
'distro; sys_platform == "linux"',
|
|
53
54
|
'humanfriendly~=10.0',
|
|
54
55
|
'jmespath',
|
|
55
|
-
'knack~=0.
|
|
56
|
+
'knack~=0.14.0',
|
|
56
57
|
'microsoft-security-utilities-secret-masker~=1.0.0b4',
|
|
57
58
|
'msal-extensions==1.3.1',
|
|
58
|
-
'msal[broker]==1.
|
|
59
|
-
'msal==1.
|
|
59
|
+
'msal[broker]==1.36.0; sys_platform == "win32"',
|
|
60
|
+
'msal==1.36.0; sys_platform != "win32"',
|
|
60
61
|
'packaging>=20.9',
|
|
61
|
-
|
|
62
|
+
# pkginfo>=1.12.0 reads the spec-defined wheel METADATA / unpacked .dist-info
|
|
63
|
+
# layout produced by modern wheel/setuptools (no metadata.json). Required so
|
|
64
|
+
# WheelExtension.get_metadata works without the legacy wheel==0.30.0 artifact.
|
|
65
|
+
'pkginfo>=1.12.0',
|
|
62
66
|
# psutil can't install on cygwin: https://github.com/Azure/azure-cli/issues/9399
|
|
63
67
|
'psutil>=5.9; sys_platform != "cygwin"',
|
|
64
68
|
'PyJWT>=2.1.0',
|
|
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
|
|
File without changes
|
|
File without changes
|
{azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure/cli/core/auth/landing_pages/error.html
RENAMED
|
File without changes
|
{azure_cli_core-2.86.0 → azure_cli_core-2.88.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
|
{azure_cli_core-2.86.0 → azure_cli_core-2.88.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
|
{azure_cli_core-2.86.0 → azure_cli_core-2.88.0}/azure_cli_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|