From 1fe7e4f9f5fd282ceea2d22d7d41bea7d05e04ca Mon Sep 17 00:00:00 2001 From: Sasha Dresden Date: Mon, 2 Dec 2024 11:22:28 -0500 Subject: [PATCH 1/3] Fix oidc callback redirect to go to login redirect as opposed to '/' which was previously redirecting to login --- django-backend/fecfiler/oidc/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-backend/fecfiler/oidc/views.py b/django-backend/fecfiler/oidc/views.py index ec3361d7a..9dd3f9df7 100644 --- a/django-backend/fecfiler/oidc/views.py +++ b/django-backend/fecfiler/oidc/views.py @@ -108,7 +108,7 @@ def oidc_callback(request): handle_oidc_callback_request(request) return HttpResponseRedirect(LOGIN_REDIRECT_URL) handle_oidc_callback_error(request) - return HttpResponseRedirect("/") + return HttpResponseRedirect(LOGIN_REDIRECT_CLIENT_URL) except Exception as error: logger.error(f"Failed to process oidc_callback request {str(error)}") return HttpResponseServerError() From 1dfcba80f29ccbc462c45d24a0ee2c6c2a62e5c5 Mon Sep 17 00:00:00 2001 From: Sasha Dresden Date: Mon, 2 Dec 2024 12:34:11 -0500 Subject: [PATCH 2/3] Readd /api/docs/ redirect --- django-backend/fecfiler/urls.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/django-backend/fecfiler/urls.py b/django-backend/fecfiler/urls.py index 177fe0106..d39078f31 100644 --- a/django-backend/fecfiler/urls.py +++ b/django-backend/fecfiler/urls.py @@ -3,7 +3,7 @@ from rest_framework.decorators import api_view, permission_classes from rest_framework.response import Response from django.views.generic.base import RedirectView -from fecfiler.settings import LOGIN_REDIRECT_CLIENT_URL, MOCK_OIDC_PROVIDER +from fecfiler.settings import MOCK_OIDC_PROVIDER from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView BASE_V1_URL = r"^api/v1/" @@ -33,8 +33,7 @@ def get_api_status(_request): re_path(BASE_V1_URL, include("fecfiler.feedback.urls")), re_path(BASE_V1_URL, include("fecfiler.oidc.urls")), re_path(BASE_V1_URL, include("fecfiler.cash_on_hand.urls")), - re_path(r"", include("fecfiler.devops.urls")), - path("", RedirectView.as_view(url=LOGIN_REDIRECT_CLIENT_URL)), + path("", RedirectView.as_view(url="/api/docs/")), re_path(BASE_V1_URL + "status/", get_api_status), ] From eae937a091f64361aa3c6bae6d2a68835cf178ef Mon Sep 17 00:00:00 2001 From: Sasha Dresden Date: Mon, 2 Dec 2024 13:02:53 -0500 Subject: [PATCH 3/3] Restore missing devops url regex path, but put after api/docs redirect to allow usage without authentication --- django-backend/fecfiler/urls.py | 1 + 1 file changed, 1 insertion(+) diff --git a/django-backend/fecfiler/urls.py b/django-backend/fecfiler/urls.py index d39078f31..f007b431d 100644 --- a/django-backend/fecfiler/urls.py +++ b/django-backend/fecfiler/urls.py @@ -34,6 +34,7 @@ def get_api_status(_request): re_path(BASE_V1_URL, include("fecfiler.oidc.urls")), re_path(BASE_V1_URL, include("fecfiler.cash_on_hand.urls")), path("", RedirectView.as_view(url="/api/docs/")), + re_path(r"", include("fecfiler.devops.urls")), re_path(BASE_V1_URL + "status/", get_api_status), ]