diff --git a/00-overview/postgres-migration-roadmap.md b/00-overview/postgres-migration-roadmap.md index 96087ec..51c3797 100644 --- a/00-overview/postgres-migration-roadmap.md +++ b/00-overview/postgres-migration-roadmap.md @@ -496,6 +496,11 @@ | 2026-11-19 | Local gnexus-auth: end-to-end | Real login → authorize → callback → session → `/me` with `roles: ["editor"]` and empty client permissions; `/mcp-keys` 200; logout verified | | 2026-11-19 | Local gnexus-auth: webhook | A `webhook.test` delivery from gnexus-auth reached `POST /webhooks/gnexus-auth` with `200 OK` and was recorded in `webhook_events` | | 2026-11-19 | Local gnexus-auth: UI | Auth gate rendered in headless Chromium against the live local gnexus-auth | +| 2026-11-19 | Review fixes: OAuth | Login CSRF closed with a short-lived state cookie; `return_to` validated and used after callback | +| 2026-11-19 | Review fixes: MCP/internal | FastMCP allowed hosts configurable for nginx; `/internal/keys` denied in nginx and rate-limited before secret checks; read-only keys cannot mint keys or call `commit_changes` | +| 2026-11-19 | Review fixes: data/audit | Secret scan covers every document version; actor user IDs stored in changesets and audit; concurrent changeset apply serialized | +| 2026-11-19 | Review fixes: config/runtime | `GNEXUS_BOOK_REPO_ROOT` honored by Settings; webhook database work moved off the event loop; stale README limitation removed | +| 2026-11-19 | Review fixes: tests | Full suite: 88 passed, 1 known stale-freshness failure; file/DB parity 0 | Notes: @@ -528,5 +533,8 @@ - The local client uses the permissive `all_active_users` access mode for testing. Production must use an owner-registered client with HTTPS URLs, a narrower access mode and defined client permissions; role-specific publish policy is still open. +- A full review on 2026-11-19 found 12 issues; all are fixed. Production deployment + must set `GNEXUS_BOOK_MCP_ALLOWED_HOSTS` to include the public MCP hostname, because + FastMCP rejects unknown Host headers with `421`. - The next phase is Phase 8: operations hardening, monitoring, documentation, and decommissioning the file write path after the production cutover. diff --git a/server/README.md b/server/README.md index a41b7de..872d8f5 100644 --- a/server/README.md +++ b/server/README.md @@ -84,6 +84,7 @@ GNEXUS_BOOK_AUTH_REDIRECT_URI GNEXUS_BOOK_AUTH_WEBHOOK_SECRET GNEXUS_BOOK_AUTH_SESSION_COOKIE # default gnb_session +GNEXUS_BOOK_AUTH_STATE_COOKIE # default gnb_oauth_state GNEXUS_BOOK_AUTH_COOKIE_SECURE # default true for https redirect URIs GNEXUS_BOOK_AUTH_SESSION_TTL_SECONDS # default 604800 ``` @@ -100,8 +101,12 @@ - `POST /webhooks/gnexus-auth` and `/webhooks/gnexus-auth/` — HMAC-verified gnexus-auth events, idempotent by event id. -Sessions are stored as SHA-256 hashes in `user_sessions`. Webhook signatures follow -gnexus-auth's `t=,v1=` scheme over `.`. +Sessions are stored as SHA-256 hashes in `user_sessions`. OAuth state is bound to a +short-lived HttpOnly cookie (`GNEXUS_BOOK_AUTH_STATE_COOKIE`, default +`gnb_oauth_state`); the callback rejects a missing or mismatched state cookie. Webhook +signatures follow gnexus-auth's `t=,v1=` scheme over +`.`. The `/internal/keys` provisioning API is blocked in nginx and +rate-limited before service-secret validation. Current scope: user mirroring, sessions, `/me`, webhook handling, actor attribution, MCP key management, and key revocation on user block. Role-specific publish policy is @@ -144,6 +149,8 @@ - `GNEXUS_BOOK_REPO_ROOT=/path/to/gnexus-book` - `GNEXUS_BOOK_MCP_TRANSPORT=stdio|sse|streamable-http` - `GNEXUS_BOOK_MCP_HOST`, `GNEXUS_BOOK_MCP_PORT` +- `GNEXUS_BOOK_MCP_ALLOWED_HOSTS` — Host values accepted by FastMCP; include the public host behind nginx +- `GNEXUS_BOOK_MCP_ALLOWED_ORIGINS` — allowed Origin values for browser-based clients - `GNEXUS_BOOK_MCP_TOKEN` — optional static break-glass token, never a fallback for personal keys - `GNEXUS_BOOK_MCP_REQUEST_RATE_LIMIT` — per-key requests per minute (default 300) - `GNEXUS_BOOK_INTERNAL_KEY_SECRET`, `GNEXUS_BOOK_INTERNAL_ALLOWLIST` — provisioning API protection @@ -264,7 +271,6 @@ - Database mode publishes on apply; `POST /commit` is only available with the file backend. - Authentication is gnexus-auth SSO when configured; without client credentials the service runs open for local development. - Role-specific publish policy is not implemented yet: any authenticated, non-blocked user may write. -- The MCP keys page in the Vue UI is still pending; the API is available. - Key scopes are currently `read` and `write`; finer-grained scopes are not implemented. - File-backend `POST /commit` creates a local Git commit only. It does not push. - Commit requests must provide an explicit file list.