Make the API token fully optional
The deploy job hard-failed without CRYPTO_API_TOKEN, and /api/ws (which skips Basic auth) relied on that token. Drop the requirement: the app now works with no token at all, matching the backend guard that was always a no-op when unset. When a token is configured it still protects /api and /api/ws; when it is not, /api/ws is as open as the rest of the API, which the Traefik Basic auth still guards for everything else. Adds tests for the tokenless API and WebSocket.
This commit is contained in:
1 parent
ba7a69c1ce
commit
2a88f55689
7 files changed
+46
-21
No files matched your search
+2
-2
@@ -9,8 +9,8 @@ server {
|
||||
}
|
||||
|
||||
# WebSocket feed. Kept in its own block so the upgrade headers are only set
|
||||
# here, and so the API token is injected server-side on the handshake (the
|
||||
# browser cannot set headers on a WebSocket).
|
||||
# here, and so the optional API token is injected server-side on the
|
||||
# handshake (the browser cannot set headers on a WebSocket).
|
||||
location /api/ws {
|
||||
proxy_pass http://backend:8000;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
Reference in new issue
Block a user