Skip to content

Commit

Permalink
replace deprecated package with typing_extensions
Browse files Browse the repository at this point in the history
Signed-off-by: David Diamant <david@homelend.com>
  • Loading branch information
david-homelend authored and simo5 committed Jan 8, 2024
1 parent 8ae0df6 commit 70c0782
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions jwcrypto/jwk.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.asymmetric import rsa

from deprecated import deprecated
from typing_extensions import deprecated

from jwcrypto.common import JWException
from jwcrypto.common import base64url_decode, base64url_encode
Expand Down Expand Up @@ -764,28 +764,28 @@ def is_symmetric(self):
return self.get('kty') == 'oct'

@property
@deprecated
@deprecated('')
def key_type(self):
"""The Key type"""
return self.get('kty')

@property
@deprecated
@deprecated('')
def key_id(self):
"""The Key ID.
Provided by the kid parameter if present, otherwise returns None.
"""
return self.get('kid')

@property
@deprecated
@deprecated('')
def key_curve(self):
"""The Curve Name."""
if self.get('kty') not in ['EC', 'OKP']:
raise InvalidJWKType('Not an EC or OKP key')
return self.get('crv')

@deprecated
@deprecated('')
def get_curve(self, arg):
"""Gets the Elliptic Curve associated with the key.
Expand Down
4 changes: 2 additions & 2 deletions jwcrypto/jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import time
import uuid

from deprecated import deprecated
from typing_extensions import deprecated

from jwcrypto.common import JWException, JWKeyNotFound
from jwcrypto.common import json_decode, json_encode
Expand Down Expand Up @@ -123,7 +123,7 @@ def __init__(self, message=None, exception=None):
super(JWTInvalidClaimFormat, self).__init__(msg)


@deprecated
@deprecated('')
class JWTMissingKeyID(JWException):
"""JSON Web Token is missing key id.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
data_files = [('share/doc/jwcrypto', ['LICENSE', 'README.md'])],
install_requires = [
'cryptography >= 3.4',
'deprecated',
'typing_extensions',
],
python_requires = '>= 3.6',
)

0 comments on commit 70c0782

Please sign in to comment.