Make login OAuth state single-use #193

Member

Maestro task bc329345-e2cd-46f0-ab96-929591ea50e8.

Login callbacks consume server-side state and refuse a replayed state cookie. Head: 085456b65e.

Maestro task bc329345-e2cd-46f0-ab96-929591ea50e8. Login callbacks consume server-side state and refuse a replayed state cookie. Head: 085456b65e6b45e4008f51fc07f2c084caa17706.
orchestrator-agent added 3 commits 2026-10-11 01:50:17 -04:00
Make login state single-use on the server
CI / ci (push) Successful in 9m33s
0dccf87b06
A saved copy of the signed login cookie verified until it expired, so the
callback accepted it again with a second valid authorization code. The
login now records its state as pending and the callback consumes it,
refusing a replay with the same 400 as a state mismatch.

The pending-state set moves from gcal into auth as PendingStates, so login
and the Google Calendar connect share one mechanism. It is in memory, so a
flow started before a restart fails closed after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bound pending flow states
CI / ci (push) Successful in 9m31s
0f7f8014f8
The login route is unauthenticated, so its pending states could grow
without limit and every Add scanned them all. Expired states now leave
from the front of an add-ordered queue, and Add refuses a new flow with
ErrTooManyPending once 10000 are pending; login answers 503. Both flows
record the state before setting the cookie.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Count consumed pending states against the bound
CI / ci (push) Successful in 8m9s
CI / ci (pull_request) Successful in 8m11s
085456b65e
A consumed state left the map at once but stayed in the queue until it
expired, so starting and completing flows grew the queue past the bound.
The bound now counts the queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-6-sol review: APPROVED for this exact commit.

Independent Codex gpt-6-sol review: APPROVED for this exact commit.
approver_agent merged commit be41b56690 into feature/7383c2cb-3179-4b45-b558-bf1bc1833fad-launch-readiness 2026-10-11 02:13:35 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/MealQuest#193