Skip to content

feat(credentials): add named API keys to credential groups - #8188

Closed
TheodoreSpeaks wants to merge 4 commits into
stagingfrom
codex/research-named-api-key-credentials
Closed

TheodoreSpeaks wants to merge 4 commits into
stagingfrom
codex/research-named-api-key-credentials

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Let admins request named API keys with optional descriptions and let each member connect, replace, or disconnect their own encrypted value from Integrations.
  • Add paginated Credential Group API-key listing and explicit retrieval for dynamic downstream inputs, with current access checks and secret provenance.
  • Rename OAuth/MCP operation labels to Credential Group while preserving their saved IDs and behavior. Include the additive migration, management UI, and usage docs.

Type of Change

  • Feature

Testing

Focused regression tests for the integration flow (87 passing); app type check; 26-package lint and lint:check; all 47 audits; docs and block registry gates. The migration and replay passed in temporary PostgreSQL 17 with synthetic data.

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 23, 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 Skipped Skipped Sep 23, 2026 6:33pm UTC

Request Review

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

@greptile-apps

greptile-apps Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the remaining Integrations error-state issue is non-blocking and limited to contradictory UI messaging.

Findings

  1. P2 Error Shows Empty State

Summary

This PR adds named API-key requests to Credential Groups, including encrypted per-member submissions, management and enrollment interfaces, workflow block operations, API contracts, persistence, migration, documentation, and tests. The changes since the previous review additionally expose member-owned API keys in the organization Integrations page.

  • Adds member Connect, Replace, and Disconnect controls for requested API keys.
  • Adds current-viewer API-key identity projection without returning ciphertext.
  • Reuses the authenticated enrollment boundary to save API-key values.
  • Preserves existing OAuth and MCP operation identifiers while updating their labels.
  • One non-blocking query-state presentation issue remains in the Integrations list.
Diagram
sequenceDiagram
  participant Member
  participant IntegrationsUI
  participant OrganizationAPI
  participant EnrollmentAPI
  participant Database

  Member->>IntegrationsUI: Connect or replace named API key
  IntegrationsUI->>OrganizationAPI: Start personal group enrollment
  OrganizationAPI->>Database: Reuse enrollment and issue token
  OrganizationAPI-->>IntegrationsUI: Invitation link
  IntegrationsUI->>EnrollmentAPI: Submit key with token and option ID
  EnrollmentAPI->>Database: Encrypt and upsert member key
  EnrollmentAPI-->>IntegrationsUI: Connected
  IntegrationsUI->>OrganizationAPI: Refresh member inventory
  OrganizationAPI->>Database: Read key identity only
  OrganizationAPI-->>IntegrationsUI: credentialId and optionId
Loading

Reviews (4) · Last reviewed commit: "feat(credentials): connect requested key..."

Comment thread apps/sim/lib/credential-groups/application/public-enrollment.ts
Comment thread apps/sim/app/credential-groups/enroll/[token]/page.tsx

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

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

Re-trigger cubic

Comment thread apps/sim/ee/credential-groups/components/organization-account-api-keys.tsx Outdated
Comment thread apps/sim/app/api/credential-groups/enroll/[token]/api-keys/[optionId]/route.ts Outdated
Comment thread apps/sim/blocks/blocks/credential.ts
Comment thread apps/sim/lib/workflows/persistence/utils.ts 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 23, 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 63 files

Confidence score: 5/5

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

Re-trigger cubic

Comment thread apps/sim/ee/credential-groups/components/organization-account-api-keys.tsx Outdated
@TheodoreSpeaks
TheodoreSpeaks force-pushed the codex/research-named-api-key-credentials branch from bc33ac0 to 0e4c37a Compare September 23, 2026 17:30
@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 23, 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 62 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 23, 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.

1 issue found across 70 files

Confidence score: 4/5

  • In apps/sim/app/o/[organizationId]/integrations/member-integrations-list.tsx, account-metadata failures can incorrectly render both the empty-state message and the API-key request error, confusing users about whether integrations are unavailable or loading failed — exclude organizationAccounts.isError from the empty-state condition.
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/app/o/[organizationId]/integrations/member-integrations-list.tsx">

<violation number="1" location="apps/sim/app/o/[organizationId]/integrations/member-integrations-list.tsx:194">
P3: An account-metadata failure now shows both “No integrations are available” and “Could not load API key requests.” Exclude `organizationAccounts.isError` from the empty-state condition.</violation>
</file>

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.

Fix all with cubic | Re-trigger cubic

{showEmpty &&
visible.length === 0 &&
visibleApiKeys.length === 0 &&
!organizationAccounts.isPending &&

@cubic-dev-ai cubic-dev-ai Bot Sep 23, 2026

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.

P3: An account-metadata failure now shows both “No integrations are available” and “Could not load API key requests.” Exclude organizationAccounts.isError from the empty-state condition.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/app/o/[organizationId]/integrations/member-integrations-list.tsx, line 194:

<comment>An account-metadata failure now shows both “No integrations are available” and “Could not load API key requests.” Exclude `organizationAccounts.isError` from the empty-state condition.</comment>

<file context>
@@ -171,8 +175,23 @@ export function MemberIntegrationsList({
             {showEmpty &&
               visible.length === 0 &&
+              visibleApiKeys.length === 0 &&
+              !organizationAccounts.isPending &&
               !availability.integrationAvailabilityError &&
               !showSlackSetupError && (
</file context>
Suggested change
!organizationAccounts.isPending &&
!organizationAccounts.isPending &&
!organizationAccounts.isError &&
Fix with cubic

{showEmpty &&
visible.length === 0 &&
visibleApiKeys.length === 0 &&
!organizationAccounts.isPending &&

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.

P2 Error Shows Empty State

When the organization-accounts request fails and no other integration matches, this condition still renders the empty state because it excludes only pending requests. The error state below then renders at the same time, so users see both “No integrations are available” and “Could not load API key requests,” obscuring that the inventory failed to load.

Suggested change
!organizationAccounts.isPending &&
!organizationAccounts.isPending &&
!organizationAccounts.isError &&

@TheodoreSpeaks
TheodoreSpeaks deleted the codex/research-named-api-key-credentials branch September 23, 2026 18:52

This branch was previously deployed

1 inactive deployment
Preview 6e117079 Deployed Sep 23, 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