fix(auth): keep SSO compatibility route out of OpenAPI

This commit is contained in:
Aleksandr Meshchryakov
2026-09-28 11:28:11 +02:00
parent 1aa537c9a7
commit 357ef4cdf0
3 changed files with 32 additions and 2 deletions

View File

@@ -183,3 +183,9 @@ class SsoCallbackView(APIView):
response = HttpResponse(status=303)
response["Location"] = redirect_path
return response
class SsoCallbackWithoutSlashView(SsoCallbackView):
"""Accept legacy callback URLs without duplicating the public API schema."""
swagger_schema = None

View File

@@ -11,7 +11,11 @@ from apps.core.views import (
BackgroundJobStatusView,
BackgroundJobStreamView,
)
from apps.user.sso_views import SsoCallbackView, SsoStartView
from apps.user.sso_views import (
SsoCallbackView,
SsoCallbackWithoutSlashView,
SsoStartView,
)
from django.urls import include, path
app_name = "api_v1"
@@ -24,7 +28,7 @@ jobs_urlpatterns = [
urlpatterns = [
# Accept IAS POST forms without a slash without CommonMiddleware's 301.
path("auth/sso", SsoCallbackView.as_view()),
path("auth/sso", SsoCallbackWithoutSlashView.as_view()),
path("auth/sso/", SsoCallbackView.as_view(), name="sso-callback"),
path("auth/sso/start/", SsoStartView.as_view(), name="sso-start"),
path("analytics/", include("apps.organization.analytics_root_urls")),