fix: prevent http 401 on API

Ref #3924
This commit is contained in:
Christophe CHAUVET
2026-02-25 09:36:16 +00:00
parent 0fe2a4db08
commit e39faf426a
3 changed files with 21 additions and 1 deletions
+19
View File
@@ -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.1
### Required changes to `settings.py`
* Add new permissions to Swagger/Spectacular (prevent 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`