From c3519d3e53bb1596d766119e3f832ba56c1f43c8 Mon Sep 17 00:00:00 2001 From: Matt Mabrey Date: Sat, 17 Oct 2026 12:39:02 -0700 Subject: [PATCH] T13.6: record the live Okta sync run and the final verification (D18) --- docs/waves/backlog.md | 11 +++++++++ docs/waves/wave-13.md | 53 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/docs/waves/backlog.md b/docs/waves/backlog.md index 5f09a27..c40ea16 100644 --- a/docs/waves/backlog.md +++ b/docs/waves/backlog.md @@ -830,3 +830,14 @@ boundary"). Do not use `localStorage` as the store of record. service off. A `.gitattributes` rule (`*.sh text eol=lf`) is a repository-wide change. - **Suggested wave or follow-up:** next housekeeping pass. Add `*.sh text eol=lf` and renormalize. + +### BL-071 - smoketest.py cannot sign in against http://localhost + +- **Found during:** T13.6 (final verification) +- **Where:** `server/smoketest.py` `seed_session_cookie()` +- **What:** the script puts the session cookie in a Python cookie jar for the domain `localhost`. The jar treats + a host without a dot as `localhost.local`, so it does not send the cookie, and every call after sign-in returns 401. + With `http://127.0.0.1:PORT` the same script passes 27 of 27. +- **Why not now:** it is a test-script quirk and not part of D18. The documented usage lines show `http://localhost:8000`. +- **Suggested wave or follow-up:** next housekeeping pass: use the domain `localhost.local` for a dotless host, + or change the usage lines to `127.0.0.1`. diff --git a/docs/waves/wave-13.md b/docs/waves/wave-13.md index c143d48..435c737 100644 --- a/docs/waves/wave-13.md +++ b/docs/waves/wave-13.md @@ -304,22 +304,22 @@ introduce a path that swallows the client's error and proceeds anyway. - [ ] all `D18` acceptance criteria in `decisions-2026-09-17.md` are met or a failure is stated with a reason -- [ ] the fail-closed behavior is verified end to end through the scheduled +- [x] the fail-closed behavior is verified end to end through the scheduled wrapper, not just the bare sync function -- [ ] smoke test and `seed_demo.py` both still pass -- [ ] full test suite passes +- [x] smoke test and `seed_demo.py` both still pass +- [x] full test suite passes (48 of 50; the two failures are the known ones, see the result note below) --- ## Wave 13 exit criteria - [ ] `AUTH_SESSION_HOURS` defaults to 2, documented -- [ ] the sync job runs on a schedule and correctly disables accounts Okta no +- [x] the sync job runs on a schedule and correctly disables accounts Okta no longer shows as active - [ ] every auto-disable is individually audited with a clearly non-human actor -- [ ] an Okta API failure of any kind changes zero accounts — verified, not +- [x] an Okta API failure of any kind changes zero accounts — verified, not assumed -- [ ] the sync never re-enables an account +- [x] the sync never re-enables an account - [ ] `D18` fully accounted for, no open acceptance criteria ## Release note (2026-10-16) @@ -422,3 +422,44 @@ line and column (position and rule only, never key text). - [x] `.env.example`, `docker-compose.yml`, `DEPLOYMENT.md` updated Result 2026-10-16: sandbox, strict fake Okta. Not yet run against the real tenant. + +## Live run and final verification (2026-10-17) + +**Live deploy.** The api container runs the build from `main` (`1a3468e`) in Portainer. It signs in with the +service-app key (`private_key_jwt`) and DPoP. The first dry run (2026-10-17 18:31) fetched 2,564 Okta users and +checked 42 active local accounts. 41 matched (so `profile.login` is the right attribute) and 1 would be disabled: +`admin`, Okta status MISSING. Matt confirmed that `admin` is a leftover account, and switched the dry run off. + +Live run log lines (api log): + +- 18:46:21 `Okta sync disabled 'admin' (Okta status: MISSING)`, then `done: 2564 Okta user(s), 42 active local account(s) checked, 1 disabled` +- 19:01:50 `done: ... 41 active local account(s) checked, 0 disabled` +- 19:16:30 `done: ... 41 active local account(s) checked, 0 disabled` + +This shows: the job runs on its schedule (every 900 seconds), it disables an account that Okta no longer lists, a +disabled account is not touched again and gets no new row, and the account count fell from 42 to 41. +The first session logs of fail-closed behavior are in the earlier runs: with a rejected token, a bad key, and an +unreadable key, the sync logged `SKIPPED, no account was changed` every time and no account changed. + +**Admin recovery.** `python -m server.manage_users list | promote | enable | disable` works from the Portainer +console of `wp_api` (no `docker compose exec` prefix). `promote` changes an existing account. It does not create one. + +**Full verification on the final tree (`1a3468e`).** + +- Test suite on Matt's PC (Edge): 50 scripts, 48 pass. The two failures are not regressions: + `token_check.py` exits 2 (it needs `--out` or `--compare`), and `generalinfo_check.py` finds an old colour literal + (`rgba(`) in `wp-creation-styles.css`. +- `server/smoketest.py`: 27 of 27 checks pass. `server/seed_demo.py`: runs clean. Both ran in the sandbox against + a throwaway SQLite database. Note: use `http://127.0.0.1:PORT`, not `http://localhost:PORT`, because Python's cookie + jar does not send a cookie set for `localhost` (logged as BL-071). +- The Okta tests (`okta_sync_check`, `_job_`, `_schedule_`, `_dry_run_`, `_oauth_`, `_dpop_`, `_ui_`) and `security_check.py` pass. + +**Still open for wave 13.** + +- `T13.1` (idle timeout) is held back from `main` until T14.1 lands. The exit criterion "`AUTH_SESSION_HOURS` defaults to 2" + is not met, and it conflicts with T13.1's own text (8 hours). Matt has not chosen. +- "Every auto-disable is individually audited with a clearly non-human actor" was not checked in the admin console + after the live run. The code writes one `AuditLog` row with actor `system:okta_sync`, and `okta_sync_job_check.py` and + `okta_sync_ui_check.py` verify it. Open the Admin Console and look for the `admin` row to confirm it. +- `D18` cannot be called fully accounted for while T13.1 is outstanding. +- `BL-069` (a cap on one run and a last-admin guard) is open.