fix(authz): enforce credential and workspace boundaries - #6585
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryHigh Risk Overview Knowledge connectors now require credential membership ( MCP OAuth revocation is workspace-scoped: Workspace forking preserves the source Reviewed by Cursor Bugbot for commit 526b85e. Configure here. |
Greptile SummaryThis PR strengthens authorization boundaries around knowledge connector credentials and MCP server operations while preserving workspace API-key policy during forks.
Confidence Score: 5/5The PR appears safe to merge, with the changed authorization and policy-propagation paths consistently scoped and covered by focused tests. The credential gate uses the delegated subject or authorized workspace actor, MCP lifecycle callers pass canonically authorized workspace IDs into revocation, refresh now requires the permission level appropriate for its writes, and fork creation receives a concrete source policy value.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/knowledge/application/connectors.ts | Adds workspace and credential-membership checks before resolving OAuth identities for connector creation and source-config validation. |
| apps/sim/lib/mcp/oauth/revoke.ts | Requires a workspace identifier and verifies server containment before loading and revoking OAuth tokens. |
| apps/sim/lib/mcp/orchestration/server-lifecycle.ts | Propagates the authorized workspace into every MCP OAuth revocation call. |
| apps/sim/app/api/mcp/servers/[id]/refresh/route.ts | Raises refresh authorization from read to write because the operation persists workflow changes. |
| apps/sim/ee/workspace-forking/lib/create-fork.ts | Preserves the source workspace's personal API-key policy in the inserted and returned fork. |
| apps/sim/lib/workspaces/permissions/utils.ts | Extends workspace resolution to return the personal API-key policy required by fork creation. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Actor[Authenticated actor] --> WorkspaceAuth[Resolve workspace permission]
WorkspaceAuth -->|write allowed| Operation{Operation}
Operation --> Refresh[MCP refresh]
Operation --> Connector[Knowledge connector]
Operation --> Lifecycle[MCP update or delete]
Connector --> CredentialContext[Resolve credential actor context]
CredentialContext --> Membership{Workspace and credential access?}
Membership -->|yes| OAuthIdentity[Resolve OAuth identity]
Membership -->|no| Reject[Reject credential use]
Lifecycle --> ScopedServer[Resolve server by ID and workspace]
ScopedServer --> Revoke[Best-effort OAuth revocation]
Refresh --> Persist[Persist workflow schema changes]
Reviews (1): Last reviewed commit: "fix(authz): enforce credential and works..." | Re-trigger Greptile
|
bugbot run |
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 526b85e. Configure here.
Summary
Type of Change
Testing
Checklist