The OIDC login bypasses the hook's injected fetch — the seam exists but is not in the path #57
Labels
No labels
area/auth
area/backend
area/ci
area/deploy
area/e2e
area/frontend
area/shared
blocked
good-first-issue
needs-info
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
celilo/lunacycle#57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found while doing #53. Written up rather than fixed: it is the same defect class as #54, and opening a third PR on this file family while #54 is still unmerged would undo the conflict-free position #53/#54 currently hold. Not to be started until #54 is decided.
Two findings. The second is the one that matters.
1.
authentik-token.tshas #54'spreconnectdefectscripts/smoke/authentik-token.ts:42:Identical to the
ApiSmokeOptions.fetchImpldefect #54 fixes inapi-smoke.ts:typeof fetchcarriespreconnect, and the injectable fetchers this seam exists for do not have it. celilo's own type says so:This one was not among #52's 18 errors purely because nothing currently passes a
Fetcherto it — which is finding 2.2.
mintSmokeTokennever passes the injected fetch downcelilo/scripts/health-check.ts. The hook receivesfetch: Fetcherfrom celilo and threads it into the reachability check, the page-render checks, and the API smoke check. It does not thread it into the token mint:mintAccessTokenthen falls back toopts.fetchImpl ?? fetch— the global. So the entire OIDC authorization-code + PKCE login (roughly six requests: the auth redirect, the flow-executor hops, the token endpoint) runs outside the injected fetcher.This is not a style point. The seam exists specifically so HTTP done by a hook can be observed and controlled, and the one flow that authenticates against production is the flow that is not in it. Concretely:
mintTokeninstead, which is the right seam for testing the gating but leaves the real OIDC request sequence — the part that breaks when a redirect URI or a flow slug changes — with no way to be driven bycreateMockFetcher.lunacycleHealthCheck, three on the injected fetcher and one not, with nothing marking the difference.This is the same shape as the drift #52 found: a seam that is declared and not wired, which no gate can see because nothing checks that a dependency is actually reaching its consumer.
Fix, when #54 is settled
MintAccessTokenOptions.fetchImplto the call signature the function actually uses, exactly as #54 does forApiSmokeOptions— the two should land the same way rather than diverge.fetchintomintSmokeTokenand on intomintAccessToken.mintAccessTokenthroughcreateMockFetcherand asserts the request sequence: the authorize redirect, the flow-executor POSTs, and the token exchange. That is the part with no coverage today — #53 covers the gating around it, not the flow itself.Ordering matters: step 1 before step 2, or passing a
Fetcherin is a type error under #54's new gate.