Public: anyone can read this; the crew can change it.
A test pins the origin connect flows: a state claims once, a short code reveals nothing, and only the starter sees the flow #6903
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
src/origins/oauth.ts keeps OAuth connect flows.
claimFlowByState,targetForShortCode,getFlowFor,flowSecretsandpruneFlowshave no test that names them.Done:
targetForShortCodegives the same answer for an unknown code, an expired flow and an already-claimed one.getFlowForgives the flow to its starter and nothing to anyone else.pruneFlows(db, now)drops finished and expired flows with their secrets, and keeps the live one.This is a new test file only. Change code only where the test finds a hole, and say so in the pull. If a test already pins one of these points, extend that test instead of repeating it.
Files: test/origins-oauth-flows.test.ts
Before pushing:
bun x tsc --noEmitand the test you add. Tests passnowin and never read the wall clock.