From 57af41460fda8a413b4ce3a43e8847dbe6b5ed50 Mon Sep 17 00:00:00 2001 From: ziad hany Date: Tue, 14 Jul 2026 13:54:23 +0300 Subject: [PATCH] Add support for userAgent in swagger Remove SessionAuthentication from AUTHENTICATION_WHITELIST for swagger Signed-off-by: ziad hany --- .../templates/drf_spectacular/swagger_ui.html | 18 +++++++++++++++--- vulnerablecode/settings.py | 4 ++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/vulnerabilities/templates/drf_spectacular/swagger_ui.html b/vulnerabilities/templates/drf_spectacular/swagger_ui.html index 9f0837084..d90b38e35 100644 --- a/vulnerabilities/templates/drf_spectacular/swagger_ui.html +++ b/vulnerabilities/templates/drf_spectacular/swagger_ui.html @@ -22,12 +22,24 @@
+ {% if script_url %} {% else %} {% endif %} -{% endblock %} - +{% endblock %} \ No newline at end of file diff --git a/vulnerablecode/settings.py b/vulnerablecode/settings.py index 30aa0099b..edba092ab 100644 --- a/vulnerablecode/settings.py +++ b/vulnerablecode/settings.py @@ -319,7 +319,11 @@ "defaultModelsExpandDepth": 1, "displayRequestDuration": True, "docExpansion": "list", + "userAgent": VCIO_USER_AGENT, }, + "AUTHENTICATION_WHITELIST": [ + "rest_framework.authentication.TokenAuthentication", + ], "SORT_OPERATIONS": False, "TAGS_SORTER": False, }