From 943ec0b64b398f7b8c472842c1fd8e9985795c42 Mon Sep 17 00:00:00 2001 From: Erik Hetland Date: Fri, 29 Jun 2018 22:01:01 +0200 Subject: [PATCH] Adding Swagger settings to describe API authentication correctly. Fixes #1826 --- netbox/netbox/settings.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 8cb98f268..81ef511f9 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -268,7 +268,14 @@ SWAGGER_SETTINGS = { 'utilities.custom_inspectors.NullablePaginatorInspector', 'drf_yasg.inspectors.DjangoRestResponsePagination', 'drf_yasg.inspectors.CoreAPICompatInspector', - ] + ], + 'SECURITY_DEFINITIONS': { + 'Bearer': { + 'type': 'apiKey', + 'name': 'Authorization', + 'in': 'header', + } + } }