feat(credentials): add managed credential groups - #6697
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryHigh Risk Overview Admin and enrollment surfaces include workspace settings (create/edit groups, invite/resend/revoke, Slack managed-user setup), invitation emails, a public OAuth and credential APIs are tightened: Workflow integration adds a Credential Groups block and executor handler (list credentials/people/groups, send invites with rate limits) plus a new Gating: Reviewed by Cursor Bugbot for commit c884334. Bugbot is set up for automated code reviews on this repo. Configure here. |
5341d8e to
8663a42
Compare
Greptile SummaryAdds enterprise-managed credential groups, including invitation enrollment, custom-app OAuth adapters, managed credential execution, administrative settings, and workflow operations.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/credential-groups/oauth.ts | Persists verified OAuth grants under lifecycle and policy locks while preserving completed reconnect state and rejecting revoked or stale-policy callbacks. |
| apps/sim/lib/credential-groups/enrollments.ts | Implements invitation, resend, revocation, public enrollment, and completion transitions with compatible locks and conditional state updates. |
| apps/sim/app/api/auth/oauth/token/route.ts | Adds fail-closed managed OAuth token resolution using scoped workflow delegation and trusted tool metadata. |
| apps/sim/lib/credentials/application/resolve-managed-oauth-token.ts | Resolves managed credentials through the application-operation boundary with provider and scope enforcement. |
| packages/db/schema.ts | Adds the credential-group and managed OAuth persistence model used by enrollment and delegated execution. |
| packages/db/migrations/0291_fuzzy_wong.sql | Introduces the database structures and constraints required for managed credential groups. |
Sequence Diagram
sequenceDiagram
participant Admin
participant API as Credential Group API
participant DB as PostgreSQL
participant User
participant OAuth as OAuth Provider
participant Exec as Workflow Executor
Admin->>API: Create group and send invitation
API->>DB: Persist enrollment and invitation token
API-->>User: Enrollment email
User->>API: Open invitation and start OAuth
API->>OAuth: Authorization request
OAuth-->>API: Callback and verified grant
API->>DB: Lock lifecycle and revalidate policy
API->>DB: Persist managed credential
User->>API: Complete enrollment
API->>DB: Lock and revalidate required credentials
API->>DB: Mark enrollment completed
Exec->>API: Request token with scoped delegation
API->>DB: Authorize and resolve managed credential
API-->>Exec: Access token
Reviews (15): Last reviewed commit: "fix(lint): use optional chain for pagina..." | Re-trigger Greptile
|
@cursor review |
|
@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 caad5d0. Configure here.
|
@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 4a2a6e7. Configure here.
|
@cursor review |
9f64dfd to
3f504cd
Compare
|
@cursor review |
ac7bcb4 to
f7e498f
Compare
|
@cursor review |
|
@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 c884334. Configure here.
Summary
Type of Change
Testing
bun run lint:checkbun run check:auditsbunx turbo run type-check --filter=sim --filter=@sim/authbun run check:migrations origin/stagingChecklist