Skip to content

fix(credential-groups): final audit follow-ups for connect links and Access - #10766

Merged
waleedlatif1 merged 8 commits into
stagingfrom
fix/credgroups-final-audit
Dec 4, 2026
Merged

waleedlatif1 merged 8 commits into
stagingfrom
fix/credgroups-final-audit

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Final audit follow-ups for Credential Groups connect links (#10743), plus the Access tab failing for large organizations.

  • Require a verified email for every enrollment claim again. Deployments with email verification off no longer let a fresh sign-up claim a pending request by address through the token-less connect URL. The verify step now sends a code when it opens. Deployments that can't send email name only the sign-in providers that verify (Google or GitHub, when configured), or say to ask an admin.
  • A queued request email is no longer dropped when the same person is asked about another integration before it sends. A first email is never labelled a reminder, from either the workflow or the People path.
  • Access tab: the read returns only granted, still-active workspaces, and Add workspace searches on the server. Orgs with more than 1000 workspaces can open the tab, and a granted workspace that is later archived or moved no longer breaks it. The 1000-grant cap stays and is explained on the disabled button.
  • Connect page states:
    • rate limit offers Try again instead of a sticky error
    • revoked people are told to ask an admin
    • different email says which account to use
    • needs-reauth reads Reconnect
    • People no longer shows Email failed for someone who accepted
  • Expired OAuth attempts outside Slack get the generic message instead of "open the link you were sent".
  • The cleanup cron returns 500 when a table fails, instead of reporting success.
  • Cleanup: one helper each for provider options, connect URLs, token hashing and request expiry. Removed the URL-parsing enrollment-links.ts, dead exports, and a declaration test.
  • Docs: credential block (daily cap is distinct people in a rolling 24 hours, Access requirement, the connect URL is one person's link), Connected Accounts (new operations, workflow connection requests, verified email), and the README.

Type of Change

  • Bug fix

Testing

  • Integration against real Postgres: all lib/credential-groups/__integration__, the cleanup job, managed-oauth and dry-run suites (15 files, 278 tests).
  • New regression tests, each red on the pre-fix code:
    • unverified viewer gets verify_email on a non-verifying deployment
    • first request email still sends after a later request
    • first workflow email isn't a reminder
    • org with more than 1000 workspaces reads and searches Access
    • archived or moved grants are dropped from the read
    • verify page sends once, only to the session address
  • Unit tests for touched files; tsc --noEmit for apps/sim; lint; check:api-validation:strict, check:test-types, check:boundaries, check:source-conventions, check:comment-hygiene, check:file-names; block registry check.

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)

…mails, honest expiry copy

- Claiming a request for an address again requires user.emailVerified everywhere, including on
  deployments that cannot verify email: drop verified-email.ts and the relaxed credentials query.
- Verify email state sends a code when opened (/verify?sendCode=true); where no code can be sent
  it asks the person to sign in with Google or Microsoft instead of looping through /verify.
- A connection request email is sent while the enrollment is still a pending workflow request,
  no longer pinned to the latest workflow and integration, so a later request for another
  integration no longer drops the first email. providerId leaves the outbox payload.
- An expired non-Slack OAuth attempt shows the generic expired message.
- Link cleanup cron returns 500 when a table's drain fails, after both tables run
- One active-options-for-provider helper and one Access-tab provider predicate for the
  request path and the admin policy's in-effect check
- Connect, start, OAuth start and MCP start URLs come from connect-url builders; enrollment
  links hand back their token instead of being parsed (enrollment-links.ts removed)
- Invitation tokens hash through hashInvitationToken everywhere
- requestExpiresAt(now) replaces five copies of the renewal arithmetic
- Link OAuth origins come from one const array the contract and types derive from
- pendingWorkflowRequestCondition lives with the request email event; static import of the
  email handlers ends the cycle
- Drop an unread link-record field, file-local exports, a restating TSDoc, and the duplicated
  connection-status/request input; reuse hasOrganizationSetup in canSelfEnroll
- Connect route test: drop the declaration test and the six identical outcome cases
- README: MCP attempts live ten minutes, Send email vs Send reminder, outbox wording
- A first workflow-request email sent from People no longer reads as a reminder
- Policy and Access refusals name the setting they come from
…re than 1000 workspaces

The Access read loaded every active workspace in the organization and refused once there were
more than the grant cap, so large organizations saw only "Workspace access supports at most 1000
workspaces" and could not use Access or Workflow connection requests.

The read now names only the granted workspaces (bounded by the grant cap), and Add workspace
searches the organization's workspaces without access on the server: a bounded, wildcard-escaped
name search behind the same admin read operation, exposed to the settings UI and to Copilot
(search_workspaces). The grant cap itself is unchanged.
@vercel

vercel Bot commented Dec 4, 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 Dec 4, 2026 4:40pm 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.

All reported issues were addressed across 81 files

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 Dec 4, 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 81 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 merged commit fa26b98 into staging Dec 4, 2026
93 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/credgroups-final-audit branch December 4, 2026 22:31

This branch was previously deployed

1 inactive deployment
Preview — 60254d56 Deployed Dec 4, 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