F2 — operator_oauth_tokens table + active-forge router #481
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#481
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?
As a maintainer, I want OAuth state and active-forge selection to live in the database, so that sessions, watched repos, and adapters all read from one place.
Acceptance criteria
operator_oauth_tokensschema added todb.tswithforge_type(PK),access_token,refresh_token,expires_at,scopes,account_login,account_id,base_url,created_at,updated_at.getOperatorOAuth(forge),upsertOperatorOAuth(row),deleteOperatorOAuth(forge).service_settingsgainsactive_forge_typekey (TEXT, nullable). HelpersgetActiveForge(),setActiveForge(forge),clearActiveForge().setActiveForge()is called atomically in one transaction.getOperatorAdapter()returns aForgePortbound to the active forge's OAuth token, or throwsNoActiveForgeError. The error maps to a 412 Precondition Failed at the HTTP layer.OAUTH_ENCRYPTION_KEY. Boot fails if the key is missing or shorter than 32 bytes.GET /mereturns{ forge_type, account_login, base_url, since }for the active forge, or 401 if no session.active_forge_typeand issues a fresh session cookie. Forge A's token row is NOT deleted.Out of scope
References
docs/specs/forge-auth-repo-selection.md§F2, §5, §10Dependencies