From a static review at 1f1d555125 (no live systems probed).
inject_key (app/main.py L4522, @app.api_route("/v1/{path:path}")) is the OpenWebUI-era key-injection path. No repo on this Gitea sends X-Portal-Secret any more. LibreChat talks to the gateway directly with per-user keys, and the README's LibreChat wiring section (baseURL: https://portal.inference.coop/v1) is stale.
The route is still live, and it:
lets anyone holding PORTAL_SECRET spend as any member just by naming their email in X-User-Email;
proxies any path with any method (GET/POST/PUT/DELETE/PATCH) to LiteLLM under that member's key, not just chat completions;
forwards every inbound header upstream (headers = dict(request.headers), L4554), including X-Portal-Secret itself, so the secret can end up in gateway-side logs.
The ops docs (operator-token-runbook.md, reference/env-manifest.md) describe PORTAL_SECRET as "session signing", which understates what it can do.
Suggestion: delete the route and retire PORTAL_SECRET. If something still needs it, restrict it to POST /v1/chat/completions and forward only an allowlist of headers. Also update the README and ops docs.
Filed by Daniel Ari Friedman (member) in a personal capacity. The activeinference username is my personal co-op account, not the Active Inference Institute.
From a static review at `1f1d555125` (no live systems probed).
`inject_key` (`app/main.py` L4522, `@app.api_route("/v1/{path:path}")`) is the OpenWebUI-era key-injection path. No repo on this Gitea sends `X-Portal-Secret` any more. LibreChat talks to the gateway directly with per-user keys, and the README's LibreChat wiring section (`baseURL: https://portal.inference.coop/v1`) is stale.
The route is still live, and it:
- lets anyone holding `PORTAL_SECRET` spend as **any** member just by naming their email in `X-User-Email`;
- proxies **any path with any method** (GET/POST/PUT/DELETE/PATCH) to LiteLLM under that member's key, not just chat completions;
- forwards **every inbound header** upstream (`headers = dict(request.headers)`, L4554), including `X-Portal-Secret` itself, so the secret can end up in gateway-side logs.
The ops docs (`operator-token-runbook.md`, `reference/env-manifest.md`) describe `PORTAL_SECRET` as "session signing", which understates what it can do.
**Suggestion:** delete the route and retire `PORTAL_SECRET`. If something still needs it, restrict it to `POST /v1/chat/completions` and forward only an allowlist of headers. Also update the README and ops docs.
---
*Filed by Daniel Ari Friedman (member) in a personal capacity. The `activeinference` username is my personal co-op account, not the Active Inference Institute.*
The /v1/{path:path} key-injection route and _verify_portal_secret are deleted from app/main.py.
PORTAL_SECRET is unset from the portal env and the app restarted; the variable is gone from the container (0 matches).
Verified on the wire: GET/POST/PUT/DELETE /v1/chat/completions all return 404; /health returns 200.
README's LibreChat wiring section now says the chat talks to https://gateway.inference.coop/v1 directly; the stale portal.inference.coop/v1 + X-User-Email example is removed.
ops-docs credential inventory (operator-token-runbook.md, reference/env-manifest.md) no longer lists PORTAL_SECRET.
Nothing consumed the route: librechat.yaml points the custom endpoint at the gateway, the chat app has no KEENABLE/portal-proxy env wiring, and the portal access log had no /v1/ requests. member-portal-cancel still contains the old route but is not deployed.
One adjacent item worth a separate decision: the inventory still lists OWUI_API_KEY / OWUI_JWT_SECRET as “confirm whether still needed” — the Open WebUI integration is retired, so those look like the next credentials to drop.
Done in `5f3519d` (image `20261119-5f3519d`).
- The `/v1/{path:path}` key-injection route and `_verify_portal_secret` are deleted from `app/main.py`.
- `PORTAL_SECRET` is unset from the portal env and the app restarted; the variable is gone from the container (`0` matches).
- Verified on the wire: `GET/POST/PUT/DELETE /v1/chat/completions` all return **404**; `/health` returns 200.
- README's LibreChat wiring section now says the chat talks to `https://gateway.inference.coop/v1` directly; the stale `portal.inference.coop/v1` + `X-User-Email` example is removed.
- `ops-docs` credential inventory (`operator-token-runbook.md`, `reference/env-manifest.md`) no longer lists `PORTAL_SECRET`.
Nothing consumed the route: `librechat.yaml` points the custom endpoint at the gateway, the chat app has no `KEENABLE`/portal-proxy env wiring, and the portal access log had no `/v1/` requests. `member-portal-cancel` still contains the old route but is not deployed.
One adjacent item worth a separate decision: the inventory still lists `OWUI_API_KEY` / `OWUI_JWT_SECRET` as “confirm whether still needed” — the Open WebUI integration is retired, so those look like the next credentials to drop.
Retired and verified. The legacy /v1/* key-injection proxy and _verify_portal_secret/PORTAL_SECRET were removed; live probe: GET/POST/PUT/DELETE /v1/chat/completions all return 404, /health returns 200. Closing.
Retired and verified. The legacy `/v1/*` key-injection proxy and `_verify_portal_secret`/`PORTAL_SECRET` were removed; live probe: GET/POST/PUT/DELETE `/v1/chat/completions` all return 404, `/health` returns 200. Closing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
From a static review at
1f1d555125(no live systems probed).inject_key(app/main.pyL4522,@app.api_route("/v1/{path:path}")) is the OpenWebUI-era key-injection path. No repo on this Gitea sendsX-Portal-Secretany more. LibreChat talks to the gateway directly with per-user keys, and the README's LibreChat wiring section (baseURL: https://portal.inference.coop/v1) is stale.The route is still live, and it:
PORTAL_SECRETspend as any member just by naming their email inX-User-Email;headers = dict(request.headers), L4554), includingX-Portal-Secretitself, so the secret can end up in gateway-side logs.The ops docs (
operator-token-runbook.md,reference/env-manifest.md) describePORTAL_SECRETas "session signing", which understates what it can do.Suggestion: delete the route and retire
PORTAL_SECRET. If something still needs it, restrict it toPOST /v1/chat/completionsand forward only an allowlist of headers. Also update the README and ops docs.Filed by Daniel Ari Friedman (member) in a personal capacity. The
activeinferenceusername is my personal co-op account, not the Active Inference Institute.Done in
5f3519d(image20261119-5f3519d)./v1/{path:path}key-injection route and_verify_portal_secretare deleted fromapp/main.py.PORTAL_SECRETis unset from the portal env and the app restarted; the variable is gone from the container (0matches).GET/POST/PUT/DELETE /v1/chat/completionsall return 404;/healthreturns 200.https://gateway.inference.coop/v1directly; the staleportal.inference.coop/v1+X-User-Emailexample is removed.ops-docscredential inventory (operator-token-runbook.md,reference/env-manifest.md) no longer listsPORTAL_SECRET.Nothing consumed the route:
librechat.yamlpoints the custom endpoint at the gateway, the chat app has noKEENABLE/portal-proxy env wiring, and the portal access log had no/v1/requests.member-portal-cancelstill contains the old route but is not deployed.One adjacent item worth a separate decision: the inventory still lists
OWUI_API_KEY/OWUI_JWT_SECRETas “confirm whether still needed” — the Open WebUI integration is retired, so those look like the next credentials to drop.Retired and verified. The legacy
/v1/*key-injection proxy and_verify_portal_secret/PORTAL_SECRETwere removed; live probe: GET/POST/PUT/DELETE/v1/chat/completionsall return 404,/healthreturns 200. Closing.