Преглед изворни кода

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

Erik Hetland пре 8 година
родитељ
комит
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',
+        }
+    }
 }