Skip to content

fix(integrations): one integration-access verdict across the catalog, @ menus and search, enforced by an audit - #9457

Merged
waleedlatif1 merged 7 commits into
stagingfrom
feat/integrations-permission-filter
Oct 30, 2026
Merged

waleedlatif1 merged 7 commits into
stagingfrom
feat/integrations-permission-filter

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • One integration-access verdict for every surface that lists integrations: resolveIntegrationAccess (lib/integrations/access.ts) returns available | unconfigured | requestable | denied from the permission group ∩ deployment ALLOWED_INTEGRATIONS, then deployment OAuth configuration (policy judged first, so a restricted integration is never advertised as merely unconfigured)
  • useIntegrationAccess(workspaceId) returns that verdict, or none until both policies load, so listings fail closed by construction; takes the workspace explicitly because groups can target individual workspaces. usePermissionConfig delegates to the same policy and keeps its fail-open isBlockAllowed/filterBlocks for the toolbar and tool pickers unchanged
  • Integrations catalog: hides denied integrations, shows requestable ones as locked rows that open the request modal (when access requests are on), keeps unconfigured ones as "Unavailable"; Connected lists only credentials for a permitted integration; emptied categories drop out and fall back to All
  • Detail page: a restricted integration renders "Access required" (+ Request access when requestable) instead of the connect actions
  • Mothership @/+ menu, the markdown editor's @ mentions (previously ungated) and sidebar search only offer usable integrations — matching the server, which drops mentions of restricted or unconfigured ones; org-level chat offers an integration only when every workspace permits it
  • check:integration-access: a module that imports a raw integration catalog must also read useIntegrationAccess (or be exempt with a reason; stale exemptions fail), and the fail-open useIntegrationAccessPolicy is refused outside usePermissionConfig. Guidance added to CLAUDE.md/AGENTS.md

Type of Change

  • Bug fix
  • Improvement (consolidation + enforcement)

Testing

  • lib/integrations/access.test.ts: six failure modes (deployment ceiling, policy-before-unconfigured ordering, unconfigured, successor ids in either policy, exempt entry point, credential-group gate); each verified red by reverting its guard
  • hooks/use-permission-config.test.tsx: no verdict before the permission group loads while the legacy gate stays fail-open; existing requestable tests pass through the new path
  • organization-resource-inventory.test.ts: cross-workspace intersection and missing-workspace cases (red first)
  • scripts/check-integration-access.test.ts: 8 cases incl. renamed/namespace imports, type-only imports, stale exemptions, fail-open hook outside its reader; audit verified to fail when a real gate is removed
  • Local: biome on changed files, comment-hygiene, test-patterns, file-names, utils, source-text, import-specifiers, client-boundary; type-check and full suite in CI

Checklist

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

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Oct 30, 2026 12:15am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no blocking issues remain.

Summary

The PR gives integration listings one shared access decision across permission groups, deployment restrictions, and OAuth setup.

  • Integration surfaces now share one workspace access verdict.
  • The integration catalog shows rows that match workspace access.
  • Restricted integration detail pages show an access-required state.
  • Integration menus and search show only usable integrations.
  • Builds now check that integration listings use the shared verdict.

Reviews (7) · Last reviewed commit: "fix(integrations): treat an untraceable ..." · Reviewed by Greptile

Comment thread apps/sim/app/workspace/[workspaceId]/integrations/integrations.tsx Outdated

@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.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/app/workspace/[workspaceId]/integrations/integrations.tsx Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/app/workspace/[workspaceId]/integrations/integrations.tsx Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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 6 files

Confidence score: 5/5

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

Turn on auto-fix | Re-trigger cubic

@waleedlatif1 waleedlatif1 changed the title fix(integrations): hide integrations the permission group disallows fix(integrations): reflect permission-group integration policy across the catalog and @ menu Oct 29, 2026
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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.

1 issue found across 10 files

Confidence score: 5/5

  • available-resources.ts fetches deployment availability even when the menu is closed or integrations aren’t included, bypassing the hook’s lazy-loading behavior. Gate the fetch on the effective enabled and included configuration.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown/available-resources.ts">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown/available-resources.ts:194">
P3: This unconditionally fetches deployment availability even for closed menus and inventories that do not include integrations, defeating the hook's documented lazy-loading behavior. Pass the effective enabled/included condition to the availability query and preserve the existing cache semantics.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/hooks/use-permission-config.ts Outdated
Comment thread apps/sim/app/workspace/[workspaceId]/integrations/integrations.tsx Outdated
@waleedlatif1
waleedlatif1 force-pushed the feat/integrations-permission-filter branch from a6ba85a to 47fc03c Compare October 29, 2026 23:54
@waleedlatif1
waleedlatif1 requested a review from a team as a code owner October 29, 2026 23:54
@waleedlatif1 waleedlatif1 changed the title fix(integrations): reflect permission-group integration policy across the catalog and @ menu fix(integrations): one integration-access verdict across the catalog, @ menus and search, enforced by an audit Oct 29, 2026
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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.

All reported issues were addressed across 21 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

Comment thread scripts/check-integration-access.ts Outdated
Comment thread scripts/check-integration-access.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

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

Comment thread scripts/check-integration-access.ts Outdated

@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 21 files

Confidence score: 5/5

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

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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 21 files

Confidence score: 5/5

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

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 2698438 into staging Oct 30, 2026
68 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/integrations-permission-filter branch October 30, 2026 00:19
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