Uh oh!
There was an error while loading. Please reload this page.
feat(auth): centralize delegated identity policy - #6462
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryHigh Risk Overview Delegated service allowlists — Workspace operations that admit Executor HTTP auth — Adds server-only Human subject resolution — OpenAPI — File metadata GET response schema switches to Reviewed by Cursor Bugbot for commit 5c9b105. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR centralizes delegated-service authorization in workspace operation policy, introduces server-only executor delegation headers and human-subject resolution, and preserves executor access to selected workspace-file operations.
Confidence Score: 5/5The PR appears safe to merge, with delegated-service checks consistently enforced before resource loading and no concrete changed-code failure identified. The centralized authorization path preserves existing workspace permission and resource-scope checks, explicitly restricts each delegated service by operation, and the executor file-tool actions map to allowed underlying file operations.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/core/application/workspace-operation.ts | Adds typed delegated-service policies, validates policy consistency and duplicates, and freezes the resulting operation metadata. |
| apps/sim/lib/core/application/workspace-authorization.ts | Centralizes delegated-service allowlist enforcement before resource loading and existing delegation-scope and permission checks. |
| apps/sim/lib/workspace-files/application/operations.ts | Separates Copilot-only file operations from the subset also available to executor file tools. |
| apps/sim/executor/utils/http.ts | Adds a server-only helper for generating workflow-scoped executor delegation headers while retaining the legacy helper. |
| packages/auth/src/principal.ts | Adds a shared human-subject resolver that returns session, personal-key, or delegated user identity and rejects workspace API keys. |
| apps/sim/lib/workspace-files/application/share-workspace-file.ts | Uses the fail-fast human-subject resolver for file-share attribution. |
| apps/docs/openapi-v2-files-audit.json | Corrects the file metadata response snapshot to expose nullable public share state. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Caller[Session, API key, or delegated service] --> Policy[Workspace operation policy]
Policy --> Kind{Principal kind allowed?}
Kind -->|No| RejectKind[Reject before resource loading]
Kind -->|Yes| Service{Delegated principal?}
Service -->|No| Load[Load canonical resource context]
Service -->|Yes| Allowlist{Service in delegatedServices?}
Allowlist -->|No| RejectService[Reject before resource loading]
Allowlist -->|Yes| Load
Load --> Scope[Validate delegation audience and resource scope]
Scope --> Permission[Resolve represented user's workspace permission]
Permission --> Execute[Execute operation]
Reviews (1): Last reviewed commit: "feat(auth): centralize delegated identit..." | Re-trigger Greptile
Summary
Type of Change
Testing
Checklist