Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace deprecated package with typing_extensions #337

Merged
merged 1 commit into from
Jan 8, 2024
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
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',
)
Loading