From 74dda02516488ea91519bc997b6a847b62a6967a Mon Sep 17 00:00:00 2001 From: Conor Holden Date: Fri, 27 Sep 2024 11:34:50 +0200 Subject: [PATCH] :wrench:[maykinmedia/open-api-framework#68] fix CSP errors --- requirements/base.txt | 11 ++++++++--- requirements/ci.txt | 10 ++++++++-- requirements/dev.txt | 10 ++++++++-- src/objects/conf/api.py | 3 +++ 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 1b36d072..fca3e8d3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -97,6 +97,7 @@ django==4.2.15 # djangorestframework-inclusions # drf-nested-routers # drf-spectacular + # drf-spectacular-sidecar # drf-yasg # maykin-2fa # mozilla-django-oidc @@ -177,8 +178,12 @@ djangorestframework-inclusions==1.2.0 # via open-api-framework drf-nested-routers==0.93.3 # via commonground-api-common -drf-spectacular==0.27.2 - # via open-api-framework +drf-spectacular[sidecar]==0.27.2 + # via + # drf-spectacular + # open-api-framework +drf-spectacular-sidecar==2024.7.1 + # via drf-spectacular drf-yasg==1.21.7 # via commonground-api-common ecs-logging==2.1.0 @@ -238,7 +243,7 @@ notifications-api-common==0.2.2 # via # -r requirements/base.in # commonground-api-common -open-api-framework==0.8.0 +open-api-framework==0.8.1 # via -r requirements/base.in orderedmultidict==1.0.1 # via furl diff --git a/requirements/ci.txt b/requirements/ci.txt index 461167ee..60bcebb4 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -139,6 +139,7 @@ django==4.2.15 # djangorestframework-inclusions # drf-nested-routers # drf-spectacular + # drf-spectacular-sidecar # drf-yasg # maykin-2fa # mozilla-django-oidc @@ -271,10 +272,15 @@ drf-nested-routers==0.93.3 # via # -r requirements/base.txt # commonground-api-common -drf-spectacular==0.27.2 +drf-spectacular[sidecar]==0.27.2 # via # -r requirements/base.txt + # drf-spectacular # open-api-framework +drf-spectacular-sidecar==2024.7.1 + # via + # -r requirements/base.txt + # drf-spectacular drf-yasg==1.21.7 # via # -r requirements/base.txt @@ -381,7 +387,7 @@ notifications-api-common==0.2.2 # via # -r requirements/base.txt # commonground-api-common -open-api-framework==0.8.0 +open-api-framework==0.8.1 # via -r requirements/base.txt orderedmultidict==1.0.1 # via diff --git a/requirements/dev.txt b/requirements/dev.txt index 9e0a12f1..9e7bf619 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -161,6 +161,7 @@ django==4.2.15 # djangorestframework-inclusions # drf-nested-routers # drf-spectacular + # drf-spectacular-sidecar # drf-yasg # maykin-2fa # mozilla-django-oidc @@ -303,10 +304,15 @@ drf-nested-routers==0.93.3 # via # -r requirements/ci.txt # commonground-api-common -drf-spectacular==0.27.2 +drf-spectacular[sidecar]==0.27.2 # via # -r requirements/ci.txt + # drf-spectacular # open-api-framework +drf-spectacular-sidecar==2024.7.1 + # via + # -r requirements/ci.txt + # drf-spectacular drf-yasg==1.21.7 # via # -r requirements/ci.txt @@ -430,7 +436,7 @@ notifications-api-common==0.2.2 # via # -r requirements/ci.txt # commonground-api-common -open-api-framework==0.8.0 +open-api-framework==0.8.1 # via -r requirements/ci.txt orderedmultidict==1.0.1 # via diff --git a/src/objects/conf/api.py b/src/objects/conf/api.py index c8b72a93..d5e9db77 100644 --- a/src/objects/conf/api.py +++ b/src/objects/conf/api.py @@ -87,6 +87,9 @@ """ SPECTACULAR_SETTINGS = { + "SWAGGER_UI_DIST": "SIDECAR", + "SWAGGER_UI_FAVICON_HREF": "SIDECAR", + "REDOC_DIST": "SIDECAR", "SCHEMA_PATH_PREFIX": r"/api/v[1-9]+", "SCHEMA_PATH_PREFIX_TRIM": True, "TITLE": "Objects API",