feat(credentials): add managed credential groups - #6697
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryHigh Risk Overview Managed OAuth credentials ( Documents Reviewed by Cursor Bugbot for commit 8253b2d. Bugbot is set up for automated code reviews on this repo. Configure here. |
5341d8e to
8663a42
Compare
Greptile SummaryThe PR adds enterprise-managed credential groups, public enrollment and custom-app OAuth flows, delegated managed-credential execution, administrative settings, and the supporting database schema.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/credential-groups/enrollments.ts | Implements invitation, resend, revocation, and completion lifecycles with shared locking and transactional revalidation; the previously reported races are addressed. |
| apps/sim/lib/credential-groups/oauth.ts | Persists OAuth grants under lifecycle and group locks while rejecting revoked enrollments, validating current policy, and preserving completed reconnect state. |
| apps/sim/app/api/auth/oauth/token/route.ts | Adds a fail-closed managed OAuth path requiring a credential-scoped workflow delegation and trusted tool scope policy. |
| apps/sim/lib/credentials/managed-oauth.ts | Adds managed credential token storage, status handling, refresh, and provider-policy validation. |
| packages/db/schema.ts | Adds the credential-group, enrollment, option, managed-credential, and supporting relational schema. |
| packages/db/migrations/0291_fuzzy_wong.sql | Introduces the database objects and constraints required by managed credential groups. |
| apps/sim/executor/handlers/credential-group/credential-group-handler.ts | Adds executor support for credential-group listing, people, invitations, and credential operations. |
Sequence Diagram
sequenceDiagram
participant Admin
participant API as Credential Group API
participant DB as Postgres
participant Recipient
participant OAuth as Provider OAuth
participant Exec as Workflow Executor
Admin->>API: Create group and send invitation
API->>DB: Persist group, options, and enrollment
API-->>Recipient: Enrollment link
Recipient->>API: Open enrollment and start OAuth
API->>OAuth: Authorize configured provider
OAuth-->>API: Callback grant
API->>DB: Lock lifecycle and persist managed credential
Recipient->>API: Complete enrollment
API->>DB: Lock and validate current policy/readiness
Exec->>API: Request token with scoped delegation
API->>DB: Authorize and resolve managed credential
API-->>Exec: Access token
Reviews (13): Last reviewed commit: "fix(credentials): redirect unavailable o..." | 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 |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 063ff6e. Configure here.
063ff6e to
c6c1296
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 8253b2d. 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