From 5535899fd2dfc0bb0e4288ee1556c7aff568eb93 Mon Sep 17 00:00:00 2001 From: necusjz Date: Mon, 16 Mar 2026 17:05:37 +1100 Subject: [PATCH 1/3] chore: bump PyJWT --- src/attestation/HISTORY.rst | 4 ++++ src/attestation/setup.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/attestation/HISTORY.rst b/src/attestation/HISTORY.rst index fb941a29295..ac26bf32ad2 100644 --- a/src/attestation/HISTORY.rst +++ b/src/attestation/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +1.0.1 +++++++ +* Bump PyJWT from `2.4.0` to `2.12.0`. + 1.0.0 ++++++ * `az attestation `: Remove sdk diff --git a/src/attestation/setup.py b/src/attestation/setup.py index f31fc428135..a3368bcc070 100644 --- a/src/attestation/setup.py +++ b/src/attestation/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # HISTORY.rst entry. -VERSION = '1.0.0' +VERSION = '1.0.1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -27,7 +27,7 @@ ] DEPENDENCIES = [ - 'pyjwt~=2.4.0' + 'pyjwt~=2.12.0' ] try: From 9108bb524b2f9cf0dbb2a60dfd5073789e8ed920 Mon Sep 17 00:00:00 2001 From: necusjz Date: Wed, 18 Mar 2026 11:35:32 +1100 Subject: [PATCH 2/3] style: fix linter --- src/attestation/azext_attestation/custom.py | 22 ++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/attestation/azext_attestation/custom.py b/src/attestation/azext_attestation/custom.py index 2a3fd931552..6d9cd771c32 100644 --- a/src/attestation/azext_attestation/custom.py +++ b/src/attestation/azext_attestation/custom.py @@ -18,10 +18,10 @@ from cryptography.hazmat.primitives.serialization import Encoding from cryptography.x509 import load_pem_x509_certificate -from azext_attestation.aaz.latest.attestation import Create as _AttestationCreate, Delete as _AttestationDelete,\ +from azext_attestation.aaz.latest.attestation import Create as _AttestationCreate, Delete as _AttestationDelete, \ Show as _AttestationShow, GetDefaultByLocation as _AttestationGetDefaultByLocation from azext_attestation.aaz.latest.attestation.policy import Reset as _ResetPolicy, Set as _SetPolicy, Show as _GetPolicy -from azext_attestation.aaz.latest.attestation.signer import Add as _AddSigner, Remove as _RemoveSigner,\ +from azext_attestation.aaz.latest.attestation.signer import Add as _AddSigner, Remove as _RemoveSigner, \ List as _ListSigners from azure.cli.core.aaz import has_value from azure.cli.core.azclierror import ArgumentUsageError @@ -184,7 +184,7 @@ def pre_operations(self): signer = f.read() if signer: - if type(signer) == bytes: + if isinstance(signer, bytes): args.signer = str(signer, encoding="utf-8") else: args.signer = signer @@ -246,7 +246,7 @@ def pre_operations(self): signer = f.read() if signer: - if type(signer) == bytes: + if isinstance(signer, bytes): args.signer = str(signer, encoding="utf-8") else: args.signer = signer @@ -398,7 +398,8 @@ def pre_operations(self): validate_provider_resource_id(self) if has_value(args.new_attestation_policy_file) and has_value(args.new_attestation_policy): - raise ArgumentUsageError('Please specify just one of --new-attestation-policy and --new-attestation-policy-file/-f') + raise ArgumentUsageError( + 'Please specify just one of --new-attestation-policy and --new-attestation-policy-file/-f') if not has_value(args.new_attestation_policy_file) and not has_value(args.new_attestation_policy): raise ArgumentUsageError('Please specify --new-attestation-policy or --new-attestation-policy-file/-f') @@ -434,17 +435,19 @@ def pre_operations(self): ) except TypeError as e: print(e) - raise ArgumentUsageError('Failed to encode text content, are you using JWT? If yes, please use --policy-format JWT') + raise ArgumentUsageError( + 'Failed to encode text content, are you using JWT? If yes, please use --policy-format JWT') if new_attestation_policy: - if type(new_attestation_policy) == bytes: + if isinstance(new_attestation_policy, bytes): args.new_attestation_policy = str(new_attestation_policy, encoding="utf-8") else: args.new_attestation_policy = new_attestation_policy def _output(self, *args, **kwargs): args = self.ctx.args - show_args = {"resource_group": args.resource_group, "name": args.name, "attestation_type": args.attestation_type} + show_args = {"resource_group": args.resource_group, "name": args.name, + "attestation_type": args.attestation_type} return GetPolicy(cli_ctx=self.cli_ctx)(command_args=show_args) @@ -490,7 +493,8 @@ def pre_operations(self): def _output(self, *args, **kwargs): args = self.ctx.args - show_args = {"resource_group": args.resource_group, "name": args.name, "attestation_type": args.attestation_type} + show_args = {"resource_group": args.resource_group, "name": args.name, + "attestation_type": args.attestation_type} return GetPolicy(cli_ctx=self.cli_ctx)(command_args=show_args) From 4424c79b5556d18bbb7aa68ede45416b972d2f79 Mon Sep 17 00:00:00 2001 From: necusjz Date: Wed, 18 Mar 2026 12:19:24 +1100 Subject: [PATCH 3/3] style: fix linter --- src/attestation/azext_attestation/__init__.py | 2 +- src/attestation/azext_attestation/_params.py | 2 +- src/attestation/azext_attestation/action.py | 2 +- src/attestation/azext_attestation/commands.py | 2 +- src/attestation/azext_attestation/custom.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/attestation/azext_attestation/__init__.py b/src/attestation/azext_attestation/__init__.py index 5f42ce3febb..1bc83447f88 100644 --- a/src/attestation/azext_attestation/__init__.py +++ b/src/attestation/azext_attestation/__init__.py @@ -10,7 +10,7 @@ from azure.cli.core import AzCommandsLoader try: - from azext_attestation._help import helps # pylint: disable=reimported + from azext_attestation._help import helps # pylint: disable=unused-import except ImportError: pass diff --git a/src/attestation/azext_attestation/_params.py b/src/attestation/azext_attestation/_params.py index a02eda0ef71..4727f8013e0 100644 --- a/src/attestation/azext_attestation/_params.py +++ b/src/attestation/azext_attestation/_params.py @@ -11,5 +11,5 @@ # pylint: disable=too-many-statements -def load_arguments(self, _): +def load_arguments(self, _): # pylint: disable=unused-argument pass diff --git a/src/attestation/azext_attestation/action.py b/src/attestation/azext_attestation/action.py index d95d53bf711..5f6e1052e30 100644 --- a/src/attestation/azext_attestation/action.py +++ b/src/attestation/azext_attestation/action.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: disable=wildcard-import +# pylint: disable=wildcard-import, import-error # pylint: disable=unused-wildcard-import from .generated.action import * # noqa: F403 diff --git a/src/attestation/azext_attestation/commands.py b/src/attestation/azext_attestation/commands.py index 296e8cfba81..7da5052f759 100644 --- a/src/attestation/azext_attestation/commands.py +++ b/src/attestation/azext_attestation/commands.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: disable=too-many-statements +# pylint: disable=too-many-statements, unused-import # pylint: disable=too-many-locals from azure.cli.core.commands import CliCommandType diff --git a/src/attestation/azext_attestation/custom.py b/src/attestation/azext_attestation/custom.py index 6d9cd771c32..28a696f9233 100644 --- a/src/attestation/azext_attestation/custom.py +++ b/src/attestation/azext_attestation/custom.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines, line-too-long, protected-access import base64 import jwt @@ -254,7 +254,7 @@ def pre_operations(self): def _output(self, *args, **kwargs): args = self.ctx.args list_args = {"resource_group": args.resource_group, "provider_name": args.provider_name} - from azext_attestation.aaz.latest.attestation.signer import List + from azext_attestation.aaz.latest.attestation.signer import List # pylint: disable=reimported token = List(cli_ctx=self.cli_ctx)(command_args=list_args)['token'] result = {'Jwt': token} if has_value(token): @@ -417,7 +417,7 @@ def pre_operations(self): new_attestation_policy = f.read() show_args = {"resource_group": args.resource_group, "provider_name": args.provider_name} - from azext_attestation.aaz.latest.attestation import Show + from azext_attestation.aaz.latest.attestation import Show # pylint: disable=reimported provider = Show(cli_ctx=self.cli_ctx)(command_args=show_args) if args.policy_format == 'Text':