fix(backend): Align enterprise connection create and update params with the Backend API#9155
Conversation
🦋 Changeset detectedLatest commit: 1508711 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
…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>
ace6b49 to
7b6b5c0
Compare
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>
Description
Stacked on #9153. This finishes aligning
CreateEnterpriseConnectionParamsandUpdateEnterpriseConnectionParamswith the Backend API contract (clerk_goapi/bapi/v1/enterprise_connections/service.go).Two commits, reviewable separately:
Required fields and deprecations
nameanddomainsare now required on create. BAPI validates both (validate:"required",min=1on domains), so calls without them already failed at runtime — the types now catch it at compile time.syncUserAttributeson create is deprecated. BAPI'sCreateParamshas nosync_user_attributesfield; the JSON decoder drops it silently. It works on update, and the deprecation notice points there.provideron update is deprecated. BAPI'sUpdateParamshas noproviderfield — 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), andsaml.loginHint. Every shape was verified against the Go structs, includingLoginHintParams(modeis one ofemail_address,custom_attribute,off;sourceis required exactly when mode iscustom_attribute) and the custom attribute array (nameandkeyrequired). 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 testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code