Skip to content

feat(auth): persist inert resource grants behind activation guard - #16

Closed
alimek wants to merge 1 commit into
feature/connection-resource-accessfrom
access/01-contracts-storage
Closed

alimek wants to merge 1 commit into
feature/connection-resource-accessfrom
access/01-contracts-storage

Conversation

@alimek

@alimek alimek commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Connection credentials cannot yet represent project and configured provider/model access. Ticket 01 adds that representation and persistence while restricted credentials stay unusable until activation.

Add version 1 resource grants with all/explicit project IDs and all/explicit configured provider instance entries, each with all/explicit canonical model IDs. Empty selections deny. Membership, intersection and subset helpers compare stable IDs without resolving catalogs. Migration 61 adds nullable resource_grant JSON, authority_revision and device_id columns to both auth tables. SQL NULL and absent legacy claims remain unrestricted; malformed explicit JSON, including JSON null, fails decoding.

ResourceGrantGuard.requireUnrestrictedResourceGrant gates pairing issuance/consumption, session issuance/replacement, and session/WebSocket verification and ticket conversion. Existing services forward pairing input to the gate. Cookie and OAuth exchange schemas reject submitted resourceGrant input instead of discarding it. Internal repository fixtures can persist restrictions for later tests; no edit API, device lifecycle, UI or active enforcement is introduced. Existing scopes/permissions responses stay compatible and advertise no resource enforcement.

Validation (all exit 0; executable node_modules/.bin/vp):

  • vp test run packages/contracts/src/auth.test.ts packages/contracts/src/authResourceAccess.test.ts packages/contracts/src/environmentHttp.test.ts apps/server/src/auth/PairingGrantStore.test.ts apps/server/src/auth/SessionStore.test.ts apps/server/src/auth/EnvironmentAuth.test.ts apps/server/src/auth/http.test.ts apps/server/src/persistence/AuthResourceGrants.test.ts — 8 files, 110 tests passed.
  • vp lint — all 16 changed TypeScript files, no warnings/errors.
  • vp run --filter @t3tools/contracts typecheck — passed.
  • vp run --filter t3 typecheck — passed (Effect suggestions only).
  • git diff --check — passed.

Base: feature/connection-resource-access. Only ticket 01; no merge or ticket 02 work. Restricted fixture links attempted before activation are consumed and rejected; restricted row decoding can reject a whole auth list. Both are fail-closed behavior. Model canonicalization, availability and resource enforcement belong to later tickets.

Closes #2.

Model: gpt-6.1-sol. Harness: Codex.

@alimek

alimek commented Oct 11, 2026

Copy link
Copy Markdown
Owner Author

Consolidated into #30 at the same accepted final source tree (b66e06e), now targeting feature/connection-resource-access. Closing this individual stack PR as superseded; its commits, review record and branch remain preserved. No feature activation or main/upstream merge. Tracking issues remain open until integration verification.

@alimek alimek closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant