Skip to content

feat(credential-groups): allowlist integrations by workspace - #7885

Merged
TheodoreSpeaks merged 2 commits into
stagingfrom
fix/cred-op-blocks
Sep 16, 2026
Merged

TheodoreSpeaks merged 2 commits into
stagingfrom
fix/cred-op-blocks

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • Keep Credential Groups visible whenever its feature flag is enabled, including with Sim Search enabled.
  • Add workspace-specific integration allowlists in the Access tab. The modal places All integrations first in the integration picker and preserves the existing integration settings.
  • Evaluate credential types through resource policies across credential discovery, OAuth/MCP/token use, and credential trigger delivery. Existing all-integration grants retain their behavior.

Type of Change

  • New feature

Testing

  • 2,093 focused credential, policy, MCP, settings, and UI tests; 22 DB policy reconciliation tests.
  • App, auth, and DB type-checks; repository lint and audit suite; block registry and generated documentation checks.
  • Regenerated the module-graph baseline after measuring 2–5 added modules per affected route; the executable tool registry remains unreachable from guarded routes.
  • Local workflow checks: all-integration and Gmail-only grants allow Gmail; a different integration-only grant hides Gmail and denies both explicit lookup and execution with a saved Gmail credential ID.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 16, 2026 7:59pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 57 files

Confidence score: 3/5

  • In apps/sim/lib/credentials/application/workspace-account-visibility.ts, stale or cross-scoped enrollment group ownership can cause the policy lookup to rely only on credential.organizationId, risking incorrect workspace visibility or authorization decisions. Verify the enrollment’s canonical credentialGroup owner before querying requireResourcePolicy.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/credentials/application/workspace-account-visibility.ts">

<violation number="1" location="apps/sim/lib/credentials/application/workspace-account-visibility.ts:26">
P2: When an enrollment’s group owner is stale or cross-scoped, this query uses only `credential.organizationId` and never verifies the enrollment’s canonical `credentialGroup` owner. `requireResourcePolicy` is then queried with the wrong scope, so a malformed binding raises a policy-not-found error and breaks credential listing/lookup instead of hiding the entry; join `credentialGroup` and reject owner mismatches before loading its policy.

(Based on your team's feedback about Credential Group ownership.)</violation>
</file>

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/sim/lib/credentials/application/resolve-personal-token.ts
Comment thread apps/sim/components/settings/navigation.ts
Comment thread packages/db/credential-group-resource-policies.ts
Comment thread apps/sim/hooks/queries/organization-accounts.ts
Comment thread apps/sim/lib/credentials/application/workspace-account-visibility.ts Outdated
@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no new actionable issue was introduced since the previous review, and the only previous finding was manually resolved.

Summary

This PR adds workspace-specific integration allowlists to Credential Groups and consistently enforces those grants across credential discovery and use.

  • Keeps Credential Groups visible when Sim Search is enabled.
  • Adds per-workspace integration selection while preserving all-integration grants.
  • Applies canonical credential-type policy checks to OAuth, MCP, personal-token, workflow, Copilot, and trigger paths.
  • Updates resource-policy reconciliation, API contracts, settings UI, and focused regression coverage.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Organization credential group] --> B[Workspace grant]
    B --> C{Integration scope}
    C -->|All integrations| D[Workspace may discover credentials]
    C -->|Selected integrations| E[Canonical credential-type condition]
    E --> D
    D --> F{Authorization and policy evaluation}
    F --> G[OAuth and token use]
    F --> H[MCP connections]
    F --> I[Workflow and Copilot access]
    F --> J[Credential triggers]
Loading

Reviews (4) · Last reviewed commit: "fix(credential-groups): refresh selector..."

Comment thread apps/sim/ee/credential-groups/components/organization-workspace-grant-modal.tsx Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 60 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 60 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile Please re-review against the current staging merge base, f6bc72378c2c93eb207c00e7e144c2ffe671cf23. This branch was rebased; its only PR commits are 53ad61308e and 18d6048e76. GitHub's current PR diff contains 60 files. The Insights changes from #7884 and authentication changes from #7886 are already on staging, not additions from this PR. In particular, git diff origin/staging HEAD -- apps/sim/lib/billing/core/organization-activity-queries.ts is empty.

The daily-bucket concern also appears inconsistent with the current query and schema: both source started_at columns are timestamps without time zone, and the query attaches UTC, converts to the requested timezone, then truncates. The existing organization-activity.postgres.test.ts suite covers Los Angeles day boundaries across daylight saving time with a Pacific/Auckland database session; all 7 tests passed in this head's PostgreSQL CI job. Please reassess the concern against that implementation and refresh the summary for the current PR diff. Credential-group behavior remains deny-by-default, with selected grants matching the canonical credential type.

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 60 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@TheodoreSpeaks
TheodoreSpeaks merged commit 000356f into staging Sep 16, 2026
33 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the fix/cred-op-blocks branch September 16, 2026 20:10

This branch was successfully deployed

1 active deployment
Preview 18d6048e Deployed Sep 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant