From 1067b0f662ebc1e8ac6bc569970cef7bde38f116 Mon Sep 17 00:00:00 2001 From: MJedr Date: Tue, 7 Nov 2023 18:30:45 +0100 Subject: [PATCH] cleanup oauth --- config/settings/base.py | 5 --- config/urls.py | 3 -- poetry.lock | 91 +---------------------------------------- pyproject.toml | 2 - 4 files changed, 1 insertion(+), 100 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index 654e01a6..1b585861 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -96,8 +96,6 @@ "rest_framework.authtoken", "corsheaders", "drf_spectacular", - "oauth2_provider", - "social_django", "allauth.socialaccount.providers.orcid", ] @@ -203,8 +201,6 @@ "django.template.context_processors.tz", "django.contrib.messages.context_processors.messages", "backoffice.users.context_processors.allauth_settings", - "social_django.context_processors.backends", - "social_django.context_processors.login_redirect", ], }, } @@ -339,7 +335,6 @@ "DEFAULT_AUTHENTICATION_CLASSES": ( "rest_framework.authentication.SessionAuthentication", "rest_framework.authentication.TokenAuthentication", - "oauth2_provider.contrib.rest_framework.OAuth2Authentication", ), "DEFAULT_PERMISSION_CLASSES": ("backoffice.management.permissions.IsAdminOrCuratorUser",), "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", diff --git a/config/urls.py b/config/urls.py index 858bb165..7e9aa8ad 100644 --- a/config/urls.py +++ b/config/urls.py @@ -13,12 +13,9 @@ path("about/", TemplateView.as_view(template_name="pages/about.html"), name="about"), # Django Admin, use {% url 'admin:index' %} path(settings.ADMIN_URL, admin.site.urls), - path("oauth2/", include("oauth2_provider.urls", namespace="oauth2_provider")), - path("auth/", include("social_django.urls", namespace="social")), # User management path("users/", include("backoffice.users.urls", namespace="users")), path("accounts/", include("allauth.urls")), - # Your stuff: custom urls includes go here ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: # Static file serving when using Gunicorn + Uvicorn for local web socket development diff --git a/poetry.lock b/poetry.lock index e1a9e8b7..2d8ad425 100644 --- a/poetry.lock +++ b/poetry.lock @@ -784,23 +784,6 @@ files = [ {file = "defusedxml-0.7.1.tar.gz", hash = "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"}, ] -[[package]] -name = "deprecated" -version = "1.2.14" -description = "Python @deprecated decorator to deprecate old python classes, functions or methods." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "Deprecated-1.2.14-py2.py3-none-any.whl", hash = "sha256:6fac8b097794a90302bdbb17b9b815e732d3c4720583ff1b198499d78470466c"}, - {file = "Deprecated-1.2.14.tar.gz", hash = "sha256:e5323eb936458dccc2582dc6f9c322c852a775a27065ff2b0c4970b9d53d01b3"}, -] - -[package.dependencies] -wrapt = ">=1.10,<2" - -[package.extras] -dev = ["PyTest", "PyTest-Cov", "bump2version (<1)", "sphinx (<2)", "tox"] - [[package]] name = "dill" version = "0.3.7" @@ -1022,23 +1005,6 @@ files = [ [package.dependencies] Django = ">=3.2" -[[package]] -name = "django-oauth-toolkit" -version = "2.3.0" -description = "OAuth2 Provider for Django" -optional = false -python-versions = "*" -files = [ - {file = "django-oauth-toolkit-2.3.0.tar.gz", hash = "sha256:cf1cb1a5744672e6bd7d66b4a110a463bcef9cf5ed4f27e29682cc6a4d0df1ed"}, - {file = "django_oauth_toolkit-2.3.0-py3-none-any.whl", hash = "sha256:47dfeab97ec21496f307c2cf3468e64ca08897fa499bf3104366d32005c9111d"}, -] - -[package.dependencies] -django = ">=2.2,<4.0.0 || >4.0.0" -jwcrypto = ">=0.8.0" -oauthlib = ">=3.1.0" -requests = ">=2.13.0" - [[package]] name = "django-redis" version = "5.4.0" @@ -1770,20 +1736,6 @@ files = [ [package.dependencies] referencing = ">=0.28.0" -[[package]] -name = "jwcrypto" -version = "1.5.0" -description = "Implementation of JOSE Web standards" -optional = false -python-versions = ">= 3.6" -files = [ - {file = "jwcrypto-1.5.0.tar.gz", hash = "sha256:2c1dc51cf8e38ddf324795dfe9426dee9dd46caf47f535ccbc18781fba810b8d"}, -] - -[package.dependencies] -cryptography = ">=3.4" -deprecated = "*" - [[package]] name = "kombu" version = "5.3.2" @@ -3029,47 +2981,6 @@ files = [ {file = "sniffio-1.3.0.tar.gz", hash = "sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101"}, ] -[[package]] -name = "social-auth-app-django" -version = "5.4.0" -description = "Python Social Authentication, Django integration." -optional = false -python-versions = ">=3.8" -files = [ - {file = "social-auth-app-django-5.4.0.tar.gz", hash = "sha256:09ac02a063cb313eed5e9ef2f9ac4477c8bf5bbd685925ff3aba43f9072f1bbb"}, - {file = "social_auth_app_django-5.4.0-py3-none-any.whl", hash = "sha256:28c65b2e2092f30cdb3cf912eeaa6988b49fdf4001b29bd89e683673d700a38e"}, -] - -[package.dependencies] -Django = ">=3.2" -social-auth-core = ">=4.4.1" - -[[package]] -name = "social-auth-core" -version = "4.5.0" -description = "Python social authentication made simple." -optional = false -python-versions = ">=3.8" -files = [ - {file = "social-auth-core-4.5.0.tar.gz", hash = "sha256:3d4154f45c0bacffe54ccf4361bce7e66cf5f5cd1bb0ebb7507ad09a1b07d9d9"}, - {file = "social_auth_core-4.5.0-py3-none-any.whl", hash = "sha256:f4ae5d8e503a401f319498bcad59fd1f6c473517eeae89c22299250f63c33365"}, -] - -[package.dependencies] -cryptography = ">=1.4" -defusedxml = ">=0.5.0rc1" -oauthlib = ">=1.0.3" -PyJWT = ">=2.7.0" -python3-openid = ">=3.0.10" -requests = ">=2.9.1" -requests-oauthlib = ">=0.6.1" - -[package.extras] -all = ["cryptography (>=2.1.1)", "python3-saml (>=1.5.0)"] -allpy3 = ["cryptography (>=2.1.1)", "python3-saml (>=1.5.0)"] -azuread = ["cryptography (>=2.1.1)"] -saml = ["python3-saml (>=1.5.0)"] - [[package]] name = "sqlparse" version = "0.4.4" @@ -3664,4 +3575,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "~3.11" -content-hash = "b694852d4c48536ea9edb0685a1bbdc8975e5b34edf34d44e54a6c40d0b26bc2" +content-hash = "a90873353febf4134abe2cce91c91558a92aaa0db37a299b90a750fa9595c432" diff --git a/pyproject.toml b/pyproject.toml index 0cc3b91e..3343a767 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -141,9 +141,7 @@ sentry-sdk = "1.31.0" django-storages = {version = "1.14.2", extras = ["s3"]} django-anymail = "10.1" dj-database-url = "^2.1.0" -django-oauth-toolkit = "2.3.0" whitenoise = "^6.6.0" -social-auth-app-django = "^5.4.0" [tool.poetry.dev-dependencies] factory-boy = "3.3.0"