Skip to content

Commit 852370c

Browse files
authored
{Attestation} Bump PyJWT (#9688)
* chore: bump PyJWT * style: fix linter * style: fix linter
1 parent 93f55ec commit 852370c

File tree

7 files changed

+26
-18
lines changed

7 files changed

+26
-18
lines changed

src/attestation/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
1.0.1
7+
++++++
8+
* Bump PyJWT from `2.4.0` to `2.12.0`.
9+
610
1.0.0
711
++++++
812
* `az attestation `: Remove sdk

src/attestation/azext_attestation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from azure.cli.core import AzCommandsLoader
1212
try:
13-
from azext_attestation._help import helps # pylint: disable=reimported
13+
from azext_attestation._help import helps # pylint: disable=unused-import
1414
except ImportError:
1515
pass
1616

src/attestation/azext_attestation/_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
# pylint: disable=too-many-statements
1212

1313

14-
def load_arguments(self, _):
14+
def load_arguments(self, _): # pylint: disable=unused-argument
1515
pass

src/attestation/azext_attestation/action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Changes may cause incorrect behavior and will be lost if the code is
88
# regenerated.
99
# --------------------------------------------------------------------------
10-
# pylint: disable=wildcard-import
10+
# pylint: disable=wildcard-import, import-error
1111
# pylint: disable=unused-wildcard-import
1212

1313
from .generated.action import * # noqa: F403

src/attestation/azext_attestation/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Changes may cause incorrect behavior and will be lost if the code is
88
# regenerated.
99
# --------------------------------------------------------------------------
10-
# pylint: disable=too-many-statements
10+
# pylint: disable=too-many-statements, unused-import
1111
# pylint: disable=too-many-locals
1212

1313
from azure.cli.core.commands import CliCommandType

src/attestation/azext_attestation/custom.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Changes may cause incorrect behavior and will be lost if the code is
88
# regenerated.
99
# --------------------------------------------------------------------------
10-
# pylint: disable=too-many-lines
10+
# pylint: disable=too-many-lines, line-too-long, protected-access
1111

1212
import base64
1313
import jwt
@@ -18,10 +18,10 @@
1818
from cryptography.hazmat.primitives.serialization import Encoding
1919
from cryptography.x509 import load_pem_x509_certificate
2020

21-
from azext_attestation.aaz.latest.attestation import Create as _AttestationCreate, Delete as _AttestationDelete,\
21+
from azext_attestation.aaz.latest.attestation import Create as _AttestationCreate, Delete as _AttestationDelete, \
2222
Show as _AttestationShow, GetDefaultByLocation as _AttestationGetDefaultByLocation
2323
from azext_attestation.aaz.latest.attestation.policy import Reset as _ResetPolicy, Set as _SetPolicy, Show as _GetPolicy
24-
from azext_attestation.aaz.latest.attestation.signer import Add as _AddSigner, Remove as _RemoveSigner,\
24+
from azext_attestation.aaz.latest.attestation.signer import Add as _AddSigner, Remove as _RemoveSigner, \
2525
List as _ListSigners
2626
from azure.cli.core.aaz import has_value
2727
from azure.cli.core.azclierror import ArgumentUsageError
@@ -184,7 +184,7 @@ def pre_operations(self):
184184
signer = f.read()
185185

186186
if signer:
187-
if type(signer) == bytes:
187+
if isinstance(signer, bytes):
188188
args.signer = str(signer, encoding="utf-8")
189189
else:
190190
args.signer = signer
@@ -246,15 +246,15 @@ def pre_operations(self):
246246
signer = f.read()
247247

248248
if signer:
249-
if type(signer) == bytes:
249+
if isinstance(signer, bytes):
250250
args.signer = str(signer, encoding="utf-8")
251251
else:
252252
args.signer = signer
253253

254254
def _output(self, *args, **kwargs):
255255
args = self.ctx.args
256256
list_args = {"resource_group": args.resource_group, "provider_name": args.provider_name}
257-
from azext_attestation.aaz.latest.attestation.signer import List
257+
from azext_attestation.aaz.latest.attestation.signer import List # pylint: disable=reimported
258258
token = List(cli_ctx=self.cli_ctx)(command_args=list_args)['token']
259259
result = {'Jwt': token}
260260
if has_value(token):
@@ -398,7 +398,8 @@ def pre_operations(self):
398398
validate_provider_resource_id(self)
399399

400400
if has_value(args.new_attestation_policy_file) and has_value(args.new_attestation_policy):
401-
raise ArgumentUsageError('Please specify just one of --new-attestation-policy and --new-attestation-policy-file/-f')
401+
raise ArgumentUsageError(
402+
'Please specify just one of --new-attestation-policy and --new-attestation-policy-file/-f')
402403

403404
if not has_value(args.new_attestation_policy_file) and not has_value(args.new_attestation_policy):
404405
raise ArgumentUsageError('Please specify --new-attestation-policy or --new-attestation-policy-file/-f')
@@ -416,7 +417,7 @@ def pre_operations(self):
416417
new_attestation_policy = f.read()
417418

418419
show_args = {"resource_group": args.resource_group, "provider_name": args.provider_name}
419-
from azext_attestation.aaz.latest.attestation import Show
420+
from azext_attestation.aaz.latest.attestation import Show # pylint: disable=reimported
420421
provider = Show(cli_ctx=self.cli_ctx)(command_args=show_args)
421422

422423
if args.policy_format == 'Text':
@@ -434,17 +435,19 @@ def pre_operations(self):
434435
)
435436
except TypeError as e:
436437
print(e)
437-
raise ArgumentUsageError('Failed to encode text content, are you using JWT? If yes, please use --policy-format JWT')
438+
raise ArgumentUsageError(
439+
'Failed to encode text content, are you using JWT? If yes, please use --policy-format JWT')
438440

439441
if new_attestation_policy:
440-
if type(new_attestation_policy) == bytes:
442+
if isinstance(new_attestation_policy, bytes):
441443
args.new_attestation_policy = str(new_attestation_policy, encoding="utf-8")
442444
else:
443445
args.new_attestation_policy = new_attestation_policy
444446

445447
def _output(self, *args, **kwargs):
446448
args = self.ctx.args
447-
show_args = {"resource_group": args.resource_group, "name": args.name, "attestation_type": args.attestation_type}
449+
show_args = {"resource_group": args.resource_group, "name": args.name,
450+
"attestation_type": args.attestation_type}
448451
return GetPolicy(cli_ctx=self.cli_ctx)(command_args=show_args)
449452

450453

@@ -490,7 +493,8 @@ def pre_operations(self):
490493

491494
def _output(self, *args, **kwargs):
492495
args = self.ctx.args
493-
show_args = {"resource_group": args.resource_group, "name": args.name, "attestation_type": args.attestation_type}
496+
show_args = {"resource_group": args.resource_group, "name": args.name,
497+
"attestation_type": args.attestation_type}
494498
return GetPolicy(cli_ctx=self.cli_ctx)(command_args=show_args)
495499

496500

src/attestation/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from setuptools import setup, find_packages
1111

1212
# HISTORY.rst entry.
13-
VERSION = '1.0.0'
13+
VERSION = '1.0.1'
1414

1515
# The full list of classifiers is available at
1616
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
@@ -27,7 +27,7 @@
2727
]
2828

2929
DEPENDENCIES = [
30-
'pyjwt~=2.4.0'
30+
'pyjwt~=2.12.0'
3131
]
3232

3333
try:

0 commit comments

Comments
 (0)