Bug: Swagger UI X-API-Key authorization is not sent in request headers
Description:
Swagger UI does not include the X-API-Key header in outgoing requests after setting the API key in the Authorize dialog. As a result, protected API endpoints fail authentication even though a key was provided in Swagger UI.
Steps to Reproduce:
- Run the OpenWA backend locally.
- Open Swagger at
http://localhost:2785/api/docs.
- Click Authorize and enter a valid API key for
X-API-Key.
- Execute a protected endpoint request (for example, sessions/messages endpoints).
- Check the request headers in browser DevTools (Network tab) and API response.
Expected Behavior:
Requests executed from Swagger UI should include X-API-Key: <api_key> in headers, and valid keys should pass the auth guard.
Actual Behavior:
X-API-Key is not sent in request headers from Swagger UI, and the backend responds with 401 Unauthorized.
Environment:
- Node version: 22 LTS (project target; please replace with exact local version from
node -v)
- OS: Linux (
6.17.0-29-generic)
- Docker version: Please replace with exact local version from
docker --version
Logs:
Relevant backend response/error:
401 Unauthorized
API key is required
Optional guard debug output (if enabled in local branch):
xApiKey undefined
authHeader undefined
Bug: Swagger UI X-API-Key authorization is not sent in request headers
Description:
Swagger UI does not include the
X-API-Keyheader in outgoing requests after setting the API key in the Authorize dialog. As a result, protected API endpoints fail authentication even though a key was provided in Swagger UI.Steps to Reproduce:
http://localhost:2785/api/docs.X-API-Key.Expected Behavior:
Requests executed from Swagger UI should include
X-API-Key: <api_key>in headers, and valid keys should pass the auth guard.Actual Behavior:
X-API-Keyis not sent in request headers from Swagger UI, and the backend responds with401 Unauthorized.Environment:
node -v)6.17.0-29-generic)docker --versionLogs:
Relevant backend response/error:
Optional guard debug output (if enabled in local branch):