mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Merge pull request #3942 from modoboa/3924-add-spectacular-settings
fix: prevent http 401 on API
This commit is contained in:
@@ -13,6 +13,7 @@ modoboa_test
|
||||
bin/instance
|
||||
.coverage
|
||||
./build/
|
||||
build/
|
||||
dist/
|
||||
modoboa/frontend_dist
|
||||
# JS stuff
|
||||
|
||||
@@ -131,6 +131,25 @@ If you need to rebuild you virtualenv, you can check this [part of the documenta
|
||||
|
||||
The section below containt specific migration steps to upgrade Modoboa instance.
|
||||
|
||||
## Version 2.7.3
|
||||
|
||||
### Required changes to `settings.py`
|
||||
|
||||
* Add new permission to Swagger/Spectacular (prevents HTTP 401 error)
|
||||
|
||||
```python
|
||||
SPECTACULAR_SETTINGS = {
|
||||
'SCHEMA_PATH_PREFIX': r'/api/v[0-9]',
|
||||
'TITLE': 'Modoboa API',
|
||||
'VERSION': None,
|
||||
'SERVE_AUTHENTICATION': [], # [!code --]
|
||||
'SERVE_AUTHENTICATION': ['rest_framework.permissions.AllowAny'], # [!code ++]
|
||||
'DEFAULT_FILTER_INSPECTORS': [
|
||||
'drf_spectacular.contrib.django_filters.DjangoFilterBackendInspector',
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
## Version 2.7.0
|
||||
|
||||
### Required changes to `settings.py`
|
||||
|
||||
@@ -254,7 +254,7 @@ SPECTACULAR_SETTINGS = {
|
||||
'SCHEMA_PATH_PREFIX': r'/api/v[0-9]',
|
||||
'TITLE': 'Modoboa API',
|
||||
'VERSION': None,
|
||||
'SERVE_AUTHENTICATION': [],
|
||||
'SERVE_AUTHENTICATION': ['rest_framework.permissions.AllowAny'],
|
||||
'DEFAULT_FILTER_INSPECTORS': [
|
||||
'drf_spectacular.contrib.django_filters.DjangoFilterBackendInspector',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user