feat/Update_Controllers_to_Allow_for_Premium_Membership
This commit is contained in:
@@ -42,7 +42,7 @@ The sidecar published port 8001 to the host and had **no authentication of any k
|
||||
|
||||
Two layers, both required:
|
||||
|
||||
1. **Network** — host port mapping removed; `expose: "8001"` only. The backend reaches it in-network at `http://ai-service:8001`. A comment tells the next person to use `docker-compose.override.yml` for local debugging rather than re-adding `ports:`.
|
||||
1. **Network** — host port mapping removed; `expose: "8001"` only. The backend reaches it in-network at `http://ai-service:8001`. Local published ports now live only in the explicitly selected `docker-compose.dev.yml`.
|
||||
2. **Shared secret** — `X-Ai-Service-Token` required on every endpoint except `/health` (which the backend probe and the compose healthcheck both need, and which exposes no data or generation path). Compared with `hmac.compare_digest` to avoid a timing leak.
|
||||
|
||||
**Where the enforcement lives matters.** The token is unset → open, so local dev and the existing test suite keep working keyless. Production cannot reach that state: `docker-compose.yml` declares `AI_SERVICE_TOKEN=${AI_SERVICE_TOKEN:?...}`, so **the stack refuses to start without it**. Misconfiguration fails loudly at deploy rather than silently booting open at runtime. Verified: `docker compose config` with no token exits non-zero.
|
||||
|
||||
Reference in New Issue
Block a user