refactor(api): park provider grants in their own table, out of auth_codes - #381
Merged
kYem merged 4 commits intoOct 4, 2026
Conversation
…odes Sign-in codes and parked Notion grants no longer share a table, so the sweeps lose their JSON provider filters and /v1/auth/token no longer imports the Notion routes. Migration 0012 moves any in-flight parked grants across.
…ploy note Documents that 0012 and its Worker must both be live before Notion is enabled.
kYem
deleted the
kes/eng-136-move-parked-notion-grants-out-of-auth_codes-into-their-own
branch
October 4, 2026 02:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes ENG-136
Parked Notion grants move from
auth_codesinto a newparked_provider_grantstable (migration 0012, which carries any in-flight rows across). Sign-in sweeps lose theirjson_extractprovider filters, and/v1/auth/tokenno longer importsroutes/notion.ts.Behaviour change: a Notion code sent to
/v1/auth/tokenis now just unknown (401). It is no longer burned and revoked, so it stays claimable at/claimbehind PKCE, or the cron revokes it on expiry. A sign-in code sent to/claimis likewise refused without being burned.Deploy: apply 0012 remotely before deploying the Worker. Between the two, the old Worker could still park a grant in
auth_codes, which the new one would then sweep without revoking. That can't happen today, since prod has noNOTION_CLIENT_IDand cannot start a Notion connect.Migration checked against a seeded local D1: the parked row moves with every field, and the sign-in code stays.