Просмотр исходного кода

Adding Swagger settings to describe API authentication correctly. Fixes #1826

Erik Hetland 7 лет назад
Родитель
Сommit
943ec0b64b
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      netbox/netbox/settings.py

+ 8 - 1
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',
+        }
+    }
 }