Skip to content

docs(plans): §10 per-person Connections (piece 6) — credential intake proposal, HOLD for Sam's read - #1676

Merged
lilyshen0722 merged 4 commits into
mainfrom
wren/piece6-credential-intake-proposal
Sep 12, 2026
Merged

lilyshen0722 merged 4 commits into
mainfrom
wren/piece6-credential-intake-proposal

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

HOLD for Sam's read. Docs-only. Nothing in it is scheduled or sized until Sam rules; do not merge on Vera's clearance alone.

Adds §10 to docs/plans/tools-catalogue-room-grants.md: the piece-6 proposal Sam asked for in 67645 (how members feed in credentials), with Vera's four constraints from 67647 folded in where they bite. Cross-links from the §1 table, the §8 kernel table and the §9 owner bullet; no existing section changes meaning.

What §10 says

  • Record (10.1): a per-person Connection is an Integration row at scope: 'user', type: 'github-user', owned by createdBy, pinned to one repo like the App row. No new model; the mint owner check, the broker's resolveConnection and the catalogue's connections[] extend by type.
  • Intake (10.2): GitHub App user authorization (OAuth) first, the admin's App install for org-wide scope (the slice, unchanged), a pasted fine-grained token as the fallback. A pasted token is checked with the provider at intake: whose it is, whether it reaches the chosen repo, what it can do, when it expires; the repo permissions object is recorded as scopes. The login OAuth app is not reused.
  • Storage (10.3): connectorSecrets by reference (credentialRef, refreshTokenRef), both added to INTEGRATION_SECRET_CONFIG_KEYS; credentialHint is the only trace. Decrypted only in the broker's credentialFor(connection), which returns the same { token, expiresAt } shape as the App token.
  • Grant (10.4): the RoomGrant record is unchanged. grantedBy is the Connection's owner (existing rule). The person's repo role is a ceiling at mint (400 insufficient_credential_scope), not a promise: for a pasted token the first refused write is the real check (provider_denied on the trail). The grant's expiry is capped at the credential's — the refresh token's for OAuth.
  • Removal (10.5): DELETE /api/integrations/:id becomes grants → row → provider (needs the token, so before the material) → material → delete, the row kept until the last two succeed, via a new RoomGrant.revokeByConnection that cascades every root grant on the row; applies to the App row too, which today leaves grants live on the page.
  • Open (10.6): granter leaves the room; a non-expiring token; Gmail's place. Each with a recommendation.

Second commit takes Vera's three GitHub corrections (67894–67896): revoke order, a refreshGeneration fence for single-use refresh tokens, and repo permissions read as the person's role rather than the token's grant.

Named tests proposed: removing a Connection revokes every grant on it, the provider revoke runs before the material is gone, a failed provider revoke leaves the row and its references for a retry, a removed Connection's secret is gone by reference; never returns the credential and no integration response carries a credential extend to the new row type.

🤖 Generated with Claude Code

lilyshen0722 and others added 4 commits September 11, 2026 15:14
… proposal, HOLD for Sam's read

Sam's 67645 asked for a short proposal covering the intake paths, where each
credential lives, and how a grant scopes it to a room or a seat; Vera's 67647
gave four security constraints. §10 folds them in: an Integration row at
scope 'user' as the Connection (no new model), OAuth via the GitHub App's user
authorization first and a checked fine-grained token as the fallback,
connectorSecrets by reference with the broker as the only decrypt path, the
unchanged RoomGrant record with a scope check and an expiry cap at mint, and
Connection removal as grants → row → material → provider → delete.

Cross-links added from the §1 table, the §8 kernel table and the §9 owner
bullet. Nothing is scheduled or sized until Sam reads it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Removal order: the provider revoke reads the access token, so it runs
before the material is revoked and the row stays until both succeed.
Refresh: GitHub refresh tokens are single-use, so credentialFor refreshes
behind a refreshGeneration fence; losers re-read and never set error.
Scopes: GET /repos permissions is the person's role, not the token's
grant, so it is a ceiling at mint and the first refused write is the real
check; an OAuth Connection's expiry is the refresh token's six months.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…al refreshes before the provider revoke (Vera 67900/67904)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant