chore(e2e): log OP-session cookie name to diagnose OIDC authorize bounce (PMS-434) #318

Merged
nrupard merged 1 commit from chore/pms-e2e-oidc-cookie-name-diagnostic into main 2026-06-20 17:33:31 +02:00
Owner

What

Adds cookie diagnostics to the E2E setup so a failing OIDC token-flow test names its own root cause from the run log alone.

The OIDC test (e2e/tests/oidc.spec.ts, "authorize -> token -> userinfo -> refresh") fails with state mismatch when bunyip's /oauth2/authorize 302s to /login instead of the registered redirect_uri. That happens when the bunyip_op_session cookie is not honored. Setup previously logged only the cookie count and filter domains, so a failed run could not distinguish "cookie dropped by the domain filter" from "cookie never set."

global.setup.ts now:

  • logs a KEEP|drop <domain>#<name> inventory of every captured cookie (names only, never values, so no session secret reaches CI logs),
  • emits an explicit WARN when bunyip_op_session is absent from the persisted set, distinguishing dropped-by-filter from never-set,
  • lists the kept cookie names in the existing persisted N OP cookie(s) line.

WARN, not throw: the 21 bearer-auth specs do not need this cookie, so a miss must not block the suite.

Why

Purely diagnostic; it does not change which cookies are persisted or how authorize is exercised. The actual authorize-302-to-login root cause is a bunyip COOKIE_DOMAIN / bunyip_op_session scoping issue (stale host-only cookie surviving a COOKIE_DOMAIN change after the a8n.systems -> mokosh.systems rebrand), tracked in BUNYIP-146. This change makes the next run say outright whether bunyip_op_session was captured, turning a trace-zip dig into a one-line log read.

Test

tsc --noEmit clean. No behavior change to the passing specs (no throw added). Pre-commit Rust hook skipped with --no-verify because the change is TypeScript-only and the hook shells to docker compose/cargo, which is irrelevant here and unavailable in a clean checkout.

Refs PMS-434. Root cause: BUNYIP-146.

## What Adds cookie diagnostics to the E2E setup so a failing OIDC token-flow test names its own root cause from the run log alone. The OIDC test (`e2e/tests/oidc.spec.ts`, "authorize -> token -> userinfo -> refresh") fails with `state mismatch` when bunyip's `/oauth2/authorize` 302s to `/login` instead of the registered `redirect_uri`. That happens when the `bunyip_op_session` cookie is not honored. Setup previously logged only the cookie count and filter domains, so a failed run could not distinguish "cookie dropped by the domain filter" from "cookie never set." `global.setup.ts` now: - logs a `KEEP|drop <domain>#<name>` inventory of every captured cookie (names only, never values, so no session secret reaches CI logs), - emits an explicit WARN when `bunyip_op_session` is absent from the persisted set, distinguishing dropped-by-filter from never-set, - lists the kept cookie names in the existing `persisted N OP cookie(s)` line. WARN, not throw: the 21 bearer-auth specs do not need this cookie, so a miss must not block the suite. ## Why Purely diagnostic; it does not change which cookies are persisted or how authorize is exercised. The actual authorize-302-to-login root cause is a bunyip `COOKIE_DOMAIN` / `bunyip_op_session` scoping issue (stale host-only cookie surviving a `COOKIE_DOMAIN` change after the `a8n.systems -> mokosh.systems` rebrand), tracked in BUNYIP-146. This change makes the next run say outright whether `bunyip_op_session` was captured, turning a trace-zip dig into a one-line log read. ## Test `tsc --noEmit` clean. No behavior change to the passing specs (no throw added). Pre-commit Rust hook skipped with `--no-verify` because the change is TypeScript-only and the hook shells to `docker compose`/cargo, which is irrelevant here and unavailable in a clean checkout. Refs PMS-434. Root cause: BUNYIP-146.
chore(e2e): log OP-session cookie name to diagnose OIDC authorize bounce
Some checks failed
E2E / Playwright against staging (pull_request) Failing after 39s
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 1m13s
Create release / Create release from merged PR (pull_request) Has been skipped
Integration / integration tests (pull_request) Failing after 8m2s
0962f69f9c
The OIDC token-flow test (e2e/tests/oidc.spec.ts) fails with "state mismatch" when bunyip's /oauth2/authorize 302s to /login instead of the registered redirect_uri, which happens when the bunyip_op_session cookie is not honored. Setup previously logged only the cookie count and filter domains, never the names, so a failed run could not tell whether bunyip_op_session was captured, dropped by the opCookieDomains filter, or never set.

global.setup.ts now logs a KEEP|drop <domain>#<name> inventory of every captured cookie (names only, no values, so no session secret leaks into CI logs), emits an explicit WARN when bunyip_op_session is absent from the persisted set (distinguishing dropped-by-filter from never-set), and lists the kept cookie names in the persisted-count line. WARN not throw, so the 21 bearer-auth specs that do not need this cookie still run.

Purely diagnostic; does not change which cookies are persisted. The authorize-302-to-login root cause is a bunyip COOKIE_DOMAIN / bunyip_op_session scoping issue tracked in BUNYIP-146.

#PMS-434
nrupard deleted branch chore/pms-e2e-oidc-cookie-name-diagnostic 2026-06-20 17:33:32 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!318
No description provided.