mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 01:16:10 +00:00
fix(api): schema and API docs need a login, and DRF views deny anonymous by default
This commit is contained in:
parent
f889861e18
commit
841c412f76
4 changed files with 45 additions and 12 deletions
|
|
@ -357,6 +357,10 @@ REST_FRAMEWORK = {
|
|||
"DEFAULT_AUTHENTICATION_CLASSES": [
|
||||
"rest_framework.authentication.SessionAuthentication",
|
||||
],
|
||||
# A view that forgets its own permission_classes is not public.
|
||||
"DEFAULT_PERMISSION_CLASSES": [
|
||||
"rest_framework.permissions.IsAuthenticated",
|
||||
],
|
||||
}
|
||||
|
||||
SPECTACULAR_SETTINGS = {
|
||||
|
|
@ -364,6 +368,7 @@ SPECTACULAR_SETTINGS = {
|
|||
"DESCRIPTION": "Webvirtcloud REST API",
|
||||
"VERSION": "v1",
|
||||
"SERVE_INCLUDE_SCHEMA": False,
|
||||
"SERVE_PERMISSIONS": ["rest_framework.permissions.IsAuthenticated"],
|
||||
"SWAGGER_UI_DIST": "SIDECAR",
|
||||
"SWAGGER_UI_FAVICON_HREF": "SIDECAR",
|
||||
"REDOC_DIST": "SIDECAR",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue