test(oidc): fake-IdP harness — 19 flow tests, coverage gate to 80% (#27) #48
No reviewers
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!48
Loading…
Reference in a new issue
No description provided.
Delete branch "test/oidc-fake-idp-coverage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes the last #27 gap: OIDC authorize/callback/verify/exchanger/validator (~280 lines) covered end-to-end over real HTTP against an in-process fake OpenID Connect provider.
What
Coverage
78.7% → 82.51% Release / 81.77% Debug (746 tests); ratchet raised 78 → 80. SRS §2.3 80% exit gate satisfied.
Verification
Full suite green ×3; pre-push hook green (build + tests + coverage gate).
Closes #27
ponytail-review (§2.4 AI first-pass) — Verdict: Ship.
What this change does: adds an in-process fake OpenID Connect provider and 19 end-to-end tests for the authorize/callback/verify/link flows, plus a small config seam (Oidc provider endpoint URLs become config-overridable, defaults preserved) and a fail-closed catch-all in the token validator.
Checked: all callers of ValidateAsync (3 — all map error results to ProblemResults, so the 401 fail-closed change is safe); catch broadening (SecurityTokenException → Exception: garbage tokens previously leaked 500s — the fail-closed 401 is the fix, covered by the updated EmailAuthFlow test); metadata URL provenance (operator config only, never user input — http:// opt-in is documented in the FlexDocumentRetriever doc); fake-IdP state (codes dict lock-guarded, consumed codes removed); ratchet headroom (82.5/81.8 vs 80 floor).
Nice to have (not blocking):
catch (Exception)in ValidateAsync also swallows OperationCanceledException from an aborted request — maps to a 401 written to a disconnected client, harmless. Could filtercatch (Exception ex) when (ex is not OperationCanceledException)in a future pass.Not checked: iOS/Android clients against the renamed schemes (untouched by this PR); real Zitadel interop (Phase 2 scope).