diff --git a/00-overview/postgres-migration-roadmap.md b/00-overview/postgres-migration-roadmap.md index 7675b8c..96087ec 100644 --- a/00-overview/postgres-migration-roadmap.md +++ b/00-overview/postgres-migration-roadmap.md @@ -492,8 +492,8 @@ | 2026-11-19 | Phase 7: cutover tooling | `cutover-db.sh`, `rollback-cutover.sh`, `30-runbooks/cutover-postgres.md`, systemd `EnvironmentFile` | | 2026-11-19 | Phase 7: rehearsal | Fresh `gnexus_book_cutover`: 30 documents, manifest match, 0 reconciliation differences, off-host dump, API smoke, file rollback verified; rehearsal database dropped | | 2026-11-19 | Phase 7: tests | Full suite: 78 passed, 1 known stale-freshness failure | -| 2026-11-19 | Local gnexus-auth: client | Local OAuth client `gnexus-book`, `all_active_users`, editor role, local redirect URIs, signed webhook; secrets only in `server/.env` | -| 2026-11-19 | Local gnexus-auth: end-to-end | Real login → authorize → callback → session → `/me` with `roles: ["editor"]` and `permissions: ["docs.write", "inventory.write"]`; `/mcp-keys` 200; logout verified | +| 2026-11-19 | Local gnexus-auth: client | Owner-provided local client `gnexus-book-local`, `all_active_users`, local redirect URIs, editor role assigned to the test user, signed webhook; previous test client disabled; secrets only in `server/.env` | +| 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 | @@ -521,11 +521,12 @@ untouched and remains the rollback source. - The retained cutover evidence is the migration report under `~/backup/gnexus-book/` and the off-host dump on NetTera8. -- The local gnexus-auth instance is connected and verified end to end, including a - dedicated test user, roles/permissions and a real signed webhook delivery. Credentials - live only in `server/.env` and `~/.config/gnexus-book/`, never in the repository. +- The local gnexus-auth instance is connected and verified end to end through the + owner-provided `gnexus-book-local` client, including a dedicated test user, the + `editor` role and a real signed webhook delivery. Credentials live only in + `server/.env` and `~/.config/gnexus-book/`, never in the repository. - The local client uses the permissive `all_active_users` access mode for testing. - Production must use an owner-registered client with HTTPS URLs and a narrower access - mode; role-specific publish policy is still open. + 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. - The next phase is Phase 8: operations hardening, monitoring, documentation, and decommissioning the file write path after the production cutover. diff --git a/30-runbooks/local-auth-testing.md b/30-runbooks/local-auth-testing.md index 535894e..cdf8a5e 100644 --- a/30-runbooks/local-auth-testing.md +++ b/30-runbooks/local-auth-testing.md @@ -43,17 +43,22 @@ ## Local OAuth client -- Slug: `gnexus-book`; access mode: `all_active_users`. -- Default role: `editor` with `docs.write` and `inventory.write`. +- Slug: `gnexus-book-local` (owner-provided local client); access mode: + `all_active_users`. +- Default role: `user`; the test user is explicitly assigned the `editor` client role. +- The client currently defines roles `editor`, `user`, `docs.write` and + `inventory.write`, but no client permissions. Gnexus Book mirrors the roles snapshot + and does not depend on client permissions for authorization yet. - Redirect URIs: `http://127.0.0.1:3006/auth/callback` and `http://localhost:3006/auth/callback`. - Local redirect URIs are enabled for this client. - Webhook URL: `http://127.0.0.1:3005/webhooks/gnexus-auth`; insecure HTTP and private network access are explicitly enabled for local testing. -The client is registered through the gnexus-auth admin UI (`/admin/clients`) or an -equivalent local setup procedure. Production must use an owner-registered client, -HTTPS redirect/webhook URLs, and a narrower access mode. +The earlier `gnexus-book` test client is disabled and its secrets are revoked. The +active local client is the owner-provided `gnexus-book-local`. Production must use an +owner-registered client, HTTPS redirect/webhook URLs, a narrower access mode and +properly defined permissions. ## Test user @@ -62,7 +67,8 @@ - Login: `gnexus-book-test@local.test`. - Credentials: `~/.config/gnexus-book/local-auth-test-user.txt` (`chmod 600`, outside the repository). -- Role: `editor`; permissions: `docs.write`, `inventory.write`. +- Role: `editor` on the `gnexus-book-local` client; client permissions are currently + empty, so `/me` reports `roles: ["editor"]` and `permissions: []`. No real user account is used for automated checks. @@ -87,8 +93,8 @@ - `GET /health` reports `storage: db` and `checks.db.status: ok`. - Before sign-in, `GET /me` returns `auth_enabled: true` and `user: null`. -- After sign-in, `GET /me` returns the test user with `roles: ["editor"]` and - `permissions: ["docs.write", "inventory.write"]`. +- After sign-in, `GET /me` returns the test user with `roles: ["editor"]` and the + client's current permissions (empty until permissions are defined). - Protected routes return `401` without a session. - `/mcp-keys` is available with a session. - A gnexus-auth `webhook.test` delivery reaches