feat(auth): add scoped internal executor delegation - #6459
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryHigh Risk Overview
Workspace file internal routes use audience Reviewed by Cursor Bugbot for commit 6288240. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR introduces short-lived executor delegation tokens and migrates internal CSV preview authentication from legacy internal JWTs to canonically bound workflow/execution principals.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/auth/internal.ts | Adds strict issuance and verification for short-lived, subject-bearing executor delegation JWTs. |
| apps/sim/lib/auth/internal-delegation.ts | Binds verified workflow or execution claims to the canonical active workspace without trusting route workspace parameters. |
| apps/sim/lib/api/server/routes/internal-json-route.ts | Replaces legacy service-token authentication with executor delegation verification and canonical binding. |
| apps/sim/lib/workspace-files/api/route-policies.ts | Defines the workspace-files delegation audience and narrows delegated access to the requested file ID. |
| apps/sim/app/api/workspaces/[id]/files/[fileId]/csv-preview/route.ts | Migrates CSV preview to session-or-executor authentication while retaining existing operation and error policies. |
| packages/auth/src/principal.ts | Adds the typed workflow-execution context carried by executor delegated principals. |
Sequence Diagram
sequenceDiagram
participant Executor
participant Route as CSV Preview Route
participant JWT as Delegation Verification
participant Context as Workflow Context Resolver
participant Authz as Workspace Authorization
participant Files as File Preview Operation
Executor->>Route: Bearer delegation token
Route->>JWT: Verify signature and scoped claims
JWT-->>Route: Subject, workflow, optional execution
Route->>Context: Resolve active workflow/execution
Context-->>Route: Canonical workspace
Route->>Authz: Principal + file scope
Authz->>Authz: Check audience, expiry, workspace, file, current user permission
Authz->>Files: Execute CSV preview
Files-->>Executor: Preview response
Reviews (2): Last reviewed commit: "fix(auth): derive delegation lifetime fr..." | Re-trigger Greptile
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6288240. Configure here.
Summary
Type of Change
Testing
Checklist