Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/attestation/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/attestation/azext_attestation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/attestation/azext_attestation/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
# pylint: disable=too-many-statements


def load_arguments(self, _):
def load_arguments(self, _): # pylint: disable=unused-argument
pass
2 changes: 1 addition & 1 deletion src/attestation/azext_attestation/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/attestation/azext_attestation/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 16 additions & 12 deletions src/attestation/azext_attestation/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -246,15 +246,15 @@ 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

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):
Expand Down Expand Up @@ -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')
Expand All @@ -416,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':
Expand All @@ -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)


Expand Down Expand Up @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions src/attestation/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,7 +27,7 @@
]

DEPENDENCIES = [
'pyjwt~=2.4.0'
'pyjwt~=2.12.0'
]

try:
Expand Down
Loading