From da4214ad61295ebd5d0179631da315b1bb5e7c33 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Tue, 14 Nov 2023 14:18:12 +0100 Subject: [PATCH 1/3] feat: add OAuth authentication Issue GH-2292 --- bookwyrm/settings.py | 1 + bookwyrm/urls.py | 1 + requirements.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 4cecc4df6..dcc6107e5 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -99,6 +99,7 @@ INSTALLED_APPS = [ "django.contrib.messages", "django.contrib.staticfiles", "django.contrib.humanize", + "oauth2_provider", "sass_processor", "bookwyrm", "celery", diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index 8541f4fb6..3f9f07b21 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -785,6 +785,7 @@ urlpatterns = [ r"^summary_revoke_key/?$", views.summary_revoke_key, name="summary-revoke-key" ), path("guided-tour/", views.toggle_guided_tour), + re_path(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # Serves /static when DEBUG is true. diff --git a/requirements.txt b/requirements.txt index b01e110bf..0bb4028a8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,6 +25,7 @@ boto3==1.26.57 django-storages==1.13.2 django-storages[azure] django-redis==5.2.0 +django-oauth-toolkit==2.3.0 opentelemetry-api==1.16.0 opentelemetry-exporter-otlp-proto-grpc==1.16.0 opentelemetry-instrumentation-celery==0.37b0 From e144ce19fa9021f882952b3e87c6852812400b83 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Thu, 16 Nov 2023 10:48:06 +0100 Subject: [PATCH 2/3] fix: add include import from django.urls --- bookwyrm/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index 3f9f07b21..4a292c87f 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -2,7 +2,7 @@ from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns -from django.urls import path, re_path +from django.urls import path, re_path, include from django.views.generic.base import TemplateView from bookwyrm import settings, views From b7ba6f1a3675c7b5faf2054c6f9e272147736b1b Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Thu, 30 Nov 2023 11:25:51 +0100 Subject: [PATCH 3/3] urls.py: fix style --- bookwyrm/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index 4a292c87f..711aa2d86 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -785,7 +785,7 @@ urlpatterns = [ r"^summary_revoke_key/?$", views.summary_revoke_key, name="summary-revoke-key" ), path("guided-tour/", views.toggle_guided_tour), - re_path(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')), + re_path(r"^o/", include("oauth2_provider.urls", namespace="oauth2_provider")), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # Serves /static when DEBUG is true.