From bea878541d244d0e02cd9f4846c17d4f32cf00fd Mon Sep 17 00:00:00 2001 From: Gregorio Iniesta Date: Tue, 3 Jun 2025 18:27:33 +0200 Subject: [PATCH 1/3] fix delete user --- gateway/main/settings.py | 6 ------ gateway/requirements.txt | 2 -- gateway/tests/api/management/test_commands.py | 2 -- 3 files changed, 10 deletions(-) diff --git a/gateway/main/settings.py b/gateway/main/settings.py index f1a7249d5..df5b824dd 100644 --- a/gateway/main/settings.py +++ b/gateway/main/settings.py @@ -72,8 +72,6 @@ "rest_framework", "rest_framework.authtoken", "rest_framework_simplejwt", - "allauth", - "allauth.socialaccount", "api", "psycopg2", "drf_yasg", @@ -197,10 +195,6 @@ }, ] -AUTHENTICATION_BACKENDS = [ - # `allauth` specific authentication methods, such as login by e-mail - "allauth.account.auth_backends.AuthenticationBackend", -] # Internationalization # https://docs.djangoproject.com/en/4.1/topics/i18n/ diff --git a/gateway/requirements.txt b/gateway/requirements.txt index 1e18af11c..e62b5a000 100644 --- a/gateway/requirements.txt +++ b/gateway/requirements.txt @@ -1,8 +1,6 @@ cryptography>=44.0.3, <45 djangorestframework>=3.15.2, <4 -django-allauth[socialaccount]>=0.61.1, <1 django-allow-cidr>=0.7.1, <1 -dj-rest-auth>=5.0.2, <6 django-csp>=3.8, <4 djangorestframework-simplejwt>=5.3.1, <6 django_prometheus>=2.3.1, <3 diff --git a/gateway/tests/api/management/test_commands.py b/gateway/tests/api/management/test_commands.py index cdbdb03aa..56fc56ea4 100644 --- a/gateway/tests/api/management/test_commands.py +++ b/gateway/tests/api/management/test_commands.py @@ -1,11 +1,9 @@ """Tests for commands.""" -from allauth.socialaccount.models import SocialApp from django.core.management import call_command from ray.dashboard.modules.job.common import JobStatus from rest_framework.test import APITestCase from unittest.mock import patch, MagicMock -from django.contrib.sites.models import Site from api.models import ComputeResource, Job from api.ray import JobHandler From 934fc714d6b6c180bfc5132ca64a32cbc1aac694 Mon Sep 17 00:00:00 2001 From: Gregorio Iniesta Date: Tue, 3 Jun 2025 18:39:15 +0200 Subject: [PATCH 2/3] delete simplejwt --- gateway/main/settings.py | 2 -- gateway/requirements.txt | 1 - 2 files changed, 3 deletions(-) diff --git a/gateway/main/settings.py b/gateway/main/settings.py index df5b824dd..d756a2da6 100644 --- a/gateway/main/settings.py +++ b/gateway/main/settings.py @@ -71,7 +71,6 @@ "django_prometheus", "rest_framework", "rest_framework.authtoken", - "rest_framework_simplejwt", "api", "psycopg2", "drf_yasg", @@ -227,7 +226,6 @@ # ============= SETTINGS_AUTH_MECHANISM = os.environ.get("SETTINGS_AUTH_MECHANISM", "default") SETTINGS_DEFAULT_AUTH_CLASSES = [ - "rest_framework_simplejwt.authentication.JWTAuthentication", "dj_rest_auth.jwt_auth.JWTCookieAuthentication", ] ALL_AUTH_CLASSES_CONFIGURATION = { diff --git a/gateway/requirements.txt b/gateway/requirements.txt index e62b5a000..324a9a66d 100644 --- a/gateway/requirements.txt +++ b/gateway/requirements.txt @@ -2,7 +2,6 @@ cryptography>=44.0.3, <45 djangorestframework>=3.15.2, <4 django-allow-cidr>=0.7.1, <1 django-csp>=3.8, <4 -djangorestframework-simplejwt>=5.3.1, <6 django_prometheus>=2.3.1, <3 ray[default]>=2.30.0, <3 Django>=4.2.20, <5 From 1dea5f7943323c11b58fca0f223b5c1879d36674 Mon Sep 17 00:00:00 2001 From: Korgan Date: Fri, 6 Jun 2025 18:27:37 +0200 Subject: [PATCH 3/3] Revert "delete simplejwt" This reverts commit 934fc714d6b6c180bfc5132ca64a32cbc1aac694. --- gateway/main/settings.py | 6 +++--- gateway/tox.ini | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gateway/main/settings.py b/gateway/main/settings.py index d756a2da6..a5341d32f 100644 --- a/gateway/main/settings.py +++ b/gateway/main/settings.py @@ -70,7 +70,6 @@ "django.contrib.sites", "django_prometheus", "rest_framework", - "rest_framework.authtoken", "api", "psycopg2", "drf_yasg", @@ -169,7 +168,7 @@ "PORT": os.environ.get("DATABASE_PORT", "5432"), }, "test": { - "ENGINE": "django_prometheus.db.backends.sqlite3", + 'ENGINE': 'django.db.backends.sqlite3', "NAME": BASE_DIR / "db.sqlite3", }, } @@ -226,7 +225,8 @@ # ============= SETTINGS_AUTH_MECHANISM = os.environ.get("SETTINGS_AUTH_MECHANISM", "default") SETTINGS_DEFAULT_AUTH_CLASSES = [ - "dj_rest_auth.jwt_auth.JWTCookieAuthentication", + 'rest_framework.authentication.SessionAuthentication', + 'rest_framework.authentication.BasicAuthentication', ] ALL_AUTH_CLASSES_CONFIGURATION = { "default": SETTINGS_DEFAULT_AUTH_CLASSES, diff --git a/gateway/tox.ini b/gateway/tox.ini index 2d6fa44b1..cac7abdb5 100644 --- a/gateway/tox.ini +++ b/gateway/tox.ini @@ -45,4 +45,10 @@ commands = skip_install = true commands = pip check - python manage.py makemigrations \ No newline at end of file + python manage.py makemigrations + +[testenv:migrate] +skip_install = true +commands = + pip check + python manage.py migrate \ No newline at end of file