Skip to content

fix(backend): Align enterprise connection create and update params with the Backend API#9155

Open
manovotny wants to merge 3 commits into
manovotny/distracted-mahavira-cb3019from
manovotny/amazing-lalande-e031c2
Open

fix(backend): Align enterprise connection create and update params with the Backend API#9155
manovotny wants to merge 3 commits into
manovotny/distracted-mahavira-cb3019from
manovotny/amazing-lalande-e031c2

Conversation

@manovotny

Copy link
Copy Markdown
Contributor

Description

Stacked on #9153. This finishes aligning CreateEnterpriseConnectionParams and UpdateEnterpriseConnectionParams with the Backend API contract (clerk_go api/bapi/v1/enterprise_connections/service.go).

Two commits, reviewable separately:

Required fields and deprecations

  • name and domains are now required on create. BAPI validates both (validate:"required", min=1 on domains), so calls without them already failed at runtime — the types now catch it at compile time.
  • syncUserAttributes on create is deprecated. BAPI's CreateParams has no sync_user_attributes field; the JSON decoder drops it silently. It works on update, and the deprecation notice points there.
  • provider on update is deprecated. BAPI's UpdateParams has no provider field — the provider can't be changed after creation.

Missing optional params

Adds the optional fields BAPI accepts that the SDK types omitted: allowOrganizationAccountLinking, customAttributes, authenticatable, disableJitProvisioning (create and update), disableAdditionalIdentifications (update only), and saml.loginHint. Every shape was verified against the Go structs, including LoginHintParams (mode is one of email_address, custom_attribute, off; source is required exactly when mode is custom_attribute) and the custom attribute array (name and key required). All camelCase names were confirmed to snake-case to the exact wire keys.

To test: pnpm --filter @clerk/backend test:node EnterpriseConnectionApi.test.ts — new tests assert every added field reaches the request body in snake_case.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1508711

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@clerk/backend Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jul 14, 2026 4:43am
swingset Ready Ready Preview, Comment Jul 14, 2026 4:43am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 4ede3425-3599-4985-a9b4-787e90488aca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

manovotny and others added 2 commits July 13, 2026 23:25
…ctions

Stacked on #9153 (required provider field). Aligns the remaining
CreateEnterpriseConnectionParams gaps with the Backend API contract,
which validates name and domains (min 1) as required. Deprecates
syncUserAttributes on create and provider on update, since the
Backend API ignores both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the optional create/update params the Backend API supports but
the SDK types omitted: allowOrganizationAccountLinking,
customAttributes, authenticatable, disableJitProvisioning,
disableAdditionalIdentifications (update only), and saml.loginHint.
Verified against BAPI's CreateParams/UpdateParams/SAMLParams in
clerk_go.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codex review: BAPI requires login_hint.source exactly when mode is
custom_attribute and rejects it otherwise; model as a discriminated
union. Also lock name/domains as required with type-level tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant