From 20141ac615349243dd858c3a9f7562242e049790 Mon Sep 17 00:00:00 2001 From: Torben Schlossstein Date: Wed, 7 Feb 2024 13:04:40 +0100 Subject: [PATCH 1/2] chore: switch from jose to pyjwt --- drf_social_oauth2/__init__.py | 4 +++- pyproject.toml | 2 +- requirements.test.txt | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drf_social_oauth2/__init__.py b/drf_social_oauth2/__init__.py index 7bf2570..692333e 100644 --- a/drf_social_oauth2/__init__.py +++ b/drf_social_oauth2/__init__.py @@ -8,6 +8,8 @@ __version__ = '2.1.3' + + try: from secrets import SystemRandom except ImportError: @@ -27,7 +29,7 @@ def generate_token(request, length=30, chars=UNICODE_ASCII_CHARACTER_SET): why SystemRandom is used instead of the default random.choice method. """ from django.conf import settings - from jose import jwt + import jwt rand = SystemRandom() secret = getattr(settings, 'SECRET_KEY') diff --git a/pyproject.toml b/pyproject.toml index 40136c4..9b1b6a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ include = '\.pyi?$' skip-string-normalization = true requires = [ - 'python-jose[cryptography]>=3.2.0', + 'PyJWT>=2.8.0', 'python-secrets>=3.9.2', ] exclude = ''' diff --git a/requirements.test.txt b/requirements.test.txt index be183e7..31e9d7e 100644 --- a/requirements.test.txt +++ b/requirements.test.txt @@ -6,5 +6,5 @@ social-auth-app-django>=3.1.0 pytest-mock==3.6.1 coverage==6.2 psycopg2-binary==2.9.3 -python-jose[cryptography]>=3.3.0 model_bakery==1.11.0 +PyJWT==2.8.0 diff --git a/setup.py b/setup.py index 065d7da..67f3f9b 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ 'djangorestframework>=3.10.3', 'django-oauth-toolkit>=0.12.0', 'social-auth-app-django>=3.1.0', - 'python-jose[cryptography]>=3.3.0', + 'PyJWT>=2.8.0' ], include_package_data=True, zip_safe=False, From 0a3e23acadc8cb8ad4ec7433d0ace1dd8b84d494 Mon Sep 17 00:00:00 2001 From: Torben Schlossstein Date: Wed, 7 Feb 2024 13:10:39 +0100 Subject: [PATCH 2/2] chore: remove unnecessary empty lines --- drf_social_oauth2/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/drf_social_oauth2/__init__.py b/drf_social_oauth2/__init__.py index 692333e..6b7edad 100644 --- a/drf_social_oauth2/__init__.py +++ b/drf_social_oauth2/__init__.py @@ -8,8 +8,6 @@ __version__ = '2.1.3' - - try: from secrets import SystemRandom except ImportError: