feat(resource-policies): add statement evaluator - #6892
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryHigh Risk Overview Adds a required per-group policy lifecycle (create/delete/backfill), optimistic-concurrency admin GET/PUT, and a settings Access tab. Credential use now evaluates Threads current workflow (draft vs active deployment version) through executor delegation and child-workflow execution so workflow principals and Reviewed by Cursor Bugbot for commit a01a557. Bugbot is set up for automated code reviews on this repo. Configure here. |
9995853 to
0c9fb23
Compare
Greptile SummaryThe PR replaces credential-group grants with revisioned statement-based resource policies and propagates execution authority into credential-use decisions.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/credential-groups/application/authorization.ts | Enforces executor-principal, workflow-authority, enrollment, and resource-policy checks before credential-group credential use. |
| apps/sim/lib/credential-groups/application/workflow-access-policy.ts | Defines and evaluates the bounded workflow-only policy document with deployment-mode enforcement and deny-by-default behavior. |
| apps/sim/lib/auth/internal-delegation.ts | Binds delegated executor claims to canonical execution, workflow, workspace, and deployment-version context. |
| apps/sim/lib/resource-policies/repository.ts | Adds revisioned policy reads and transactionally guarded optimistic updates. |
| packages/db/credential-group-resource-policies.ts | Implements credential-group policy lifecycle triggers, bounded backfill batches, and relational-invariant validation. |
| apps/sim/ee/credential-groups/components/credential-group-access.tsx | Adds a revision-aware workflow-access editor that preserves drafts across refreshes and validates catalog availability before saving. |
| apps/sim/lib/workflows/executor/execution-core.ts | Propagates current deployed-workflow authority through workflow execution and resume boundaries. |
Sequence Diagram
sequenceDiagram
participant Admin
participant AccessAPI
participant PolicyStore
participant Executor
participant Delegation
participant CredentialAuth
Admin->>AccessAPI: Select allowed workflows
AccessAPI->>PolicyStore: Write policy with expected revision
PolicyStore-->>AccessAPI: New revision
Executor->>Delegation: Bind principal and deployed workflow authority
Delegation->>CredentialAuth: Resolve managed credential
CredentialAuth->>PolicyStore: Read credential-group policy
PolicyStore-->>CredentialAuth: Policy document
CredentialAuth->>CredentialAuth: Evaluate actor rule and workflow statements
CredentialAuth-->>Executor: Allow credential or deny safely
Reviews (5): Last reviewed commit: "improvement(credential-groups): simplify..." | Re-trigger Greptile
aaea6ae to
52e3168
Compare
95eafd9 to
9d5f513
Compare
c2d891e to
64f547f
Compare
64f547f to
eccb03a
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
3 issues from previous reviews remain unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit eccb03a. Configure here.
eccb03a to
ede2aba
Compare
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
There are 5 total unresolved issues (including 3 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ede2aba. Configure here.
fab4e47 to
a01a557
Compare
|
@cursor review |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
|
@cursor review |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |

Summary
Type of Change
Testing
Checklist