fix(backend): Align EnterpriseConnection resource with the Backend API response - #9156

Merged
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment
Jul 27, 2026
Merged

fix(backend): Align EnterpriseConnection resource with the Backend API response#9156
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment

Conversation

@manovotny

@manovotnymanovotny commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #9155. The EnterpriseConnection resource classes and JSON types drifted from what BAPI's serializer returns (clerk_goapi/serialize/enterprise_connection.go). Some properties read fields BAPI never sends — typed string/boolean but always undefined at runtime — and several returned fields were missing from the SDK.

What changed:

  • EnterpriseConnection now exposes provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.
  • EnterpriseConnectionSamlConnection now exposes active, forceAuthn, and loginHint (required and non-null — BAPI's serializer always sends it).
  • EnterpriseConnectionOauthConfig now exposes providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.
  • Phantom fields are deprecated, not removed: top-level allowSubdomains (only exists on the nested SAML connection) and nested idpMetadata/syncUserAttributes. Removing them would break positional constructor callers, so they keep their slots and gain @deprecated notices pointing at the real field.
  • organizationId is normalized to null when BAPI omits the key, making the declared string | null true at runtime.
  • Fields backed by pointer+omitempty in Go (oauthConfig.clientId, the SAML idp_* fields, certificate timestamps) are retyped | undefined to match runtime behavior.

New constructor params are appended after existing ones. Adding required constructor params to resource classes in a non-major release follows repo precedent (#1544 added hasImage mid-constructor as a minor); this ships as a minor for the same reason.

One review call worth a second opinion: the | undefined retyping is a compile-time change for consumers with strict null checks. It converts silent runtime undefineds into visible type errors, but it will surface in downstream builds on upgrade.

Note

Review surfaced an upstream gap: BAPI's EnterpriseConnectionResponse is missing the object discriminator its sibling serializers all send, so the SDK's deserializer (which switches on object) currently returns raw snake_case JSON for enterprise connection responses in production — fromJSON only runs in tests, where the mock supplies object. The mock keeps object deliberately: it exercises the SDK path that the existing ObjectType.EnterpriseConnection deserializer case defines, and matches the contract once clerk_go adds the field. The upstream fix is filed separately — ORGS-1765.

To test: pnpm --filter @clerk/backend test

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

manovotnyand others added 2 commits July 13, 2026 22:55
…onParams
The Backend API validates provider as required on enterprise connection
creation, so calls without it type-checked but failed at runtime.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntract
Reuses the OrganizationEnterpriseConnectionProvider union from
@clerk/shared/types (matching the sibling SamlConnectionApi pattern) and
adds type-level tests so provider can't silently become optional or widen
back to string.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef1c9ed

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendMinor
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jul 14, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJul 27, 2026 9:12pm
swingsetReadyReadyPreview, CommentJul 27, 2026 9:12pm

Request Review

@coderabbitai

coderabbitaiBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The EnterpriseConnection response contracts and resource parsers now support expanded SAML, OAuth, and top-level fields, including login hints, custom attributes, provider metadata, capability flags, and OAuth endpoints. Optional and deprecated properties were adjusted to match Backend API responses, and omitted organization_id values are normalized to null. Related exports, API fixtures, assertions, and a package changeset were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clerk/javascript#9155: Updates enterprise connection create/update parameter typings and request serialization for related SAML and OIDC shapes.
  • clerk/javascript#9200: Adds ConfigureSSO UI logic consuming the OIDC provider and OAuth configuration fields.

Suggested reviewers:laurabeatris, alexisintech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: aligning EnterpriseConnection with Backend API responses.
Description check✅ PassedThe description is directly related to the changeset and accurately explains the API alignment work.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

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

manovotnyand 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>
manovotnyand others added 2 commits July 13, 2026 23:41
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>
…sponse
The resource classes and JSON types drifted from BAPI's serializer
(clerk_go api/serialize/enterprise_connection.go): several properties
read fields BAPI never sends, and several returned fields were missing.
New constructor params are appended to preserve positional compatibility.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d bump to minor
Codex review: BAPI's serializer always sends login_hint (no omitempty,
never nil), so the JSON type and resource property are non-nullable.
Changeset bumped to minor to match repo precedent for new resource
properties (e.g. hasImage).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-newBot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9156

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9156

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9156

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9156

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9156

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9156

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9156

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9156

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9156

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9156

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9156

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9156

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9156

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9156

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9156

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9156

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9156

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9156

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9156

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9156

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9156

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9156

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9156

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9156

commit: ef1c9ed

@github-actions

github-actionsBot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-27T21:14:23.638Z

Summary

MetricCount
Packages analyzed19
Packages with changes1
🔴 Breaking changes18
🟡 Non-breaking changes16
🟢 Additions50

Warning
18 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (18)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/backend.EnterpriseConnection.undefined
@clerk/backend.EnterpriseConnection.allowSubdomains
@clerk/backend.EnterpriseConnectionOauthConfig.undefined
@clerk/backend.EnterpriseConnectionOauthConfig.clientId
@clerk/backend.EnterpriseConnectionOauthConfig.discoveryUrl
@clerk/backend.EnterpriseConnectionOauthConfig.logoPublicUrl
@clerk/backend.EnterpriseConnectionSamlConnection.undefined
@clerk/backend.EnterpriseConnectionSamlConnection.acsUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificate
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateExpiresAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateIssuedAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadata
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpSsoUrl
@clerk/backend.EnterpriseConnectionSamlConnection.spEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.spMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.syncUserAttributes

@clerk/backend

Current version: 3.13.1
Recommended bump: MAJOR → 4.0.0

🔴 Breaking Changes (18)

Changed: EnterpriseConnection.undefined

// ... 4 unchanged lines elided ...
organizationId: string | null, active: boolean, syncUserAttributes: boolean, - allowSubdomains: boolean, + allowSubdomains: boolean | undefined, 
disableAdditionalIdentifications: boolean, createdAt: number, updatedAt: number, samlConnection: EnterpriseConnectionSamlConnection | null, - oauthConfig: EnterpriseConnectionOauthConfig | null);+ oauthConfig: EnterpriseConnectionOauthConfig | null, + provider: string, + logoPublicUrl: string | undefined, + allowOrganizationAccountLinking: boolean, + authenticatable: boolean, + disableJitProvisioning: boolean, + customAttributes: EnterpriseConnectionCustomAttribute[] | undefined);

Static analyzer: Breaking change in constructor EnterpriseConnection.undefined: Parameter allowSubdomains type changed: booleanboolean|undefined; Required parameter provider was added; Required parameter logoPublicUrl was added; Required parameter allowOrganizationAccountLinking was added; Required parameter authenticatable was added; Required parameter disableJitProvisioning was added; Required parameter customAttributes was added

🤖 AI review (confirmed) (95%): New required parameters (provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, customAttributes) were added to the EnterpriseConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnection(...) calls to supply the newly required parameters: provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.

Changed: EnterpriseConnection.allowSubdomains

- readonly allowSubdomains: boolean;+ readonly allowSubdomains: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnection.allowSubdomains: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnection.allowSubdomains changed from boolean to boolean | undefined on an output property; consumers reading this property and expecting a non-nullable boolean will now receive a potentially undefined value, requiring null-checks.

Migration: Add an undefined guard wherever allowSubdomains is read, e.g. connection.allowSubdomains ?? false.

Changed: EnterpriseConnectionOauthConfig.undefined

 constructor(
id: string, name: string, - clientId: string, - discoveryUrl: string, - logoPublicUrl: string, + clientId: string | undefined, + discoveryUrl: string | undefined, + logoPublicUrl: string | undefined, 
createdAt: number, - updatedAt: number);+ updatedAt: number, + providerKey: string, + authUrl: string | undefined, + tokenUrl: string | undefined, + userInfoUrl: string | undefined, + requiresPkce: boolean);

Static analyzer: Breaking change in constructor EnterpriseConnectionOauthConfig.undefined: Parameter clientId type changed: stringstring|undefined; Parameter discoveryUrl type changed: stringstring|undefined; Parameter logoPublicUrl type changed: stringstring|undefined; Required parameter providerKey was added; Required parameter authUrl was added; Required parameter tokenUrl was added; Required parameter userInfoUrl was added; Required parameter requiresPkce was added

🤖 AI review (confirmed) (95%): New required parameters (providerKey, authUrl, tokenUrl, userInfoUrl, requiresPkce) were added to the EnterpriseConnectionOauthConfig constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionOauthConfig(...) calls to supply the newly required parameters: providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.

Changed: EnterpriseConnectionOauthConfig.clientId

- readonly clientId: string;+ readonly clientId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.clientId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.clientId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever clientId is read, e.g. config.clientId ?? ''.

Changed: EnterpriseConnectionOauthConfig.discoveryUrl

- readonly discoveryUrl: string;+ readonly discoveryUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.discoveryUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.discoveryUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever discoveryUrl is read, e.g. config.discoveryUrl ?? ''.

Changed: EnterpriseConnectionOauthConfig.logoPublicUrl

- readonly logoPublicUrl: string;+ readonly logoPublicUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.logoPublicUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.logoPublicUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever logoPublicUrl is read, e.g. config.logoPublicUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.undefined

 constructor(
id: string, name: string, - idpEntityId: string, - idpSsoUrl: string, - idpCertificate: string, - idpCertificateIssuedAt: number, - idpCertificateExpiresAt: number, - idpMetadataUrl: string, - idpMetadata: string, - acsUrl: string, - spEntityId: string, - spMetadataUrl: string, - syncUserAttributes: boolean, + idpEntityId: string | undefined, + idpSsoUrl: string | undefined, + idpCertificate: string | undefined, + idpCertificateIssuedAt: number | undefined, + idpCertificateExpiresAt: number | undefined, + idpMetadataUrl: string | undefined, + idpMetadata: string | undefined, + acsUrl: string | undefined, + spEntityId: string | undefined, + spMetadataUrl: string | undefined, + syncUserAttributes: boolean | undefined, 
allowSubdomains: boolean, - allowIdpInitiated: boolean);+ allowIdpInitiated: boolean, + active: boolean, + forceAuthn: boolean, + loginHint: EnterpriseConnectionSamlConnectionLoginHint);

Static analyzer: Breaking change in constructor EnterpriseConnectionSamlConnection.undefined: Parameter idpEntityId type changed: stringstring|undefined; Parameter idpSsoUrl type changed: stringstring|undefined; Parameter idpCertificate type changed: stringstring|undefined; Parameter idpCertificateIssuedAt type changed: numbernumber|undefined; Parameter idpCertificateExpiresAt type changed: numbernumber|undefined; Parameter idpMetadataUrl type changed: stringstring|undefined; Parameter idpMetadata type changed: stringstring|undefined; Parameter acsUrl type changed: stringstring|undefined; Parameter spEntityId type changed: stringstring|undefined; Parameter spMetadataUrl type changed: stringstring|undefined; Parameter syncUserAttributes type changed: booleanboolean|undefined; Required parameter active was added; Required parameter forceAuthn was added; Required parameter loginHint was added

🤖 AI review (confirmed) (95%): New required parameters (active, forceAuthn, loginHint) were added to the EnterpriseConnectionSamlConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionSamlConnection(...) calls to supply the newly required parameters: active, forceAuthn, and loginHint.

Changed: EnterpriseConnectionSamlConnection.acsUrl

- readonly acsUrl: string;+ readonly acsUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.acsUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.acsUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever acsUrl is read, e.g. conn.acsUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificate

- readonly idpCertificate: string;+ readonly idpCertificate: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificate: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificate changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificate is read, e.g. conn.idpCertificate ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificateExpiresAt

- readonly idpCertificateExpiresAt: number;+ readonly idpCertificateExpiresAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateExpiresAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateExpiresAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateExpiresAt is read, e.g. conn.idpCertificateExpiresAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpCertificateIssuedAt

- readonly idpCertificateIssuedAt: number;+ readonly idpCertificateIssuedAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateIssuedAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateIssuedAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateIssuedAt is read, e.g. conn.idpCertificateIssuedAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpEntityId

- readonly idpEntityId: string;+ readonly idpEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpEntityId is read, e.g. conn.idpEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadata

- readonly idpMetadata: string;+ readonly idpMetadata: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadata: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadata changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadata is read, e.g. conn.idpMetadata ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadataUrl

- readonly idpMetadataUrl: string;+ readonly idpMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadataUrl is read, e.g. conn.idpMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpSsoUrl

- readonly idpSsoUrl: string;+ readonly idpSsoUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpSsoUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpSsoUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpSsoUrl is read, e.g. conn.idpSsoUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.spEntityId

- readonly spEntityId: string;+ readonly spEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spEntityId is read, e.g. conn.spEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.spMetadataUrl

- readonly spMetadataUrl: string;+ readonly spMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spMetadataUrl is read, e.g. conn.spMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.syncUserAttributes

- readonly syncUserAttributes: boolean;+ readonly syncUserAttributes: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.syncUserAttributes: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.syncUserAttributes changed from boolean to boolean | undefined on an output property; consumers expecting a non-nullable boolean will now need to handle undefined.

Migration: Add an undefined guard wherever syncUserAttributes is read, e.g. conn.syncUserAttributes ?? false.

🟡 Non-breaking Changes (16)

Click to expand 16 changes

Modified: EnterpriseConnectionJSON.allow_subdomains

- allow_subdomains: boolean;+ allow_subdomains?: boolean;

Static analyzer: Modified property EnterpriseConnectionJSON.allow_subdomains: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.allow_subdomains becoming optional is a widening of an input/JSON interface; consumers constructing this type no longer need to supply the field, so no existing well-typed code breaks.

Modified: EnterpriseConnectionJSON.organization_id

- organization_id: string | null;+ organization_id?: string | null;

Static analyzer: Modified property EnterpriseConnectionJSON.organization_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.organization_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.client_id

- client_id: string;+ client_id?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.client_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.client_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.discovery_url

- discovery_url: string;+ discovery_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.discovery_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.discovery_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.logo_public_url

- logo_public_url: string;+ logo_public_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.logo_public_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.logo_public_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.acs_url

- acs_url: string;+ acs_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.acs_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.acs_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at

- idp_certificate_expires_at: number;+ idp_certificate_expires_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at

- idp_certificate_issued_at: number;+ idp_certificate_issued_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate

- idp_certificate: string;+ idp_certificate?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_entity_id

- idp_entity_id: string;+ idp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata_url

- idp_metadata_url: string;+ idp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata

- idp_metadata: string;+ idp_metadata?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_sso_url

- idp_sso_url: string;+ idp_sso_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_sso_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_sso_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_entity_id

- sp_entity_id: string;+ sp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_metadata_url

- sp_metadata_url: string;+ sp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sync_user_attributes

- sync_user_attributes: boolean;+ sync_user_attributes?: boolean;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sync_user_attributes: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sync_user_attributes becoming optional widens the input interface; existing code that already provides the field remains valid.

🟢 Additions (50)

Click to expand 50 changes

Added: EnterpriseConnection.allowOrganizationAccountLinking

+ readonly allowOrganizationAccountLinking: boolean;

Added property EnterpriseConnection.allowOrganizationAccountLinking

Added: EnterpriseConnection.authenticatable

+ readonly authenticatable: boolean;

Added property EnterpriseConnection.authenticatable

Added: EnterpriseConnection.customAttributes

+ readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined;

Added property EnterpriseConnection.customAttributes

Added: EnterpriseConnection.disableJitProvisioning

+ readonly disableJitProvisioning: boolean;

Added property EnterpriseConnection.disableJitProvisioning

Added: EnterpriseConnection.logoPublicUrl

+ readonly logoPublicUrl: string | undefined;

Added property EnterpriseConnection.logoPublicUrl

Added: EnterpriseConnection.provider

+ readonly provider: string;

Added property EnterpriseConnection.provider

Added: EnterpriseConnectionCustomAttribute

+ export declare class EnterpriseConnectionCustomAttribute

Added class EnterpriseConnectionCustomAttribute

Added: EnterpriseConnectionCustomAttribute.undefined

+ constructor(+ name: string, + key: string, + ssoPath: string, + scimPath: string, + multiValued: boolean);

Added constructor EnterpriseConnectionCustomAttribute.undefined

Added: EnterpriseConnectionCustomAttribute.fromJSON

+ static fromJSON(data: EnterpriseConnectionCustomAttributeJSON): EnterpriseConnectionCustomAttribute;

Added method EnterpriseConnectionCustomAttribute.fromJSON

Added: EnterpriseConnectionCustomAttribute.key

+ readonly key: string;

Added property EnterpriseConnectionCustomAttribute.key

Added: EnterpriseConnectionCustomAttribute.multiValued

+ readonly multiValued: boolean;

Added property EnterpriseConnectionCustomAttribute.multiValued

Added: EnterpriseConnectionCustomAttribute.name

+ readonly name: string;

Added property EnterpriseConnectionCustomAttribute.name

Added: EnterpriseConnectionCustomAttribute.scimPath

+ readonly scimPath: string;

Added property EnterpriseConnectionCustomAttribute.scimPath

Added: EnterpriseConnectionCustomAttribute.ssoPath

+ readonly ssoPath: string;

Added property EnterpriseConnectionCustomAttribute.ssoPath

Added: EnterpriseConnectionCustomAttributeJSON

+ export interface EnterpriseConnectionCustomAttributeJSON

Added interface EnterpriseConnectionCustomAttributeJSON

Added: EnterpriseConnectionCustomAttributeJSON.key

+ key: string;

Added property EnterpriseConnectionCustomAttributeJSON.key

Added: EnterpriseConnectionCustomAttributeJSON.multi_valued

+ multi_valued: boolean;

Added property EnterpriseConnectionCustomAttributeJSON.multi_valued

Added: EnterpriseConnectionCustomAttributeJSON.name

+ name: string;

Added property EnterpriseConnectionCustomAttributeJSON.name

Added: EnterpriseConnectionCustomAttributeJSON.scim_path

+ scim_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.scim_path

Added: EnterpriseConnectionCustomAttributeJSON.sso_path

+ sso_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.sso_path

Added: EnterpriseConnectionJSON.allow_organization_account_linking

+ allow_organization_account_linking: boolean;

Added property EnterpriseConnectionJSON.allow_organization_account_linking

Added: EnterpriseConnectionJSON.authenticatable

+ authenticatable: boolean;

Added property EnterpriseConnectionJSON.authenticatable

Added: EnterpriseConnectionJSON.custom_attributes

+ custom_attributes?: EnterpriseConnectionCustomAttributeJSON[];

Added property EnterpriseConnectionJSON.custom_attributes

Added: EnterpriseConnectionJSON.disable_jit_provisioning

+ disable_jit_provisioning: boolean;

Added property EnterpriseConnectionJSON.disable_jit_provisioning

Added: EnterpriseConnectionJSON.logo_public_url

+ logo_public_url?: string;

Added property EnterpriseConnectionJSON.logo_public_url

Added: EnterpriseConnectionJSON.provider

+ provider: string;

Added property EnterpriseConnectionJSON.provider

Added: EnterpriseConnectionOauthConfig.authUrl

+ readonly authUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.authUrl

Added: EnterpriseConnectionOauthConfig.providerKey

+ readonly providerKey: string;

Added property EnterpriseConnectionOauthConfig.providerKey

Added: EnterpriseConnectionOauthConfig.requiresPkce

+ readonly requiresPkce: boolean;

Added property EnterpriseConnectionOauthConfig.requiresPkce

Added: EnterpriseConnectionOauthConfig.tokenUrl

+ readonly tokenUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.tokenUrl

Added: EnterpriseConnectionOauthConfig.userInfoUrl

+ readonly userInfoUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.userInfoUrl

Added: EnterpriseConnectionOauthConfigJSON.auth_url

+ auth_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.auth_url

Added: EnterpriseConnectionOauthConfigJSON.provider_key

+ provider_key: string;

Added property EnterpriseConnectionOauthConfigJSON.provider_key

Added: EnterpriseConnectionOauthConfigJSON.requires_pkce

+ requires_pkce: boolean;

Added property EnterpriseConnectionOauthConfigJSON.requires_pkce

Added: EnterpriseConnectionOauthConfigJSON.token_url

+ token_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.token_url

Added: EnterpriseConnectionOauthConfigJSON.user_info_url

+ user_info_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.user_info_url

Added: EnterpriseConnectionSamlConnection.active

+ readonly active: boolean;

Added property EnterpriseConnectionSamlConnection.active

Added: EnterpriseConnectionSamlConnection.forceAuthn

+ readonly forceAuthn: boolean;

Added property EnterpriseConnectionSamlConnection.forceAuthn

Added: EnterpriseConnectionSamlConnection.loginHint

+ readonly loginHint: EnterpriseConnectionSamlConnectionLoginHint;

Added property EnterpriseConnectionSamlConnection.loginHint

Added: EnterpriseConnectionSamlConnectionJSON.active

+ active: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.active

Added: EnterpriseConnectionSamlConnectionJSON.force_authn

+ force_authn: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.force_authn

Added: EnterpriseConnectionSamlConnectionJSON.login_hint

+ login_hint: EnterpriseConnectionSamlConnectionLoginHintJSON;

Added property EnterpriseConnectionSamlConnectionJSON.login_hint

Added: EnterpriseConnectionSamlConnectionLoginHint

+ export declare class EnterpriseConnectionSamlConnectionLoginHint

Added class EnterpriseConnectionSamlConnectionLoginHint

Added: EnterpriseConnectionSamlConnectionLoginHint.undefined

+ constructor(+ mode: 'email_address' | 'custom_attribute' | 'off', + source?: string | undefined);

Added constructor EnterpriseConnectionSamlConnectionLoginHint.undefined

Added: EnterpriseConnectionSamlConnectionLoginHint.fromJSON

+ static fromJSON(data: EnterpriseConnectionSamlConnectionLoginHintJSON): EnterpriseConnectionSamlConnectionLoginHint;

Added method EnterpriseConnectionSamlConnectionLoginHint.fromJSON

Added: EnterpriseConnectionSamlConnectionLoginHint.mode

+ readonly mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHint.mode

Added: EnterpriseConnectionSamlConnectionLoginHint.source

+ readonly source?: string | undefined;

Added property EnterpriseConnectionSamlConnectionLoginHint.source

Added: EnterpriseConnectionSamlConnectionLoginHintJSON

+ export interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.mode

+ mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.mode

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.source

+ source?: string;

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.source


Report generated by Break Check

Last ran on ef1c9ed.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts`:
- Around line 350-386: Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts`:
- Around line 253-276: Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 104cd8a9-6a61-4602-875c-723186eda94d

📥 Commits

Reviewing files that changed from the base of the PR and between c904fb4 and f2a4865.

📒 Files selected for processing (5)
  • .changeset/major-poets-refuse.md
  • packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts
  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go(manual)
  • clerk/dashboard(manual)
  • clerk/accounts(manual)
  • clerk/backoffice(manual)
  • clerk/clerk(manual)
  • clerk/clerk-docs(manual)
  • clerk/cloudflare-workers(manual)

Comment on lines +350 to +386
expect(response.provider).toBe('saml_custom');
expect(response.logoPublicUrl).toBe('https://img.example.com/connection-logo.png');
expect(response.domains).toEqual(['clerk.dev']);
expect(response.active).toBe(true);
// organization_id is omitted by the Backend API when unset and normalized to null
expect(response.organizationId).toBeNull();
expect(response.allowOrganizationAccountLinking).toBe(true);
expect(response.authenticatable).toBe(true);
expect(response.disableJitProvisioning).toBe(false);
expect(response.customAttributes).toEqual([
{
name: 'Employee Number',
key: 'employee_number',
ssoPath: 'user.employeeNumber',
scimPath: '',
multiValued: false,
},
]);
expect(response.samlConnection).not.toBeNull();
expect(response.samlConnection?.id).toBe('samlc_1');
expect(response.samlConnection?.idpEntityId).toBe('https://idp.example.com');
expect(response.samlConnection?.idpCertificateIssuedAt).toBe(1672531200000);
expect(response.samlConnection?.idpCertificateExpiresAt).toBe(1704067200000);
expect(response.samlConnection?.active).toBe(true);
expect(response.samlConnection?.forceAuthn).toBe(false);
expect(response.samlConnection?.loginHint).toEqual({
mode: 'custom_attribute',
source: 'employee_number',
});
expect(response.oauthConfig).not.toBeNull();
expect(response.oauthConfig?.providerKey).toBe('custom_oidc');
expect(response.oauthConfig?.clientId).toBe('client_abc');
expect(response.oauthConfig?.discoveryUrl).toBe('https://oauth.example.com/.well-known/openid-configuration');
expect(response.oauthConfig?.authUrl).toBe('https://oauth.example.com/authorize');
expect(response.oauthConfig?.tokenUrl).toBe('https://oauth.example.com/token');
expect(response.oauthConfig?.userInfoUrl).toBe('https://oauth.example.com/userinfo');
expect(response.oauthConfig?.requiresPkce).toBe(false);

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover omitted optional response fields.

This fixture populates every newly optional SAML/OAuth field and custom_attributes. Add a case omitting them and assert the resource exposes undefined; this locks in the intended serializer-omission behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts` around
lines 350 - 386, Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.

Source: Coding guidelines

Comment on lines +253 to +276
/**
* The identity provider (IdP) of the connection. For example, `'saml_custom'` or `'oidc_custom'`.
*/
readonly provider: string,
/**
* The public URL of the provider logo, if available.
*/
readonly logoPublicUrl: string | undefined,
/**
* Whether existing users who are members of the organization can link their account to their enterprise identity.
*/
readonly allowOrganizationAccountLinking: boolean,
/**
* Whether the connection can be used for sign-in and sign-up.
*/
readonly authenticatable: boolean,
/**
* Whether Just-in-Time (JIT) provisioning of users is disabled for the connection.
*/
readonly disableJitProvisioning: boolean,
/**
* The custom attribute mappings of the connection. Only returned when the custom attributes feature is enabled for the instance.
*/
readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined,

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
rg -n -C 4 '"version"|"exports"' packages/backend/package.json
ast-grep outline packages/backend/src/api/resources/EnterpriseConnection.ts --items all --type class
rg -n -C 3 '\bEnterpriseConnection(SamlConnection|OauthConfig)?\b' packages/backend/src/index.ts

Repository: clerk/javascript

Length of output: 1546


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## Constructor definitions\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | nl -ba | sed -n '1,340p'printf'\n## Direct usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig|)\b' packages/backend/src ||trueprintf'\n## Package entry exports around backend index\n'
sed -n '120,190p' packages/backend/src/index.ts | nl -ba | sed -n '1,120p'printf'\n## Changeset\n'
sed -n '1,80p' .changeset/major-poets-refuse.md | nl -ba | sed -n '1,80p'

Repository: clerk/javascript

Length of output: 222


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## EnterpriseConnection.ts constructors\n'
grep -nE '^export class (EnterpriseConnectionSamlConnectionLoginHint|EnterpriseConnectionCustomAttribute|EnterpriseConnectionSamlConnection|EnterpriseConnectionOauthConfig|EnterpriseConnection)\b|^ constructor\(' packages/backend/src/api/resources/EnterpriseConnection.ts
printf'\n## Relevant source around constructors\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | cat -n | sed -n '1,340p'printf'\n## Public exports from backend entry\n'
grep -nE 'EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?' packages/backend/src/index.ts
printf'\n## Direct constructor usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?\b' packages/backend/src ||trueprintf'\n## Changeset\n'
cat -n .changeset/major-poets-refuse.md

Repository: clerk/javascript

Length of output: 15917


Bump @clerk/backend to a major release

These exported constructors are part of the public API, so adding required trailing parameters is a breaking change. Update .changeset/major-poets-refuse.md to major, or make the new arguments backward-compatible.

  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • .changeset/major-poets-refuse.md
📍 Affects 2 files
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L253-L276 (this comment)
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L94-L99
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L159-L178
  • .changeset/major-poets-refuse.md#L2-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts` around lines 253
- 276, Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.

Source: Coding guidelines

@wobsorianowobsoriano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Re | undefined question: The old types were wrong. Any downstream code that breaks on upgrade was already unsafe at runtime.

If there's a compiler error then it's just surfacing existing bugs rather than creating new ones. Minor bump is perfect!

@manovotny
manovotny merged commit 23071bd into mainJul 27, 2026
51 checks passed
@manovotny
manovotny deleted the manovotny/enterprise-connection-response-alignment branch July 27, 2026 22:14
Sign up for freeto 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.

2 participants

@manovotny@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

fix(backend): Align EnterpriseConnection resource with the Backend API response - #9156

Merged
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment
Jul 27, 2026
Merged

fix(backend): Align EnterpriseConnection resource with the Backend API response#9156
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment

Conversation

@manovotny

@manovotnymanovotny commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #9155. The EnterpriseConnection resource classes and JSON types drifted from what BAPI's serializer returns (clerk_goapi/serialize/enterprise_connection.go). Some properties read fields BAPI never sends — typed string/boolean but always undefined at runtime — and several returned fields were missing from the SDK.

What changed:

  • EnterpriseConnection now exposes provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.
  • EnterpriseConnectionSamlConnection now exposes active, forceAuthn, and loginHint (required and non-null — BAPI's serializer always sends it).
  • EnterpriseConnectionOauthConfig now exposes providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.
  • Phantom fields are deprecated, not removed: top-level allowSubdomains (only exists on the nested SAML connection) and nested idpMetadata/syncUserAttributes. Removing them would break positional constructor callers, so they keep their slots and gain @deprecated notices pointing at the real field.
  • organizationId is normalized to null when BAPI omits the key, making the declared string | null true at runtime.
  • Fields backed by pointer+omitempty in Go (oauthConfig.clientId, the SAML idp_* fields, certificate timestamps) are retyped | undefined to match runtime behavior.

New constructor params are appended after existing ones. Adding required constructor params to resource classes in a non-major release follows repo precedent (#1544 added hasImage mid-constructor as a minor); this ships as a minor for the same reason.

One review call worth a second opinion: the | undefined retyping is a compile-time change for consumers with strict null checks. It converts silent runtime undefineds into visible type errors, but it will surface in downstream builds on upgrade.

Note

Review surfaced an upstream gap: BAPI's EnterpriseConnectionResponse is missing the object discriminator its sibling serializers all send, so the SDK's deserializer (which switches on object) currently returns raw snake_case JSON for enterprise connection responses in production — fromJSON only runs in tests, where the mock supplies object. The mock keeps object deliberately: it exercises the SDK path that the existing ObjectType.EnterpriseConnection deserializer case defines, and matches the contract once clerk_go adds the field. The upstream fix is filed separately — ORGS-1765.

To test: pnpm --filter @clerk/backend test

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

manovotnyand others added 2 commits July 13, 2026 22:55
…onParams
The Backend API validates provider as required on enterprise connection
creation, so calls without it type-checked but failed at runtime.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntract
Reuses the OrganizationEnterpriseConnectionProvider union from
@clerk/shared/types (matching the sibling SamlConnectionApi pattern) and
adds type-level tests so provider can't silently become optional or widen
back to string.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef1c9ed

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendMinor
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jul 14, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJul 27, 2026 9:12pm
swingsetReadyReadyPreview, CommentJul 27, 2026 9:12pm

Request Review

@coderabbitai

coderabbitaiBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The EnterpriseConnection response contracts and resource parsers now support expanded SAML, OAuth, and top-level fields, including login hints, custom attributes, provider metadata, capability flags, and OAuth endpoints. Optional and deprecated properties were adjusted to match Backend API responses, and omitted organization_id values are normalized to null. Related exports, API fixtures, assertions, and a package changeset were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clerk/javascript#9155: Updates enterprise connection create/update parameter typings and request serialization for related SAML and OIDC shapes.
  • clerk/javascript#9200: Adds ConfigureSSO UI logic consuming the OIDC provider and OAuth configuration fields.

Suggested reviewers:laurabeatris, alexisintech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: aligning EnterpriseConnection with Backend API responses.
Description check✅ PassedThe description is directly related to the changeset and accurately explains the API alignment work.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

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

manovotnyand 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>
manovotnyand others added 2 commits July 13, 2026 23:41
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>
…sponse
The resource classes and JSON types drifted from BAPI's serializer
(clerk_go api/serialize/enterprise_connection.go): several properties
read fields BAPI never sends, and several returned fields were missing.
New constructor params are appended to preserve positional compatibility.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d bump to minor
Codex review: BAPI's serializer always sends login_hint (no omitempty,
never nil), so the JSON type and resource property are non-nullable.
Changeset bumped to minor to match repo precedent for new resource
properties (e.g. hasImage).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-newBot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9156

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9156

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9156

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9156

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9156

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9156

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9156

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9156

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9156

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9156

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9156

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9156

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9156

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9156

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9156

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9156

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9156

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9156

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9156

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9156

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9156

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9156

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9156

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9156

commit: ef1c9ed

@github-actions

github-actionsBot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-27T21:14:23.638Z

Summary

MetricCount
Packages analyzed19
Packages with changes1
🔴 Breaking changes18
🟡 Non-breaking changes16
🟢 Additions50

Warning
18 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (18)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/backend.EnterpriseConnection.undefined
@clerk/backend.EnterpriseConnection.allowSubdomains
@clerk/backend.EnterpriseConnectionOauthConfig.undefined
@clerk/backend.EnterpriseConnectionOauthConfig.clientId
@clerk/backend.EnterpriseConnectionOauthConfig.discoveryUrl
@clerk/backend.EnterpriseConnectionOauthConfig.logoPublicUrl
@clerk/backend.EnterpriseConnectionSamlConnection.undefined
@clerk/backend.EnterpriseConnectionSamlConnection.acsUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificate
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateExpiresAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateIssuedAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadata
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpSsoUrl
@clerk/backend.EnterpriseConnectionSamlConnection.spEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.spMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.syncUserAttributes

@clerk/backend

Current version: 3.13.1
Recommended bump: MAJOR → 4.0.0

🔴 Breaking Changes (18)

Changed: EnterpriseConnection.undefined

// ... 4 unchanged lines elided ...
organizationId: string | null, active: boolean, syncUserAttributes: boolean, - allowSubdomains: boolean, + allowSubdomains: boolean | undefined, 
disableAdditionalIdentifications: boolean, createdAt: number, updatedAt: number, samlConnection: EnterpriseConnectionSamlConnection | null, - oauthConfig: EnterpriseConnectionOauthConfig | null);+ oauthConfig: EnterpriseConnectionOauthConfig | null, + provider: string, + logoPublicUrl: string | undefined, + allowOrganizationAccountLinking: boolean, + authenticatable: boolean, + disableJitProvisioning: boolean, + customAttributes: EnterpriseConnectionCustomAttribute[] | undefined);

Static analyzer: Breaking change in constructor EnterpriseConnection.undefined: Parameter allowSubdomains type changed: booleanboolean|undefined; Required parameter provider was added; Required parameter logoPublicUrl was added; Required parameter allowOrganizationAccountLinking was added; Required parameter authenticatable was added; Required parameter disableJitProvisioning was added; Required parameter customAttributes was added

🤖 AI review (confirmed) (95%): New required parameters (provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, customAttributes) were added to the EnterpriseConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnection(...) calls to supply the newly required parameters: provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.

Changed: EnterpriseConnection.allowSubdomains

- readonly allowSubdomains: boolean;+ readonly allowSubdomains: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnection.allowSubdomains: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnection.allowSubdomains changed from boolean to boolean | undefined on an output property; consumers reading this property and expecting a non-nullable boolean will now receive a potentially undefined value, requiring null-checks.

Migration: Add an undefined guard wherever allowSubdomains is read, e.g. connection.allowSubdomains ?? false.

Changed: EnterpriseConnectionOauthConfig.undefined

 constructor(
id: string, name: string, - clientId: string, - discoveryUrl: string, - logoPublicUrl: string, + clientId: string | undefined, + discoveryUrl: string | undefined, + logoPublicUrl: string | undefined, 
createdAt: number, - updatedAt: number);+ updatedAt: number, + providerKey: string, + authUrl: string | undefined, + tokenUrl: string | undefined, + userInfoUrl: string | undefined, + requiresPkce: boolean);

Static analyzer: Breaking change in constructor EnterpriseConnectionOauthConfig.undefined: Parameter clientId type changed: stringstring|undefined; Parameter discoveryUrl type changed: stringstring|undefined; Parameter logoPublicUrl type changed: stringstring|undefined; Required parameter providerKey was added; Required parameter authUrl was added; Required parameter tokenUrl was added; Required parameter userInfoUrl was added; Required parameter requiresPkce was added

🤖 AI review (confirmed) (95%): New required parameters (providerKey, authUrl, tokenUrl, userInfoUrl, requiresPkce) were added to the EnterpriseConnectionOauthConfig constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionOauthConfig(...) calls to supply the newly required parameters: providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.

Changed: EnterpriseConnectionOauthConfig.clientId

- readonly clientId: string;+ readonly clientId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.clientId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.clientId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever clientId is read, e.g. config.clientId ?? ''.

Changed: EnterpriseConnectionOauthConfig.discoveryUrl

- readonly discoveryUrl: string;+ readonly discoveryUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.discoveryUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.discoveryUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever discoveryUrl is read, e.g. config.discoveryUrl ?? ''.

Changed: EnterpriseConnectionOauthConfig.logoPublicUrl

- readonly logoPublicUrl: string;+ readonly logoPublicUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.logoPublicUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.logoPublicUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever logoPublicUrl is read, e.g. config.logoPublicUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.undefined

 constructor(
id: string, name: string, - idpEntityId: string, - idpSsoUrl: string, - idpCertificate: string, - idpCertificateIssuedAt: number, - idpCertificateExpiresAt: number, - idpMetadataUrl: string, - idpMetadata: string, - acsUrl: string, - spEntityId: string, - spMetadataUrl: string, - syncUserAttributes: boolean, + idpEntityId: string | undefined, + idpSsoUrl: string | undefined, + idpCertificate: string | undefined, + idpCertificateIssuedAt: number | undefined, + idpCertificateExpiresAt: number | undefined, + idpMetadataUrl: string | undefined, + idpMetadata: string | undefined, + acsUrl: string | undefined, + spEntityId: string | undefined, + spMetadataUrl: string | undefined, + syncUserAttributes: boolean | undefined, 
allowSubdomains: boolean, - allowIdpInitiated: boolean);+ allowIdpInitiated: boolean, + active: boolean, + forceAuthn: boolean, + loginHint: EnterpriseConnectionSamlConnectionLoginHint);

Static analyzer: Breaking change in constructor EnterpriseConnectionSamlConnection.undefined: Parameter idpEntityId type changed: stringstring|undefined; Parameter idpSsoUrl type changed: stringstring|undefined; Parameter idpCertificate type changed: stringstring|undefined; Parameter idpCertificateIssuedAt type changed: numbernumber|undefined; Parameter idpCertificateExpiresAt type changed: numbernumber|undefined; Parameter idpMetadataUrl type changed: stringstring|undefined; Parameter idpMetadata type changed: stringstring|undefined; Parameter acsUrl type changed: stringstring|undefined; Parameter spEntityId type changed: stringstring|undefined; Parameter spMetadataUrl type changed: stringstring|undefined; Parameter syncUserAttributes type changed: booleanboolean|undefined; Required parameter active was added; Required parameter forceAuthn was added; Required parameter loginHint was added

🤖 AI review (confirmed) (95%): New required parameters (active, forceAuthn, loginHint) were added to the EnterpriseConnectionSamlConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionSamlConnection(...) calls to supply the newly required parameters: active, forceAuthn, and loginHint.

Changed: EnterpriseConnectionSamlConnection.acsUrl

- readonly acsUrl: string;+ readonly acsUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.acsUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.acsUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever acsUrl is read, e.g. conn.acsUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificate

- readonly idpCertificate: string;+ readonly idpCertificate: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificate: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificate changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificate is read, e.g. conn.idpCertificate ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificateExpiresAt

- readonly idpCertificateExpiresAt: number;+ readonly idpCertificateExpiresAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateExpiresAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateExpiresAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateExpiresAt is read, e.g. conn.idpCertificateExpiresAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpCertificateIssuedAt

- readonly idpCertificateIssuedAt: number;+ readonly idpCertificateIssuedAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateIssuedAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateIssuedAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateIssuedAt is read, e.g. conn.idpCertificateIssuedAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpEntityId

- readonly idpEntityId: string;+ readonly idpEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpEntityId is read, e.g. conn.idpEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadata

- readonly idpMetadata: string;+ readonly idpMetadata: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadata: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadata changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadata is read, e.g. conn.idpMetadata ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadataUrl

- readonly idpMetadataUrl: string;+ readonly idpMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadataUrl is read, e.g. conn.idpMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpSsoUrl

- readonly idpSsoUrl: string;+ readonly idpSsoUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpSsoUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpSsoUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpSsoUrl is read, e.g. conn.idpSsoUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.spEntityId

- readonly spEntityId: string;+ readonly spEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spEntityId is read, e.g. conn.spEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.spMetadataUrl

- readonly spMetadataUrl: string;+ readonly spMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spMetadataUrl is read, e.g. conn.spMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.syncUserAttributes

- readonly syncUserAttributes: boolean;+ readonly syncUserAttributes: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.syncUserAttributes: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.syncUserAttributes changed from boolean to boolean | undefined on an output property; consumers expecting a non-nullable boolean will now need to handle undefined.

Migration: Add an undefined guard wherever syncUserAttributes is read, e.g. conn.syncUserAttributes ?? false.

🟡 Non-breaking Changes (16)

Click to expand 16 changes

Modified: EnterpriseConnectionJSON.allow_subdomains

- allow_subdomains: boolean;+ allow_subdomains?: boolean;

Static analyzer: Modified property EnterpriseConnectionJSON.allow_subdomains: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.allow_subdomains becoming optional is a widening of an input/JSON interface; consumers constructing this type no longer need to supply the field, so no existing well-typed code breaks.

Modified: EnterpriseConnectionJSON.organization_id

- organization_id: string | null;+ organization_id?: string | null;

Static analyzer: Modified property EnterpriseConnectionJSON.organization_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.organization_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.client_id

- client_id: string;+ client_id?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.client_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.client_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.discovery_url

- discovery_url: string;+ discovery_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.discovery_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.discovery_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.logo_public_url

- logo_public_url: string;+ logo_public_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.logo_public_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.logo_public_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.acs_url

- acs_url: string;+ acs_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.acs_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.acs_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at

- idp_certificate_expires_at: number;+ idp_certificate_expires_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at

- idp_certificate_issued_at: number;+ idp_certificate_issued_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate

- idp_certificate: string;+ idp_certificate?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_entity_id

- idp_entity_id: string;+ idp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata_url

- idp_metadata_url: string;+ idp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata

- idp_metadata: string;+ idp_metadata?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_sso_url

- idp_sso_url: string;+ idp_sso_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_sso_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_sso_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_entity_id

- sp_entity_id: string;+ sp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_metadata_url

- sp_metadata_url: string;+ sp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sync_user_attributes

- sync_user_attributes: boolean;+ sync_user_attributes?: boolean;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sync_user_attributes: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sync_user_attributes becoming optional widens the input interface; existing code that already provides the field remains valid.

🟢 Additions (50)

Click to expand 50 changes

Added: EnterpriseConnection.allowOrganizationAccountLinking

+ readonly allowOrganizationAccountLinking: boolean;

Added property EnterpriseConnection.allowOrganizationAccountLinking

Added: EnterpriseConnection.authenticatable

+ readonly authenticatable: boolean;

Added property EnterpriseConnection.authenticatable

Added: EnterpriseConnection.customAttributes

+ readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined;

Added property EnterpriseConnection.customAttributes

Added: EnterpriseConnection.disableJitProvisioning

+ readonly disableJitProvisioning: boolean;

Added property EnterpriseConnection.disableJitProvisioning

Added: EnterpriseConnection.logoPublicUrl

+ readonly logoPublicUrl: string | undefined;

Added property EnterpriseConnection.logoPublicUrl

Added: EnterpriseConnection.provider

+ readonly provider: string;

Added property EnterpriseConnection.provider

Added: EnterpriseConnectionCustomAttribute

+ export declare class EnterpriseConnectionCustomAttribute

Added class EnterpriseConnectionCustomAttribute

Added: EnterpriseConnectionCustomAttribute.undefined

+ constructor(+ name: string, + key: string, + ssoPath: string, + scimPath: string, + multiValued: boolean);

Added constructor EnterpriseConnectionCustomAttribute.undefined

Added: EnterpriseConnectionCustomAttribute.fromJSON

+ static fromJSON(data: EnterpriseConnectionCustomAttributeJSON): EnterpriseConnectionCustomAttribute;

Added method EnterpriseConnectionCustomAttribute.fromJSON

Added: EnterpriseConnectionCustomAttribute.key

+ readonly key: string;

Added property EnterpriseConnectionCustomAttribute.key

Added: EnterpriseConnectionCustomAttribute.multiValued

+ readonly multiValued: boolean;

Added property EnterpriseConnectionCustomAttribute.multiValued

Added: EnterpriseConnectionCustomAttribute.name

+ readonly name: string;

Added property EnterpriseConnectionCustomAttribute.name

Added: EnterpriseConnectionCustomAttribute.scimPath

+ readonly scimPath: string;

Added property EnterpriseConnectionCustomAttribute.scimPath

Added: EnterpriseConnectionCustomAttribute.ssoPath

+ readonly ssoPath: string;

Added property EnterpriseConnectionCustomAttribute.ssoPath

Added: EnterpriseConnectionCustomAttributeJSON

+ export interface EnterpriseConnectionCustomAttributeJSON

Added interface EnterpriseConnectionCustomAttributeJSON

Added: EnterpriseConnectionCustomAttributeJSON.key

+ key: string;

Added property EnterpriseConnectionCustomAttributeJSON.key

Added: EnterpriseConnectionCustomAttributeJSON.multi_valued

+ multi_valued: boolean;

Added property EnterpriseConnectionCustomAttributeJSON.multi_valued

Added: EnterpriseConnectionCustomAttributeJSON.name

+ name: string;

Added property EnterpriseConnectionCustomAttributeJSON.name

Added: EnterpriseConnectionCustomAttributeJSON.scim_path

+ scim_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.scim_path

Added: EnterpriseConnectionCustomAttributeJSON.sso_path

+ sso_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.sso_path

Added: EnterpriseConnectionJSON.allow_organization_account_linking

+ allow_organization_account_linking: boolean;

Added property EnterpriseConnectionJSON.allow_organization_account_linking

Added: EnterpriseConnectionJSON.authenticatable

+ authenticatable: boolean;

Added property EnterpriseConnectionJSON.authenticatable

Added: EnterpriseConnectionJSON.custom_attributes

+ custom_attributes?: EnterpriseConnectionCustomAttributeJSON[];

Added property EnterpriseConnectionJSON.custom_attributes

Added: EnterpriseConnectionJSON.disable_jit_provisioning

+ disable_jit_provisioning: boolean;

Added property EnterpriseConnectionJSON.disable_jit_provisioning

Added: EnterpriseConnectionJSON.logo_public_url

+ logo_public_url?: string;

Added property EnterpriseConnectionJSON.logo_public_url

Added: EnterpriseConnectionJSON.provider

+ provider: string;

Added property EnterpriseConnectionJSON.provider

Added: EnterpriseConnectionOauthConfig.authUrl

+ readonly authUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.authUrl

Added: EnterpriseConnectionOauthConfig.providerKey

+ readonly providerKey: string;

Added property EnterpriseConnectionOauthConfig.providerKey

Added: EnterpriseConnectionOauthConfig.requiresPkce

+ readonly requiresPkce: boolean;

Added property EnterpriseConnectionOauthConfig.requiresPkce

Added: EnterpriseConnectionOauthConfig.tokenUrl

+ readonly tokenUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.tokenUrl

Added: EnterpriseConnectionOauthConfig.userInfoUrl

+ readonly userInfoUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.userInfoUrl

Added: EnterpriseConnectionOauthConfigJSON.auth_url

+ auth_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.auth_url

Added: EnterpriseConnectionOauthConfigJSON.provider_key

+ provider_key: string;

Added property EnterpriseConnectionOauthConfigJSON.provider_key

Added: EnterpriseConnectionOauthConfigJSON.requires_pkce

+ requires_pkce: boolean;

Added property EnterpriseConnectionOauthConfigJSON.requires_pkce

Added: EnterpriseConnectionOauthConfigJSON.token_url

+ token_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.token_url

Added: EnterpriseConnectionOauthConfigJSON.user_info_url

+ user_info_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.user_info_url

Added: EnterpriseConnectionSamlConnection.active

+ readonly active: boolean;

Added property EnterpriseConnectionSamlConnection.active

Added: EnterpriseConnectionSamlConnection.forceAuthn

+ readonly forceAuthn: boolean;

Added property EnterpriseConnectionSamlConnection.forceAuthn

Added: EnterpriseConnectionSamlConnection.loginHint

+ readonly loginHint: EnterpriseConnectionSamlConnectionLoginHint;

Added property EnterpriseConnectionSamlConnection.loginHint

Added: EnterpriseConnectionSamlConnectionJSON.active

+ active: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.active

Added: EnterpriseConnectionSamlConnectionJSON.force_authn

+ force_authn: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.force_authn

Added: EnterpriseConnectionSamlConnectionJSON.login_hint

+ login_hint: EnterpriseConnectionSamlConnectionLoginHintJSON;

Added property EnterpriseConnectionSamlConnectionJSON.login_hint

Added: EnterpriseConnectionSamlConnectionLoginHint

+ export declare class EnterpriseConnectionSamlConnectionLoginHint

Added class EnterpriseConnectionSamlConnectionLoginHint

Added: EnterpriseConnectionSamlConnectionLoginHint.undefined

+ constructor(+ mode: 'email_address' | 'custom_attribute' | 'off', + source?: string | undefined);

Added constructor EnterpriseConnectionSamlConnectionLoginHint.undefined

Added: EnterpriseConnectionSamlConnectionLoginHint.fromJSON

+ static fromJSON(data: EnterpriseConnectionSamlConnectionLoginHintJSON): EnterpriseConnectionSamlConnectionLoginHint;

Added method EnterpriseConnectionSamlConnectionLoginHint.fromJSON

Added: EnterpriseConnectionSamlConnectionLoginHint.mode

+ readonly mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHint.mode

Added: EnterpriseConnectionSamlConnectionLoginHint.source

+ readonly source?: string | undefined;

Added property EnterpriseConnectionSamlConnectionLoginHint.source

Added: EnterpriseConnectionSamlConnectionLoginHintJSON

+ export interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.mode

+ mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.mode

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.source

+ source?: string;

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.source


Report generated by Break Check

Last ran on ef1c9ed.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts`:
- Around line 350-386: Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts`:
- Around line 253-276: Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 104cd8a9-6a61-4602-875c-723186eda94d

📥 Commits

Reviewing files that changed from the base of the PR and between c904fb4 and f2a4865.

📒 Files selected for processing (5)
  • .changeset/major-poets-refuse.md
  • packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts
  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go(manual)
  • clerk/dashboard(manual)
  • clerk/accounts(manual)
  • clerk/backoffice(manual)
  • clerk/clerk(manual)
  • clerk/clerk-docs(manual)
  • clerk/cloudflare-workers(manual)

Comment on lines +350 to +386
expect(response.provider).toBe('saml_custom');
expect(response.logoPublicUrl).toBe('https://img.example.com/connection-logo.png');
expect(response.domains).toEqual(['clerk.dev']);
expect(response.active).toBe(true);
// organization_id is omitted by the Backend API when unset and normalized to null
expect(response.organizationId).toBeNull();
expect(response.allowOrganizationAccountLinking).toBe(true);
expect(response.authenticatable).toBe(true);
expect(response.disableJitProvisioning).toBe(false);
expect(response.customAttributes).toEqual([
{
name: 'Employee Number',
key: 'employee_number',
ssoPath: 'user.employeeNumber',
scimPath: '',
multiValued: false,
},
]);
expect(response.samlConnection).not.toBeNull();
expect(response.samlConnection?.id).toBe('samlc_1');
expect(response.samlConnection?.idpEntityId).toBe('https://idp.example.com');
expect(response.samlConnection?.idpCertificateIssuedAt).toBe(1672531200000);
expect(response.samlConnection?.idpCertificateExpiresAt).toBe(1704067200000);
expect(response.samlConnection?.active).toBe(true);
expect(response.samlConnection?.forceAuthn).toBe(false);
expect(response.samlConnection?.loginHint).toEqual({
mode: 'custom_attribute',
source: 'employee_number',
});
expect(response.oauthConfig).not.toBeNull();
expect(response.oauthConfig?.providerKey).toBe('custom_oidc');
expect(response.oauthConfig?.clientId).toBe('client_abc');
expect(response.oauthConfig?.discoveryUrl).toBe('https://oauth.example.com/.well-known/openid-configuration');
expect(response.oauthConfig?.authUrl).toBe('https://oauth.example.com/authorize');
expect(response.oauthConfig?.tokenUrl).toBe('https://oauth.example.com/token');
expect(response.oauthConfig?.userInfoUrl).toBe('https://oauth.example.com/userinfo');
expect(response.oauthConfig?.requiresPkce).toBe(false);

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover omitted optional response fields.

This fixture populates every newly optional SAML/OAuth field and custom_attributes. Add a case omitting them and assert the resource exposes undefined; this locks in the intended serializer-omission behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts` around
lines 350 - 386, Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.

Source: Coding guidelines

Comment on lines +253 to +276
/**
* The identity provider (IdP) of the connection. For example, `'saml_custom'` or `'oidc_custom'`.
*/
readonly provider: string,
/**
* The public URL of the provider logo, if available.
*/
readonly logoPublicUrl: string | undefined,
/**
* Whether existing users who are members of the organization can link their account to their enterprise identity.
*/
readonly allowOrganizationAccountLinking: boolean,
/**
* Whether the connection can be used for sign-in and sign-up.
*/
readonly authenticatable: boolean,
/**
* Whether Just-in-Time (JIT) provisioning of users is disabled for the connection.
*/
readonly disableJitProvisioning: boolean,
/**
* The custom attribute mappings of the connection. Only returned when the custom attributes feature is enabled for the instance.
*/
readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined,

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
rg -n -C 4 '"version"|"exports"' packages/backend/package.json
ast-grep outline packages/backend/src/api/resources/EnterpriseConnection.ts --items all --type class
rg -n -C 3 '\bEnterpriseConnection(SamlConnection|OauthConfig)?\b' packages/backend/src/index.ts

Repository: clerk/javascript

Length of output: 1546


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## Constructor definitions\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | nl -ba | sed -n '1,340p'printf'\n## Direct usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig|)\b' packages/backend/src ||trueprintf'\n## Package entry exports around backend index\n'
sed -n '120,190p' packages/backend/src/index.ts | nl -ba | sed -n '1,120p'printf'\n## Changeset\n'
sed -n '1,80p' .changeset/major-poets-refuse.md | nl -ba | sed -n '1,80p'

Repository: clerk/javascript

Length of output: 222


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## EnterpriseConnection.ts constructors\n'
grep -nE '^export class (EnterpriseConnectionSamlConnectionLoginHint|EnterpriseConnectionCustomAttribute|EnterpriseConnectionSamlConnection|EnterpriseConnectionOauthConfig|EnterpriseConnection)\b|^ constructor\(' packages/backend/src/api/resources/EnterpriseConnection.ts
printf'\n## Relevant source around constructors\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | cat -n | sed -n '1,340p'printf'\n## Public exports from backend entry\n'
grep -nE 'EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?' packages/backend/src/index.ts
printf'\n## Direct constructor usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?\b' packages/backend/src ||trueprintf'\n## Changeset\n'
cat -n .changeset/major-poets-refuse.md

Repository: clerk/javascript

Length of output: 15917


Bump @clerk/backend to a major release

These exported constructors are part of the public API, so adding required trailing parameters is a breaking change. Update .changeset/major-poets-refuse.md to major, or make the new arguments backward-compatible.

  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • .changeset/major-poets-refuse.md
📍 Affects 2 files
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L253-L276 (this comment)
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L94-L99
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L159-L178
  • .changeset/major-poets-refuse.md#L2-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts` around lines 253
- 276, Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.

Source: Coding guidelines

@wobsorianowobsoriano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Re | undefined question: The old types were wrong. Any downstream code that breaks on upgrade was already unsafe at runtime.

If there's a compiler error then it's just surfacing existing bugs rather than creating new ones. Minor bump is perfect!

@manovotny
manovotny merged commit 23071bd into mainJul 27, 2026
51 checks passed
@manovotny
manovotny deleted the manovotny/enterprise-connection-response-alignment branch July 27, 2026 22:14
Sign up for freeto 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.

2 participants

@manovotny@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(backend): Align EnterpriseConnection resource with the Backend API response - #9156

Merged
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment
Jul 27, 2026
Merged

fix(backend): Align EnterpriseConnection resource with the Backend API response#9156
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment

Conversation

@manovotny

@manovotnymanovotny commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #9155. The EnterpriseConnection resource classes and JSON types drifted from what BAPI's serializer returns (clerk_goapi/serialize/enterprise_connection.go). Some properties read fields BAPI never sends — typed string/boolean but always undefined at runtime — and several returned fields were missing from the SDK.

What changed:

  • EnterpriseConnection now exposes provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.
  • EnterpriseConnectionSamlConnection now exposes active, forceAuthn, and loginHint (required and non-null — BAPI's serializer always sends it).
  • EnterpriseConnectionOauthConfig now exposes providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.
  • Phantom fields are deprecated, not removed: top-level allowSubdomains (only exists on the nested SAML connection) and nested idpMetadata/syncUserAttributes. Removing them would break positional constructor callers, so they keep their slots and gain @deprecated notices pointing at the real field.
  • organizationId is normalized to null when BAPI omits the key, making the declared string | null true at runtime.
  • Fields backed by pointer+omitempty in Go (oauthConfig.clientId, the SAML idp_* fields, certificate timestamps) are retyped | undefined to match runtime behavior.

New constructor params are appended after existing ones. Adding required constructor params to resource classes in a non-major release follows repo precedent (#1544 added hasImage mid-constructor as a minor); this ships as a minor for the same reason.

One review call worth a second opinion: the | undefined retyping is a compile-time change for consumers with strict null checks. It converts silent runtime undefineds into visible type errors, but it will surface in downstream builds on upgrade.

Note

Review surfaced an upstream gap: BAPI's EnterpriseConnectionResponse is missing the object discriminator its sibling serializers all send, so the SDK's deserializer (which switches on object) currently returns raw snake_case JSON for enterprise connection responses in production — fromJSON only runs in tests, where the mock supplies object. The mock keeps object deliberately: it exercises the SDK path that the existing ObjectType.EnterpriseConnection deserializer case defines, and matches the contract once clerk_go adds the field. The upstream fix is filed separately — ORGS-1765.

To test: pnpm --filter @clerk/backend test

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

manovotnyand others added 2 commits July 13, 2026 22:55
…onParams
The Backend API validates provider as required on enterprise connection
creation, so calls without it type-checked but failed at runtime.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntract
Reuses the OrganizationEnterpriseConnectionProvider union from
@clerk/shared/types (matching the sibling SamlConnectionApi pattern) and
adds type-level tests so provider can't silently become optional or widen
back to string.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef1c9ed

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendMinor
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jul 14, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJul 27, 2026 9:12pm
swingsetReadyReadyPreview, CommentJul 27, 2026 9:12pm

Request Review

@coderabbitai

coderabbitaiBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The EnterpriseConnection response contracts and resource parsers now support expanded SAML, OAuth, and top-level fields, including login hints, custom attributes, provider metadata, capability flags, and OAuth endpoints. Optional and deprecated properties were adjusted to match Backend API responses, and omitted organization_id values are normalized to null. Related exports, API fixtures, assertions, and a package changeset were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clerk/javascript#9155: Updates enterprise connection create/update parameter typings and request serialization for related SAML and OIDC shapes.
  • clerk/javascript#9200: Adds ConfigureSSO UI logic consuming the OIDC provider and OAuth configuration fields.

Suggested reviewers:laurabeatris, alexisintech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: aligning EnterpriseConnection with Backend API responses.
Description check✅ PassedThe description is directly related to the changeset and accurately explains the API alignment work.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

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

manovotnyand 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>
manovotnyand others added 2 commits July 13, 2026 23:41
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>
…sponse
The resource classes and JSON types drifted from BAPI's serializer
(clerk_go api/serialize/enterprise_connection.go): several properties
read fields BAPI never sends, and several returned fields were missing.
New constructor params are appended to preserve positional compatibility.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d bump to minor
Codex review: BAPI's serializer always sends login_hint (no omitempty,
never nil), so the JSON type and resource property are non-nullable.
Changeset bumped to minor to match repo precedent for new resource
properties (e.g. hasImage).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-newBot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9156

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9156

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9156

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9156

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9156

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9156

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9156

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9156

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9156

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9156

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9156

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9156

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9156

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9156

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9156

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9156

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9156

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9156

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9156

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9156

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9156

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9156

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9156

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9156

commit: ef1c9ed

@github-actions

github-actionsBot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-27T21:14:23.638Z

Summary

MetricCount
Packages analyzed19
Packages with changes1
🔴 Breaking changes18
🟡 Non-breaking changes16
🟢 Additions50

Warning
18 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (18)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/backend.EnterpriseConnection.undefined
@clerk/backend.EnterpriseConnection.allowSubdomains
@clerk/backend.EnterpriseConnectionOauthConfig.undefined
@clerk/backend.EnterpriseConnectionOauthConfig.clientId
@clerk/backend.EnterpriseConnectionOauthConfig.discoveryUrl
@clerk/backend.EnterpriseConnectionOauthConfig.logoPublicUrl
@clerk/backend.EnterpriseConnectionSamlConnection.undefined
@clerk/backend.EnterpriseConnectionSamlConnection.acsUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificate
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateExpiresAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateIssuedAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadata
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpSsoUrl
@clerk/backend.EnterpriseConnectionSamlConnection.spEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.spMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.syncUserAttributes

@clerk/backend

Current version: 3.13.1
Recommended bump: MAJOR → 4.0.0

🔴 Breaking Changes (18)

Changed: EnterpriseConnection.undefined

// ... 4 unchanged lines elided ...
organizationId: string | null, active: boolean, syncUserAttributes: boolean, - allowSubdomains: boolean, + allowSubdomains: boolean | undefined, 
disableAdditionalIdentifications: boolean, createdAt: number, updatedAt: number, samlConnection: EnterpriseConnectionSamlConnection | null, - oauthConfig: EnterpriseConnectionOauthConfig | null);+ oauthConfig: EnterpriseConnectionOauthConfig | null, + provider: string, + logoPublicUrl: string | undefined, + allowOrganizationAccountLinking: boolean, + authenticatable: boolean, + disableJitProvisioning: boolean, + customAttributes: EnterpriseConnectionCustomAttribute[] | undefined);

Static analyzer: Breaking change in constructor EnterpriseConnection.undefined: Parameter allowSubdomains type changed: booleanboolean|undefined; Required parameter provider was added; Required parameter logoPublicUrl was added; Required parameter allowOrganizationAccountLinking was added; Required parameter authenticatable was added; Required parameter disableJitProvisioning was added; Required parameter customAttributes was added

🤖 AI review (confirmed) (95%): New required parameters (provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, customAttributes) were added to the EnterpriseConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnection(...) calls to supply the newly required parameters: provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.

Changed: EnterpriseConnection.allowSubdomains

- readonly allowSubdomains: boolean;+ readonly allowSubdomains: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnection.allowSubdomains: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnection.allowSubdomains changed from boolean to boolean | undefined on an output property; consumers reading this property and expecting a non-nullable boolean will now receive a potentially undefined value, requiring null-checks.

Migration: Add an undefined guard wherever allowSubdomains is read, e.g. connection.allowSubdomains ?? false.

Changed: EnterpriseConnectionOauthConfig.undefined

 constructor(
id: string, name: string, - clientId: string, - discoveryUrl: string, - logoPublicUrl: string, + clientId: string | undefined, + discoveryUrl: string | undefined, + logoPublicUrl: string | undefined, 
createdAt: number, - updatedAt: number);+ updatedAt: number, + providerKey: string, + authUrl: string | undefined, + tokenUrl: string | undefined, + userInfoUrl: string | undefined, + requiresPkce: boolean);

Static analyzer: Breaking change in constructor EnterpriseConnectionOauthConfig.undefined: Parameter clientId type changed: stringstring|undefined; Parameter discoveryUrl type changed: stringstring|undefined; Parameter logoPublicUrl type changed: stringstring|undefined; Required parameter providerKey was added; Required parameter authUrl was added; Required parameter tokenUrl was added; Required parameter userInfoUrl was added; Required parameter requiresPkce was added

🤖 AI review (confirmed) (95%): New required parameters (providerKey, authUrl, tokenUrl, userInfoUrl, requiresPkce) were added to the EnterpriseConnectionOauthConfig constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionOauthConfig(...) calls to supply the newly required parameters: providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.

Changed: EnterpriseConnectionOauthConfig.clientId

- readonly clientId: string;+ readonly clientId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.clientId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.clientId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever clientId is read, e.g. config.clientId ?? ''.

Changed: EnterpriseConnectionOauthConfig.discoveryUrl

- readonly discoveryUrl: string;+ readonly discoveryUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.discoveryUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.discoveryUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever discoveryUrl is read, e.g. config.discoveryUrl ?? ''.

Changed: EnterpriseConnectionOauthConfig.logoPublicUrl

- readonly logoPublicUrl: string;+ readonly logoPublicUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.logoPublicUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.logoPublicUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever logoPublicUrl is read, e.g. config.logoPublicUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.undefined

 constructor(
id: string, name: string, - idpEntityId: string, - idpSsoUrl: string, - idpCertificate: string, - idpCertificateIssuedAt: number, - idpCertificateExpiresAt: number, - idpMetadataUrl: string, - idpMetadata: string, - acsUrl: string, - spEntityId: string, - spMetadataUrl: string, - syncUserAttributes: boolean, + idpEntityId: string | undefined, + idpSsoUrl: string | undefined, + idpCertificate: string | undefined, + idpCertificateIssuedAt: number | undefined, + idpCertificateExpiresAt: number | undefined, + idpMetadataUrl: string | undefined, + idpMetadata: string | undefined, + acsUrl: string | undefined, + spEntityId: string | undefined, + spMetadataUrl: string | undefined, + syncUserAttributes: boolean | undefined, 
allowSubdomains: boolean, - allowIdpInitiated: boolean);+ allowIdpInitiated: boolean, + active: boolean, + forceAuthn: boolean, + loginHint: EnterpriseConnectionSamlConnectionLoginHint);

Static analyzer: Breaking change in constructor EnterpriseConnectionSamlConnection.undefined: Parameter idpEntityId type changed: stringstring|undefined; Parameter idpSsoUrl type changed: stringstring|undefined; Parameter idpCertificate type changed: stringstring|undefined; Parameter idpCertificateIssuedAt type changed: numbernumber|undefined; Parameter idpCertificateExpiresAt type changed: numbernumber|undefined; Parameter idpMetadataUrl type changed: stringstring|undefined; Parameter idpMetadata type changed: stringstring|undefined; Parameter acsUrl type changed: stringstring|undefined; Parameter spEntityId type changed: stringstring|undefined; Parameter spMetadataUrl type changed: stringstring|undefined; Parameter syncUserAttributes type changed: booleanboolean|undefined; Required parameter active was added; Required parameter forceAuthn was added; Required parameter loginHint was added

🤖 AI review (confirmed) (95%): New required parameters (active, forceAuthn, loginHint) were added to the EnterpriseConnectionSamlConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionSamlConnection(...) calls to supply the newly required parameters: active, forceAuthn, and loginHint.

Changed: EnterpriseConnectionSamlConnection.acsUrl

- readonly acsUrl: string;+ readonly acsUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.acsUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.acsUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever acsUrl is read, e.g. conn.acsUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificate

- readonly idpCertificate: string;+ readonly idpCertificate: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificate: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificate changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificate is read, e.g. conn.idpCertificate ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificateExpiresAt

- readonly idpCertificateExpiresAt: number;+ readonly idpCertificateExpiresAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateExpiresAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateExpiresAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateExpiresAt is read, e.g. conn.idpCertificateExpiresAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpCertificateIssuedAt

- readonly idpCertificateIssuedAt: number;+ readonly idpCertificateIssuedAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateIssuedAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateIssuedAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateIssuedAt is read, e.g. conn.idpCertificateIssuedAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpEntityId

- readonly idpEntityId: string;+ readonly idpEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpEntityId is read, e.g. conn.idpEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadata

- readonly idpMetadata: string;+ readonly idpMetadata: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadata: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadata changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadata is read, e.g. conn.idpMetadata ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadataUrl

- readonly idpMetadataUrl: string;+ readonly idpMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadataUrl is read, e.g. conn.idpMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpSsoUrl

- readonly idpSsoUrl: string;+ readonly idpSsoUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpSsoUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpSsoUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpSsoUrl is read, e.g. conn.idpSsoUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.spEntityId

- readonly spEntityId: string;+ readonly spEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spEntityId is read, e.g. conn.spEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.spMetadataUrl

- readonly spMetadataUrl: string;+ readonly spMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spMetadataUrl is read, e.g. conn.spMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.syncUserAttributes

- readonly syncUserAttributes: boolean;+ readonly syncUserAttributes: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.syncUserAttributes: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.syncUserAttributes changed from boolean to boolean | undefined on an output property; consumers expecting a non-nullable boolean will now need to handle undefined.

Migration: Add an undefined guard wherever syncUserAttributes is read, e.g. conn.syncUserAttributes ?? false.

🟡 Non-breaking Changes (16)

Click to expand 16 changes

Modified: EnterpriseConnectionJSON.allow_subdomains

- allow_subdomains: boolean;+ allow_subdomains?: boolean;

Static analyzer: Modified property EnterpriseConnectionJSON.allow_subdomains: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.allow_subdomains becoming optional is a widening of an input/JSON interface; consumers constructing this type no longer need to supply the field, so no existing well-typed code breaks.

Modified: EnterpriseConnectionJSON.organization_id

- organization_id: string | null;+ organization_id?: string | null;

Static analyzer: Modified property EnterpriseConnectionJSON.organization_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.organization_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.client_id

- client_id: string;+ client_id?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.client_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.client_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.discovery_url

- discovery_url: string;+ discovery_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.discovery_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.discovery_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.logo_public_url

- logo_public_url: string;+ logo_public_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.logo_public_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.logo_public_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.acs_url

- acs_url: string;+ acs_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.acs_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.acs_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at

- idp_certificate_expires_at: number;+ idp_certificate_expires_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at

- idp_certificate_issued_at: number;+ idp_certificate_issued_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate

- idp_certificate: string;+ idp_certificate?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_entity_id

- idp_entity_id: string;+ idp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata_url

- idp_metadata_url: string;+ idp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata

- idp_metadata: string;+ idp_metadata?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_sso_url

- idp_sso_url: string;+ idp_sso_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_sso_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_sso_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_entity_id

- sp_entity_id: string;+ sp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_metadata_url

- sp_metadata_url: string;+ sp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sync_user_attributes

- sync_user_attributes: boolean;+ sync_user_attributes?: boolean;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sync_user_attributes: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sync_user_attributes becoming optional widens the input interface; existing code that already provides the field remains valid.

🟢 Additions (50)

Click to expand 50 changes

Added: EnterpriseConnection.allowOrganizationAccountLinking

+ readonly allowOrganizationAccountLinking: boolean;

Added property EnterpriseConnection.allowOrganizationAccountLinking

Added: EnterpriseConnection.authenticatable

+ readonly authenticatable: boolean;

Added property EnterpriseConnection.authenticatable

Added: EnterpriseConnection.customAttributes

+ readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined;

Added property EnterpriseConnection.customAttributes

Added: EnterpriseConnection.disableJitProvisioning

+ readonly disableJitProvisioning: boolean;

Added property EnterpriseConnection.disableJitProvisioning

Added: EnterpriseConnection.logoPublicUrl

+ readonly logoPublicUrl: string | undefined;

Added property EnterpriseConnection.logoPublicUrl

Added: EnterpriseConnection.provider

+ readonly provider: string;

Added property EnterpriseConnection.provider

Added: EnterpriseConnectionCustomAttribute

+ export declare class EnterpriseConnectionCustomAttribute

Added class EnterpriseConnectionCustomAttribute

Added: EnterpriseConnectionCustomAttribute.undefined

+ constructor(+ name: string, + key: string, + ssoPath: string, + scimPath: string, + multiValued: boolean);

Added constructor EnterpriseConnectionCustomAttribute.undefined

Added: EnterpriseConnectionCustomAttribute.fromJSON

+ static fromJSON(data: EnterpriseConnectionCustomAttributeJSON): EnterpriseConnectionCustomAttribute;

Added method EnterpriseConnectionCustomAttribute.fromJSON

Added: EnterpriseConnectionCustomAttribute.key

+ readonly key: string;

Added property EnterpriseConnectionCustomAttribute.key

Added: EnterpriseConnectionCustomAttribute.multiValued

+ readonly multiValued: boolean;

Added property EnterpriseConnectionCustomAttribute.multiValued

Added: EnterpriseConnectionCustomAttribute.name

+ readonly name: string;

Added property EnterpriseConnectionCustomAttribute.name

Added: EnterpriseConnectionCustomAttribute.scimPath

+ readonly scimPath: string;

Added property EnterpriseConnectionCustomAttribute.scimPath

Added: EnterpriseConnectionCustomAttribute.ssoPath

+ readonly ssoPath: string;

Added property EnterpriseConnectionCustomAttribute.ssoPath

Added: EnterpriseConnectionCustomAttributeJSON

+ export interface EnterpriseConnectionCustomAttributeJSON

Added interface EnterpriseConnectionCustomAttributeJSON

Added: EnterpriseConnectionCustomAttributeJSON.key

+ key: string;

Added property EnterpriseConnectionCustomAttributeJSON.key

Added: EnterpriseConnectionCustomAttributeJSON.multi_valued

+ multi_valued: boolean;

Added property EnterpriseConnectionCustomAttributeJSON.multi_valued

Added: EnterpriseConnectionCustomAttributeJSON.name

+ name: string;

Added property EnterpriseConnectionCustomAttributeJSON.name

Added: EnterpriseConnectionCustomAttributeJSON.scim_path

+ scim_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.scim_path

Added: EnterpriseConnectionCustomAttributeJSON.sso_path

+ sso_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.sso_path

Added: EnterpriseConnectionJSON.allow_organization_account_linking

+ allow_organization_account_linking: boolean;

Added property EnterpriseConnectionJSON.allow_organization_account_linking

Added: EnterpriseConnectionJSON.authenticatable

+ authenticatable: boolean;

Added property EnterpriseConnectionJSON.authenticatable

Added: EnterpriseConnectionJSON.custom_attributes

+ custom_attributes?: EnterpriseConnectionCustomAttributeJSON[];

Added property EnterpriseConnectionJSON.custom_attributes

Added: EnterpriseConnectionJSON.disable_jit_provisioning

+ disable_jit_provisioning: boolean;

Added property EnterpriseConnectionJSON.disable_jit_provisioning

Added: EnterpriseConnectionJSON.logo_public_url

+ logo_public_url?: string;

Added property EnterpriseConnectionJSON.logo_public_url

Added: EnterpriseConnectionJSON.provider

+ provider: string;

Added property EnterpriseConnectionJSON.provider

Added: EnterpriseConnectionOauthConfig.authUrl

+ readonly authUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.authUrl

Added: EnterpriseConnectionOauthConfig.providerKey

+ readonly providerKey: string;

Added property EnterpriseConnectionOauthConfig.providerKey

Added: EnterpriseConnectionOauthConfig.requiresPkce

+ readonly requiresPkce: boolean;

Added property EnterpriseConnectionOauthConfig.requiresPkce

Added: EnterpriseConnectionOauthConfig.tokenUrl

+ readonly tokenUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.tokenUrl

Added: EnterpriseConnectionOauthConfig.userInfoUrl

+ readonly userInfoUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.userInfoUrl

Added: EnterpriseConnectionOauthConfigJSON.auth_url

+ auth_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.auth_url

Added: EnterpriseConnectionOauthConfigJSON.provider_key

+ provider_key: string;

Added property EnterpriseConnectionOauthConfigJSON.provider_key

Added: EnterpriseConnectionOauthConfigJSON.requires_pkce

+ requires_pkce: boolean;

Added property EnterpriseConnectionOauthConfigJSON.requires_pkce

Added: EnterpriseConnectionOauthConfigJSON.token_url

+ token_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.token_url

Added: EnterpriseConnectionOauthConfigJSON.user_info_url

+ user_info_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.user_info_url

Added: EnterpriseConnectionSamlConnection.active

+ readonly active: boolean;

Added property EnterpriseConnectionSamlConnection.active

Added: EnterpriseConnectionSamlConnection.forceAuthn

+ readonly forceAuthn: boolean;

Added property EnterpriseConnectionSamlConnection.forceAuthn

Added: EnterpriseConnectionSamlConnection.loginHint

+ readonly loginHint: EnterpriseConnectionSamlConnectionLoginHint;

Added property EnterpriseConnectionSamlConnection.loginHint

Added: EnterpriseConnectionSamlConnectionJSON.active

+ active: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.active

Added: EnterpriseConnectionSamlConnectionJSON.force_authn

+ force_authn: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.force_authn

Added: EnterpriseConnectionSamlConnectionJSON.login_hint

+ login_hint: EnterpriseConnectionSamlConnectionLoginHintJSON;

Added property EnterpriseConnectionSamlConnectionJSON.login_hint

Added: EnterpriseConnectionSamlConnectionLoginHint

+ export declare class EnterpriseConnectionSamlConnectionLoginHint

Added class EnterpriseConnectionSamlConnectionLoginHint

Added: EnterpriseConnectionSamlConnectionLoginHint.undefined

+ constructor(+ mode: 'email_address' | 'custom_attribute' | 'off', + source?: string | undefined);

Added constructor EnterpriseConnectionSamlConnectionLoginHint.undefined

Added: EnterpriseConnectionSamlConnectionLoginHint.fromJSON

+ static fromJSON(data: EnterpriseConnectionSamlConnectionLoginHintJSON): EnterpriseConnectionSamlConnectionLoginHint;

Added method EnterpriseConnectionSamlConnectionLoginHint.fromJSON

Added: EnterpriseConnectionSamlConnectionLoginHint.mode

+ readonly mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHint.mode

Added: EnterpriseConnectionSamlConnectionLoginHint.source

+ readonly source?: string | undefined;

Added property EnterpriseConnectionSamlConnectionLoginHint.source

Added: EnterpriseConnectionSamlConnectionLoginHintJSON

+ export interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.mode

+ mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.mode

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.source

+ source?: string;

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.source


Report generated by Break Check

Last ran on ef1c9ed.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts`:
- Around line 350-386: Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts`:
- Around line 253-276: Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 104cd8a9-6a61-4602-875c-723186eda94d

📥 Commits

Reviewing files that changed from the base of the PR and between c904fb4 and f2a4865.

📒 Files selected for processing (5)
  • .changeset/major-poets-refuse.md
  • packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts
  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go(manual)
  • clerk/dashboard(manual)
  • clerk/accounts(manual)
  • clerk/backoffice(manual)
  • clerk/clerk(manual)
  • clerk/clerk-docs(manual)
  • clerk/cloudflare-workers(manual)

Comment on lines +350 to +386
expect(response.provider).toBe('saml_custom');
expect(response.logoPublicUrl).toBe('https://img.example.com/connection-logo.png');
expect(response.domains).toEqual(['clerk.dev']);
expect(response.active).toBe(true);
// organization_id is omitted by the Backend API when unset and normalized to null
expect(response.organizationId).toBeNull();
expect(response.allowOrganizationAccountLinking).toBe(true);
expect(response.authenticatable).toBe(true);
expect(response.disableJitProvisioning).toBe(false);
expect(response.customAttributes).toEqual([
{
name: 'Employee Number',
key: 'employee_number',
ssoPath: 'user.employeeNumber',
scimPath: '',
multiValued: false,
},
]);
expect(response.samlConnection).not.toBeNull();
expect(response.samlConnection?.id).toBe('samlc_1');
expect(response.samlConnection?.idpEntityId).toBe('https://idp.example.com');
expect(response.samlConnection?.idpCertificateIssuedAt).toBe(1672531200000);
expect(response.samlConnection?.idpCertificateExpiresAt).toBe(1704067200000);
expect(response.samlConnection?.active).toBe(true);
expect(response.samlConnection?.forceAuthn).toBe(false);
expect(response.samlConnection?.loginHint).toEqual({
mode: 'custom_attribute',
source: 'employee_number',
});
expect(response.oauthConfig).not.toBeNull();
expect(response.oauthConfig?.providerKey).toBe('custom_oidc');
expect(response.oauthConfig?.clientId).toBe('client_abc');
expect(response.oauthConfig?.discoveryUrl).toBe('https://oauth.example.com/.well-known/openid-configuration');
expect(response.oauthConfig?.authUrl).toBe('https://oauth.example.com/authorize');
expect(response.oauthConfig?.tokenUrl).toBe('https://oauth.example.com/token');
expect(response.oauthConfig?.userInfoUrl).toBe('https://oauth.example.com/userinfo');
expect(response.oauthConfig?.requiresPkce).toBe(false);

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover omitted optional response fields.

This fixture populates every newly optional SAML/OAuth field and custom_attributes. Add a case omitting them and assert the resource exposes undefined; this locks in the intended serializer-omission behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts` around
lines 350 - 386, Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.

Source: Coding guidelines

Comment on lines +253 to +276
/**
* The identity provider (IdP) of the connection. For example, `'saml_custom'` or `'oidc_custom'`.
*/
readonly provider: string,
/**
* The public URL of the provider logo, if available.
*/
readonly logoPublicUrl: string | undefined,
/**
* Whether existing users who are members of the organization can link their account to their enterprise identity.
*/
readonly allowOrganizationAccountLinking: boolean,
/**
* Whether the connection can be used for sign-in and sign-up.
*/
readonly authenticatable: boolean,
/**
* Whether Just-in-Time (JIT) provisioning of users is disabled for the connection.
*/
readonly disableJitProvisioning: boolean,
/**
* The custom attribute mappings of the connection. Only returned when the custom attributes feature is enabled for the instance.
*/
readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined,

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
rg -n -C 4 '"version"|"exports"' packages/backend/package.json
ast-grep outline packages/backend/src/api/resources/EnterpriseConnection.ts --items all --type class
rg -n -C 3 '\bEnterpriseConnection(SamlConnection|OauthConfig)?\b' packages/backend/src/index.ts

Repository: clerk/javascript

Length of output: 1546


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## Constructor definitions\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | nl -ba | sed -n '1,340p'printf'\n## Direct usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig|)\b' packages/backend/src ||trueprintf'\n## Package entry exports around backend index\n'
sed -n '120,190p' packages/backend/src/index.ts | nl -ba | sed -n '1,120p'printf'\n## Changeset\n'
sed -n '1,80p' .changeset/major-poets-refuse.md | nl -ba | sed -n '1,80p'

Repository: clerk/javascript

Length of output: 222


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## EnterpriseConnection.ts constructors\n'
grep -nE '^export class (EnterpriseConnectionSamlConnectionLoginHint|EnterpriseConnectionCustomAttribute|EnterpriseConnectionSamlConnection|EnterpriseConnectionOauthConfig|EnterpriseConnection)\b|^ constructor\(' packages/backend/src/api/resources/EnterpriseConnection.ts
printf'\n## Relevant source around constructors\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | cat -n | sed -n '1,340p'printf'\n## Public exports from backend entry\n'
grep -nE 'EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?' packages/backend/src/index.ts
printf'\n## Direct constructor usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?\b' packages/backend/src ||trueprintf'\n## Changeset\n'
cat -n .changeset/major-poets-refuse.md

Repository: clerk/javascript

Length of output: 15917


Bump @clerk/backend to a major release

These exported constructors are part of the public API, so adding required trailing parameters is a breaking change. Update .changeset/major-poets-refuse.md to major, or make the new arguments backward-compatible.

  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • .changeset/major-poets-refuse.md
📍 Affects 2 files
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L253-L276 (this comment)
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L94-L99
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L159-L178
  • .changeset/major-poets-refuse.md#L2-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts` around lines 253
- 276, Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.

Source: Coding guidelines

@wobsorianowobsoriano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Re | undefined question: The old types were wrong. Any downstream code that breaks on upgrade was already unsafe at runtime.

If there's a compiler error then it's just surfacing existing bugs rather than creating new ones. Minor bump is perfect!

@manovotny
manovotny merged commit 23071bd into mainJul 27, 2026
51 checks passed
@manovotny
manovotny deleted the manovotny/enterprise-connection-response-alignment branch July 27, 2026 22:14
Sign up for freeto 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.

2 participants

@manovotny@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(backend): Align EnterpriseConnection resource with the Backend API response - #9156

Merged
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment
Jul 27, 2026
Merged

fix(backend): Align EnterpriseConnection resource with the Backend API response#9156
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment

Conversation

@manovotny

@manovotnymanovotny commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #9155. The EnterpriseConnection resource classes and JSON types drifted from what BAPI's serializer returns (clerk_goapi/serialize/enterprise_connection.go). Some properties read fields BAPI never sends — typed string/boolean but always undefined at runtime — and several returned fields were missing from the SDK.

What changed:

  • EnterpriseConnection now exposes provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.
  • EnterpriseConnectionSamlConnection now exposes active, forceAuthn, and loginHint (required and non-null — BAPI's serializer always sends it).
  • EnterpriseConnectionOauthConfig now exposes providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.
  • Phantom fields are deprecated, not removed: top-level allowSubdomains (only exists on the nested SAML connection) and nested idpMetadata/syncUserAttributes. Removing them would break positional constructor callers, so they keep their slots and gain @deprecated notices pointing at the real field.
  • organizationId is normalized to null when BAPI omits the key, making the declared string | null true at runtime.
  • Fields backed by pointer+omitempty in Go (oauthConfig.clientId, the SAML idp_* fields, certificate timestamps) are retyped | undefined to match runtime behavior.

New constructor params are appended after existing ones. Adding required constructor params to resource classes in a non-major release follows repo precedent (#1544 added hasImage mid-constructor as a minor); this ships as a minor for the same reason.

One review call worth a second opinion: the | undefined retyping is a compile-time change for consumers with strict null checks. It converts silent runtime undefineds into visible type errors, but it will surface in downstream builds on upgrade.

Note

Review surfaced an upstream gap: BAPI's EnterpriseConnectionResponse is missing the object discriminator its sibling serializers all send, so the SDK's deserializer (which switches on object) currently returns raw snake_case JSON for enterprise connection responses in production — fromJSON only runs in tests, where the mock supplies object. The mock keeps object deliberately: it exercises the SDK path that the existing ObjectType.EnterpriseConnection deserializer case defines, and matches the contract once clerk_go adds the field. The upstream fix is filed separately — ORGS-1765.

To test: pnpm --filter @clerk/backend test

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

manovotnyand others added 2 commits July 13, 2026 22:55
…onParams
The Backend API validates provider as required on enterprise connection
creation, so calls without it type-checked but failed at runtime.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntract
Reuses the OrganizationEnterpriseConnectionProvider union from
@clerk/shared/types (matching the sibling SamlConnectionApi pattern) and
adds type-level tests so provider can't silently become optional or widen
back to string.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef1c9ed

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendMinor
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jul 14, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJul 27, 2026 9:12pm
swingsetReadyReadyPreview, CommentJul 27, 2026 9:12pm

Request Review

@coderabbitai

coderabbitaiBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The EnterpriseConnection response contracts and resource parsers now support expanded SAML, OAuth, and top-level fields, including login hints, custom attributes, provider metadata, capability flags, and OAuth endpoints. Optional and deprecated properties were adjusted to match Backend API responses, and omitted organization_id values are normalized to null. Related exports, API fixtures, assertions, and a package changeset were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clerk/javascript#9155: Updates enterprise connection create/update parameter typings and request serialization for related SAML and OIDC shapes.
  • clerk/javascript#9200: Adds ConfigureSSO UI logic consuming the OIDC provider and OAuth configuration fields.

Suggested reviewers:laurabeatris, alexisintech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: aligning EnterpriseConnection with Backend API responses.
Description check✅ PassedThe description is directly related to the changeset and accurately explains the API alignment work.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

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

manovotnyand 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>
manovotnyand others added 2 commits July 13, 2026 23:41
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>
…sponse
The resource classes and JSON types drifted from BAPI's serializer
(clerk_go api/serialize/enterprise_connection.go): several properties
read fields BAPI never sends, and several returned fields were missing.
New constructor params are appended to preserve positional compatibility.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d bump to minor
Codex review: BAPI's serializer always sends login_hint (no omitempty,
never nil), so the JSON type and resource property are non-nullable.
Changeset bumped to minor to match repo precedent for new resource
properties (e.g. hasImage).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-newBot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9156

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9156

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9156

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9156

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9156

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9156

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9156

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9156

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9156

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9156

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9156

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9156

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9156

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9156

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9156

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9156

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9156

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9156

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9156

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9156

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9156

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9156

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9156

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9156

commit: ef1c9ed

@github-actions

github-actionsBot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-27T21:14:23.638Z

Summary

MetricCount
Packages analyzed19
Packages with changes1
🔴 Breaking changes18
🟡 Non-breaking changes16
🟢 Additions50

Warning
18 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (18)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/backend.EnterpriseConnection.undefined
@clerk/backend.EnterpriseConnection.allowSubdomains
@clerk/backend.EnterpriseConnectionOauthConfig.undefined
@clerk/backend.EnterpriseConnectionOauthConfig.clientId
@clerk/backend.EnterpriseConnectionOauthConfig.discoveryUrl
@clerk/backend.EnterpriseConnectionOauthConfig.logoPublicUrl
@clerk/backend.EnterpriseConnectionSamlConnection.undefined
@clerk/backend.EnterpriseConnectionSamlConnection.acsUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificate
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateExpiresAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateIssuedAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadata
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpSsoUrl
@clerk/backend.EnterpriseConnectionSamlConnection.spEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.spMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.syncUserAttributes

@clerk/backend

Current version: 3.13.1
Recommended bump: MAJOR → 4.0.0

🔴 Breaking Changes (18)

Changed: EnterpriseConnection.undefined

// ... 4 unchanged lines elided ...
organizationId: string | null, active: boolean, syncUserAttributes: boolean, - allowSubdomains: boolean, + allowSubdomains: boolean | undefined, 
disableAdditionalIdentifications: boolean, createdAt: number, updatedAt: number, samlConnection: EnterpriseConnectionSamlConnection | null, - oauthConfig: EnterpriseConnectionOauthConfig | null);+ oauthConfig: EnterpriseConnectionOauthConfig | null, + provider: string, + logoPublicUrl: string | undefined, + allowOrganizationAccountLinking: boolean, + authenticatable: boolean, + disableJitProvisioning: boolean, + customAttributes: EnterpriseConnectionCustomAttribute[] | undefined);

Static analyzer: Breaking change in constructor EnterpriseConnection.undefined: Parameter allowSubdomains type changed: booleanboolean|undefined; Required parameter provider was added; Required parameter logoPublicUrl was added; Required parameter allowOrganizationAccountLinking was added; Required parameter authenticatable was added; Required parameter disableJitProvisioning was added; Required parameter customAttributes was added

🤖 AI review (confirmed) (95%): New required parameters (provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, customAttributes) were added to the EnterpriseConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnection(...) calls to supply the newly required parameters: provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.

Changed: EnterpriseConnection.allowSubdomains

- readonly allowSubdomains: boolean;+ readonly allowSubdomains: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnection.allowSubdomains: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnection.allowSubdomains changed from boolean to boolean | undefined on an output property; consumers reading this property and expecting a non-nullable boolean will now receive a potentially undefined value, requiring null-checks.

Migration: Add an undefined guard wherever allowSubdomains is read, e.g. connection.allowSubdomains ?? false.

Changed: EnterpriseConnectionOauthConfig.undefined

 constructor(
id: string, name: string, - clientId: string, - discoveryUrl: string, - logoPublicUrl: string, + clientId: string | undefined, + discoveryUrl: string | undefined, + logoPublicUrl: string | undefined, 
createdAt: number, - updatedAt: number);+ updatedAt: number, + providerKey: string, + authUrl: string | undefined, + tokenUrl: string | undefined, + userInfoUrl: string | undefined, + requiresPkce: boolean);

Static analyzer: Breaking change in constructor EnterpriseConnectionOauthConfig.undefined: Parameter clientId type changed: stringstring|undefined; Parameter discoveryUrl type changed: stringstring|undefined; Parameter logoPublicUrl type changed: stringstring|undefined; Required parameter providerKey was added; Required parameter authUrl was added; Required parameter tokenUrl was added; Required parameter userInfoUrl was added; Required parameter requiresPkce was added

🤖 AI review (confirmed) (95%): New required parameters (providerKey, authUrl, tokenUrl, userInfoUrl, requiresPkce) were added to the EnterpriseConnectionOauthConfig constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionOauthConfig(...) calls to supply the newly required parameters: providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.

Changed: EnterpriseConnectionOauthConfig.clientId

- readonly clientId: string;+ readonly clientId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.clientId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.clientId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever clientId is read, e.g. config.clientId ?? ''.

Changed: EnterpriseConnectionOauthConfig.discoveryUrl

- readonly discoveryUrl: string;+ readonly discoveryUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.discoveryUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.discoveryUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever discoveryUrl is read, e.g. config.discoveryUrl ?? ''.

Changed: EnterpriseConnectionOauthConfig.logoPublicUrl

- readonly logoPublicUrl: string;+ readonly logoPublicUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.logoPublicUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.logoPublicUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever logoPublicUrl is read, e.g. config.logoPublicUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.undefined

 constructor(
id: string, name: string, - idpEntityId: string, - idpSsoUrl: string, - idpCertificate: string, - idpCertificateIssuedAt: number, - idpCertificateExpiresAt: number, - idpMetadataUrl: string, - idpMetadata: string, - acsUrl: string, - spEntityId: string, - spMetadataUrl: string, - syncUserAttributes: boolean, + idpEntityId: string | undefined, + idpSsoUrl: string | undefined, + idpCertificate: string | undefined, + idpCertificateIssuedAt: number | undefined, + idpCertificateExpiresAt: number | undefined, + idpMetadataUrl: string | undefined, + idpMetadata: string | undefined, + acsUrl: string | undefined, + spEntityId: string | undefined, + spMetadataUrl: string | undefined, + syncUserAttributes: boolean | undefined, 
allowSubdomains: boolean, - allowIdpInitiated: boolean);+ allowIdpInitiated: boolean, + active: boolean, + forceAuthn: boolean, + loginHint: EnterpriseConnectionSamlConnectionLoginHint);

Static analyzer: Breaking change in constructor EnterpriseConnectionSamlConnection.undefined: Parameter idpEntityId type changed: stringstring|undefined; Parameter idpSsoUrl type changed: stringstring|undefined; Parameter idpCertificate type changed: stringstring|undefined; Parameter idpCertificateIssuedAt type changed: numbernumber|undefined; Parameter idpCertificateExpiresAt type changed: numbernumber|undefined; Parameter idpMetadataUrl type changed: stringstring|undefined; Parameter idpMetadata type changed: stringstring|undefined; Parameter acsUrl type changed: stringstring|undefined; Parameter spEntityId type changed: stringstring|undefined; Parameter spMetadataUrl type changed: stringstring|undefined; Parameter syncUserAttributes type changed: booleanboolean|undefined; Required parameter active was added; Required parameter forceAuthn was added; Required parameter loginHint was added

🤖 AI review (confirmed) (95%): New required parameters (active, forceAuthn, loginHint) were added to the EnterpriseConnectionSamlConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionSamlConnection(...) calls to supply the newly required parameters: active, forceAuthn, and loginHint.

Changed: EnterpriseConnectionSamlConnection.acsUrl

- readonly acsUrl: string;+ readonly acsUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.acsUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.acsUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever acsUrl is read, e.g. conn.acsUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificate

- readonly idpCertificate: string;+ readonly idpCertificate: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificate: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificate changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificate is read, e.g. conn.idpCertificate ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificateExpiresAt

- readonly idpCertificateExpiresAt: number;+ readonly idpCertificateExpiresAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateExpiresAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateExpiresAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateExpiresAt is read, e.g. conn.idpCertificateExpiresAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpCertificateIssuedAt

- readonly idpCertificateIssuedAt: number;+ readonly idpCertificateIssuedAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateIssuedAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateIssuedAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateIssuedAt is read, e.g. conn.idpCertificateIssuedAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpEntityId

- readonly idpEntityId: string;+ readonly idpEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpEntityId is read, e.g. conn.idpEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadata

- readonly idpMetadata: string;+ readonly idpMetadata: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadata: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadata changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadata is read, e.g. conn.idpMetadata ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadataUrl

- readonly idpMetadataUrl: string;+ readonly idpMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadataUrl is read, e.g. conn.idpMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpSsoUrl

- readonly idpSsoUrl: string;+ readonly idpSsoUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpSsoUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpSsoUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpSsoUrl is read, e.g. conn.idpSsoUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.spEntityId

- readonly spEntityId: string;+ readonly spEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spEntityId is read, e.g. conn.spEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.spMetadataUrl

- readonly spMetadataUrl: string;+ readonly spMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spMetadataUrl is read, e.g. conn.spMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.syncUserAttributes

- readonly syncUserAttributes: boolean;+ readonly syncUserAttributes: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.syncUserAttributes: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.syncUserAttributes changed from boolean to boolean | undefined on an output property; consumers expecting a non-nullable boolean will now need to handle undefined.

Migration: Add an undefined guard wherever syncUserAttributes is read, e.g. conn.syncUserAttributes ?? false.

🟡 Non-breaking Changes (16)

Click to expand 16 changes

Modified: EnterpriseConnectionJSON.allow_subdomains

- allow_subdomains: boolean;+ allow_subdomains?: boolean;

Static analyzer: Modified property EnterpriseConnectionJSON.allow_subdomains: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.allow_subdomains becoming optional is a widening of an input/JSON interface; consumers constructing this type no longer need to supply the field, so no existing well-typed code breaks.

Modified: EnterpriseConnectionJSON.organization_id

- organization_id: string | null;+ organization_id?: string | null;

Static analyzer: Modified property EnterpriseConnectionJSON.organization_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.organization_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.client_id

- client_id: string;+ client_id?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.client_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.client_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.discovery_url

- discovery_url: string;+ discovery_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.discovery_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.discovery_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.logo_public_url

- logo_public_url: string;+ logo_public_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.logo_public_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.logo_public_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.acs_url

- acs_url: string;+ acs_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.acs_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.acs_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at

- idp_certificate_expires_at: number;+ idp_certificate_expires_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at

- idp_certificate_issued_at: number;+ idp_certificate_issued_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate

- idp_certificate: string;+ idp_certificate?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_entity_id

- idp_entity_id: string;+ idp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata_url

- idp_metadata_url: string;+ idp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata

- idp_metadata: string;+ idp_metadata?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_sso_url

- idp_sso_url: string;+ idp_sso_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_sso_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_sso_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_entity_id

- sp_entity_id: string;+ sp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_metadata_url

- sp_metadata_url: string;+ sp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sync_user_attributes

- sync_user_attributes: boolean;+ sync_user_attributes?: boolean;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sync_user_attributes: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sync_user_attributes becoming optional widens the input interface; existing code that already provides the field remains valid.

🟢 Additions (50)

Click to expand 50 changes

Added: EnterpriseConnection.allowOrganizationAccountLinking

+ readonly allowOrganizationAccountLinking: boolean;

Added property EnterpriseConnection.allowOrganizationAccountLinking

Added: EnterpriseConnection.authenticatable

+ readonly authenticatable: boolean;

Added property EnterpriseConnection.authenticatable

Added: EnterpriseConnection.customAttributes

+ readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined;

Added property EnterpriseConnection.customAttributes

Added: EnterpriseConnection.disableJitProvisioning

+ readonly disableJitProvisioning: boolean;

Added property EnterpriseConnection.disableJitProvisioning

Added: EnterpriseConnection.logoPublicUrl

+ readonly logoPublicUrl: string | undefined;

Added property EnterpriseConnection.logoPublicUrl

Added: EnterpriseConnection.provider

+ readonly provider: string;

Added property EnterpriseConnection.provider

Added: EnterpriseConnectionCustomAttribute

+ export declare class EnterpriseConnectionCustomAttribute

Added class EnterpriseConnectionCustomAttribute

Added: EnterpriseConnectionCustomAttribute.undefined

+ constructor(+ name: string, + key: string, + ssoPath: string, + scimPath: string, + multiValued: boolean);

Added constructor EnterpriseConnectionCustomAttribute.undefined

Added: EnterpriseConnectionCustomAttribute.fromJSON

+ static fromJSON(data: EnterpriseConnectionCustomAttributeJSON): EnterpriseConnectionCustomAttribute;

Added method EnterpriseConnectionCustomAttribute.fromJSON

Added: EnterpriseConnectionCustomAttribute.key

+ readonly key: string;

Added property EnterpriseConnectionCustomAttribute.key

Added: EnterpriseConnectionCustomAttribute.multiValued

+ readonly multiValued: boolean;

Added property EnterpriseConnectionCustomAttribute.multiValued

Added: EnterpriseConnectionCustomAttribute.name

+ readonly name: string;

Added property EnterpriseConnectionCustomAttribute.name

Added: EnterpriseConnectionCustomAttribute.scimPath

+ readonly scimPath: string;

Added property EnterpriseConnectionCustomAttribute.scimPath

Added: EnterpriseConnectionCustomAttribute.ssoPath

+ readonly ssoPath: string;

Added property EnterpriseConnectionCustomAttribute.ssoPath

Added: EnterpriseConnectionCustomAttributeJSON

+ export interface EnterpriseConnectionCustomAttributeJSON

Added interface EnterpriseConnectionCustomAttributeJSON

Added: EnterpriseConnectionCustomAttributeJSON.key

+ key: string;

Added property EnterpriseConnectionCustomAttributeJSON.key

Added: EnterpriseConnectionCustomAttributeJSON.multi_valued

+ multi_valued: boolean;

Added property EnterpriseConnectionCustomAttributeJSON.multi_valued

Added: EnterpriseConnectionCustomAttributeJSON.name

+ name: string;

Added property EnterpriseConnectionCustomAttributeJSON.name

Added: EnterpriseConnectionCustomAttributeJSON.scim_path

+ scim_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.scim_path

Added: EnterpriseConnectionCustomAttributeJSON.sso_path

+ sso_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.sso_path

Added: EnterpriseConnectionJSON.allow_organization_account_linking

+ allow_organization_account_linking: boolean;

Added property EnterpriseConnectionJSON.allow_organization_account_linking

Added: EnterpriseConnectionJSON.authenticatable

+ authenticatable: boolean;

Added property EnterpriseConnectionJSON.authenticatable

Added: EnterpriseConnectionJSON.custom_attributes

+ custom_attributes?: EnterpriseConnectionCustomAttributeJSON[];

Added property EnterpriseConnectionJSON.custom_attributes

Added: EnterpriseConnectionJSON.disable_jit_provisioning

+ disable_jit_provisioning: boolean;

Added property EnterpriseConnectionJSON.disable_jit_provisioning

Added: EnterpriseConnectionJSON.logo_public_url

+ logo_public_url?: string;

Added property EnterpriseConnectionJSON.logo_public_url

Added: EnterpriseConnectionJSON.provider

+ provider: string;

Added property EnterpriseConnectionJSON.provider

Added: EnterpriseConnectionOauthConfig.authUrl

+ readonly authUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.authUrl

Added: EnterpriseConnectionOauthConfig.providerKey

+ readonly providerKey: string;

Added property EnterpriseConnectionOauthConfig.providerKey

Added: EnterpriseConnectionOauthConfig.requiresPkce

+ readonly requiresPkce: boolean;

Added property EnterpriseConnectionOauthConfig.requiresPkce

Added: EnterpriseConnectionOauthConfig.tokenUrl

+ readonly tokenUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.tokenUrl

Added: EnterpriseConnectionOauthConfig.userInfoUrl

+ readonly userInfoUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.userInfoUrl

Added: EnterpriseConnectionOauthConfigJSON.auth_url

+ auth_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.auth_url

Added: EnterpriseConnectionOauthConfigJSON.provider_key

+ provider_key: string;

Added property EnterpriseConnectionOauthConfigJSON.provider_key

Added: EnterpriseConnectionOauthConfigJSON.requires_pkce

+ requires_pkce: boolean;

Added property EnterpriseConnectionOauthConfigJSON.requires_pkce

Added: EnterpriseConnectionOauthConfigJSON.token_url

+ token_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.token_url

Added: EnterpriseConnectionOauthConfigJSON.user_info_url

+ user_info_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.user_info_url

Added: EnterpriseConnectionSamlConnection.active

+ readonly active: boolean;

Added property EnterpriseConnectionSamlConnection.active

Added: EnterpriseConnectionSamlConnection.forceAuthn

+ readonly forceAuthn: boolean;

Added property EnterpriseConnectionSamlConnection.forceAuthn

Added: EnterpriseConnectionSamlConnection.loginHint

+ readonly loginHint: EnterpriseConnectionSamlConnectionLoginHint;

Added property EnterpriseConnectionSamlConnection.loginHint

Added: EnterpriseConnectionSamlConnectionJSON.active

+ active: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.active

Added: EnterpriseConnectionSamlConnectionJSON.force_authn

+ force_authn: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.force_authn

Added: EnterpriseConnectionSamlConnectionJSON.login_hint

+ login_hint: EnterpriseConnectionSamlConnectionLoginHintJSON;

Added property EnterpriseConnectionSamlConnectionJSON.login_hint

Added: EnterpriseConnectionSamlConnectionLoginHint

+ export declare class EnterpriseConnectionSamlConnectionLoginHint

Added class EnterpriseConnectionSamlConnectionLoginHint

Added: EnterpriseConnectionSamlConnectionLoginHint.undefined

+ constructor(+ mode: 'email_address' | 'custom_attribute' | 'off', + source?: string | undefined);

Added constructor EnterpriseConnectionSamlConnectionLoginHint.undefined

Added: EnterpriseConnectionSamlConnectionLoginHint.fromJSON

+ static fromJSON(data: EnterpriseConnectionSamlConnectionLoginHintJSON): EnterpriseConnectionSamlConnectionLoginHint;

Added method EnterpriseConnectionSamlConnectionLoginHint.fromJSON

Added: EnterpriseConnectionSamlConnectionLoginHint.mode

+ readonly mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHint.mode

Added: EnterpriseConnectionSamlConnectionLoginHint.source

+ readonly source?: string | undefined;

Added property EnterpriseConnectionSamlConnectionLoginHint.source

Added: EnterpriseConnectionSamlConnectionLoginHintJSON

+ export interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.mode

+ mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.mode

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.source

+ source?: string;

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.source


Report generated by Break Check

Last ran on ef1c9ed.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts`:
- Around line 350-386: Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts`:
- Around line 253-276: Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 104cd8a9-6a61-4602-875c-723186eda94d

📥 Commits

Reviewing files that changed from the base of the PR and between c904fb4 and f2a4865.

📒 Files selected for processing (5)
  • .changeset/major-poets-refuse.md
  • packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts
  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go(manual)
  • clerk/dashboard(manual)
  • clerk/accounts(manual)
  • clerk/backoffice(manual)
  • clerk/clerk(manual)
  • clerk/clerk-docs(manual)
  • clerk/cloudflare-workers(manual)

Comment on lines +350 to +386
expect(response.provider).toBe('saml_custom');
expect(response.logoPublicUrl).toBe('https://img.example.com/connection-logo.png');
expect(response.domains).toEqual(['clerk.dev']);
expect(response.active).toBe(true);
// organization_id is omitted by the Backend API when unset and normalized to null
expect(response.organizationId).toBeNull();
expect(response.allowOrganizationAccountLinking).toBe(true);
expect(response.authenticatable).toBe(true);
expect(response.disableJitProvisioning).toBe(false);
expect(response.customAttributes).toEqual([
{
name: 'Employee Number',
key: 'employee_number',
ssoPath: 'user.employeeNumber',
scimPath: '',
multiValued: false,
},
]);
expect(response.samlConnection).not.toBeNull();
expect(response.samlConnection?.id).toBe('samlc_1');
expect(response.samlConnection?.idpEntityId).toBe('https://idp.example.com');
expect(response.samlConnection?.idpCertificateIssuedAt).toBe(1672531200000);
expect(response.samlConnection?.idpCertificateExpiresAt).toBe(1704067200000);
expect(response.samlConnection?.active).toBe(true);
expect(response.samlConnection?.forceAuthn).toBe(false);
expect(response.samlConnection?.loginHint).toEqual({
mode: 'custom_attribute',
source: 'employee_number',
});
expect(response.oauthConfig).not.toBeNull();
expect(response.oauthConfig?.providerKey).toBe('custom_oidc');
expect(response.oauthConfig?.clientId).toBe('client_abc');
expect(response.oauthConfig?.discoveryUrl).toBe('https://oauth.example.com/.well-known/openid-configuration');
expect(response.oauthConfig?.authUrl).toBe('https://oauth.example.com/authorize');
expect(response.oauthConfig?.tokenUrl).toBe('https://oauth.example.com/token');
expect(response.oauthConfig?.userInfoUrl).toBe('https://oauth.example.com/userinfo');
expect(response.oauthConfig?.requiresPkce).toBe(false);

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover omitted optional response fields.

This fixture populates every newly optional SAML/OAuth field and custom_attributes. Add a case omitting them and assert the resource exposes undefined; this locks in the intended serializer-omission behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts` around
lines 350 - 386, Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.

Source: Coding guidelines

Comment on lines +253 to +276
/**
* The identity provider (IdP) of the connection. For example, `'saml_custom'` or `'oidc_custom'`.
*/
readonly provider: string,
/**
* The public URL of the provider logo, if available.
*/
readonly logoPublicUrl: string | undefined,
/**
* Whether existing users who are members of the organization can link their account to their enterprise identity.
*/
readonly allowOrganizationAccountLinking: boolean,
/**
* Whether the connection can be used for sign-in and sign-up.
*/
readonly authenticatable: boolean,
/**
* Whether Just-in-Time (JIT) provisioning of users is disabled for the connection.
*/
readonly disableJitProvisioning: boolean,
/**
* The custom attribute mappings of the connection. Only returned when the custom attributes feature is enabled for the instance.
*/
readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined,

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
rg -n -C 4 '"version"|"exports"' packages/backend/package.json
ast-grep outline packages/backend/src/api/resources/EnterpriseConnection.ts --items all --type class
rg -n -C 3 '\bEnterpriseConnection(SamlConnection|OauthConfig)?\b' packages/backend/src/index.ts

Repository: clerk/javascript

Length of output: 1546


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## Constructor definitions\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | nl -ba | sed -n '1,340p'printf'\n## Direct usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig|)\b' packages/backend/src ||trueprintf'\n## Package entry exports around backend index\n'
sed -n '120,190p' packages/backend/src/index.ts | nl -ba | sed -n '1,120p'printf'\n## Changeset\n'
sed -n '1,80p' .changeset/major-poets-refuse.md | nl -ba | sed -n '1,80p'

Repository: clerk/javascript

Length of output: 222


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## EnterpriseConnection.ts constructors\n'
grep -nE '^export class (EnterpriseConnectionSamlConnectionLoginHint|EnterpriseConnectionCustomAttribute|EnterpriseConnectionSamlConnection|EnterpriseConnectionOauthConfig|EnterpriseConnection)\b|^ constructor\(' packages/backend/src/api/resources/EnterpriseConnection.ts
printf'\n## Relevant source around constructors\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | cat -n | sed -n '1,340p'printf'\n## Public exports from backend entry\n'
grep -nE 'EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?' packages/backend/src/index.ts
printf'\n## Direct constructor usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?\b' packages/backend/src ||trueprintf'\n## Changeset\n'
cat -n .changeset/major-poets-refuse.md

Repository: clerk/javascript

Length of output: 15917


Bump @clerk/backend to a major release

These exported constructors are part of the public API, so adding required trailing parameters is a breaking change. Update .changeset/major-poets-refuse.md to major, or make the new arguments backward-compatible.

  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • .changeset/major-poets-refuse.md
📍 Affects 2 files
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L253-L276 (this comment)
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L94-L99
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L159-L178
  • .changeset/major-poets-refuse.md#L2-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts` around lines 253
- 276, Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.

Source: Coding guidelines

@wobsorianowobsoriano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Re | undefined question: The old types were wrong. Any downstream code that breaks on upgrade was already unsafe at runtime.

If there's a compiler error then it's just surfacing existing bugs rather than creating new ones. Minor bump is perfect!

@manovotny
manovotny merged commit 23071bd into mainJul 27, 2026
51 checks passed
@manovotny
manovotny deleted the manovotny/enterprise-connection-response-alignment branch July 27, 2026 22:14
Sign up for freeto 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.

2 participants

@manovotny@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

fix(backend): Align EnterpriseConnection resource with the Backend API response - #9156

Merged
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment
Jul 27, 2026
Merged

fix(backend): Align EnterpriseConnection resource with the Backend API response#9156
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment

Conversation

@manovotny

@manovotnymanovotny commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #9155. The EnterpriseConnection resource classes and JSON types drifted from what BAPI's serializer returns (clerk_goapi/serialize/enterprise_connection.go). Some properties read fields BAPI never sends — typed string/boolean but always undefined at runtime — and several returned fields were missing from the SDK.

What changed:

  • EnterpriseConnection now exposes provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.
  • EnterpriseConnectionSamlConnection now exposes active, forceAuthn, and loginHint (required and non-null — BAPI's serializer always sends it).
  • EnterpriseConnectionOauthConfig now exposes providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.
  • Phantom fields are deprecated, not removed: top-level allowSubdomains (only exists on the nested SAML connection) and nested idpMetadata/syncUserAttributes. Removing them would break positional constructor callers, so they keep their slots and gain @deprecated notices pointing at the real field.
  • organizationId is normalized to null when BAPI omits the key, making the declared string | null true at runtime.
  • Fields backed by pointer+omitempty in Go (oauthConfig.clientId, the SAML idp_* fields, certificate timestamps) are retyped | undefined to match runtime behavior.

New constructor params are appended after existing ones. Adding required constructor params to resource classes in a non-major release follows repo precedent (#1544 added hasImage mid-constructor as a minor); this ships as a minor for the same reason.

One review call worth a second opinion: the | undefined retyping is a compile-time change for consumers with strict null checks. It converts silent runtime undefineds into visible type errors, but it will surface in downstream builds on upgrade.

Note

Review surfaced an upstream gap: BAPI's EnterpriseConnectionResponse is missing the object discriminator its sibling serializers all send, so the SDK's deserializer (which switches on object) currently returns raw snake_case JSON for enterprise connection responses in production — fromJSON only runs in tests, where the mock supplies object. The mock keeps object deliberately: it exercises the SDK path that the existing ObjectType.EnterpriseConnection deserializer case defines, and matches the contract once clerk_go adds the field. The upstream fix is filed separately — ORGS-1765.

To test: pnpm --filter @clerk/backend test

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

manovotnyand others added 2 commits July 13, 2026 22:55
…onParams
The Backend API validates provider as required on enterprise connection
creation, so calls without it type-checked but failed at runtime.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntract
Reuses the OrganizationEnterpriseConnectionProvider union from
@clerk/shared/types (matching the sibling SamlConnectionApi pattern) and
adds type-level tests so provider can't silently become optional or widen
back to string.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef1c9ed

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendMinor
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jul 14, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJul 27, 2026 9:12pm
swingsetReadyReadyPreview, CommentJul 27, 2026 9:12pm

Request Review

@coderabbitai

coderabbitaiBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The EnterpriseConnection response contracts and resource parsers now support expanded SAML, OAuth, and top-level fields, including login hints, custom attributes, provider metadata, capability flags, and OAuth endpoints. Optional and deprecated properties were adjusted to match Backend API responses, and omitted organization_id values are normalized to null. Related exports, API fixtures, assertions, and a package changeset were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clerk/javascript#9155: Updates enterprise connection create/update parameter typings and request serialization for related SAML and OIDC shapes.
  • clerk/javascript#9200: Adds ConfigureSSO UI logic consuming the OIDC provider and OAuth configuration fields.

Suggested reviewers:laurabeatris, alexisintech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: aligning EnterpriseConnection with Backend API responses.
Description check✅ PassedThe description is directly related to the changeset and accurately explains the API alignment work.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

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

manovotnyand 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>
manovotnyand others added 2 commits July 13, 2026 23:41
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>
…sponse
The resource classes and JSON types drifted from BAPI's serializer
(clerk_go api/serialize/enterprise_connection.go): several properties
read fields BAPI never sends, and several returned fields were missing.
New constructor params are appended to preserve positional compatibility.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d bump to minor
Codex review: BAPI's serializer always sends login_hint (no omitempty,
never nil), so the JSON type and resource property are non-nullable.
Changeset bumped to minor to match repo precedent for new resource
properties (e.g. hasImage).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-newBot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9156

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9156

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9156

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9156

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9156

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9156

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9156

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9156

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9156

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9156

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9156

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9156

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9156

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9156

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9156

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9156

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9156

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9156

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9156

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9156

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9156

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9156

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9156

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9156

commit: ef1c9ed

@github-actions

github-actionsBot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-27T21:14:23.638Z

Summary

MetricCount
Packages analyzed19
Packages with changes1
🔴 Breaking changes18
🟡 Non-breaking changes16
🟢 Additions50

Warning
18 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (18)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/backend.EnterpriseConnection.undefined
@clerk/backend.EnterpriseConnection.allowSubdomains
@clerk/backend.EnterpriseConnectionOauthConfig.undefined
@clerk/backend.EnterpriseConnectionOauthConfig.clientId
@clerk/backend.EnterpriseConnectionOauthConfig.discoveryUrl
@clerk/backend.EnterpriseConnectionOauthConfig.logoPublicUrl
@clerk/backend.EnterpriseConnectionSamlConnection.undefined
@clerk/backend.EnterpriseConnectionSamlConnection.acsUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificate
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateExpiresAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateIssuedAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadata
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpSsoUrl
@clerk/backend.EnterpriseConnectionSamlConnection.spEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.spMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.syncUserAttributes

@clerk/backend

Current version: 3.13.1
Recommended bump: MAJOR → 4.0.0

🔴 Breaking Changes (18)

Changed: EnterpriseConnection.undefined

// ... 4 unchanged lines elided ...
organizationId: string | null, active: boolean, syncUserAttributes: boolean, - allowSubdomains: boolean, + allowSubdomains: boolean | undefined, 
disableAdditionalIdentifications: boolean, createdAt: number, updatedAt: number, samlConnection: EnterpriseConnectionSamlConnection | null, - oauthConfig: EnterpriseConnectionOauthConfig | null);+ oauthConfig: EnterpriseConnectionOauthConfig | null, + provider: string, + logoPublicUrl: string | undefined, + allowOrganizationAccountLinking: boolean, + authenticatable: boolean, + disableJitProvisioning: boolean, + customAttributes: EnterpriseConnectionCustomAttribute[] | undefined);

Static analyzer: Breaking change in constructor EnterpriseConnection.undefined: Parameter allowSubdomains type changed: booleanboolean|undefined; Required parameter provider was added; Required parameter logoPublicUrl was added; Required parameter allowOrganizationAccountLinking was added; Required parameter authenticatable was added; Required parameter disableJitProvisioning was added; Required parameter customAttributes was added

🤖 AI review (confirmed) (95%): New required parameters (provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, customAttributes) were added to the EnterpriseConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnection(...) calls to supply the newly required parameters: provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.

Changed: EnterpriseConnection.allowSubdomains

- readonly allowSubdomains: boolean;+ readonly allowSubdomains: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnection.allowSubdomains: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnection.allowSubdomains changed from boolean to boolean | undefined on an output property; consumers reading this property and expecting a non-nullable boolean will now receive a potentially undefined value, requiring null-checks.

Migration: Add an undefined guard wherever allowSubdomains is read, e.g. connection.allowSubdomains ?? false.

Changed: EnterpriseConnectionOauthConfig.undefined

 constructor(
id: string, name: string, - clientId: string, - discoveryUrl: string, - logoPublicUrl: string, + clientId: string | undefined, + discoveryUrl: string | undefined, + logoPublicUrl: string | undefined, 
createdAt: number, - updatedAt: number);+ updatedAt: number, + providerKey: string, + authUrl: string | undefined, + tokenUrl: string | undefined, + userInfoUrl: string | undefined, + requiresPkce: boolean);

Static analyzer: Breaking change in constructor EnterpriseConnectionOauthConfig.undefined: Parameter clientId type changed: stringstring|undefined; Parameter discoveryUrl type changed: stringstring|undefined; Parameter logoPublicUrl type changed: stringstring|undefined; Required parameter providerKey was added; Required parameter authUrl was added; Required parameter tokenUrl was added; Required parameter userInfoUrl was added; Required parameter requiresPkce was added

🤖 AI review (confirmed) (95%): New required parameters (providerKey, authUrl, tokenUrl, userInfoUrl, requiresPkce) were added to the EnterpriseConnectionOauthConfig constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionOauthConfig(...) calls to supply the newly required parameters: providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.

Changed: EnterpriseConnectionOauthConfig.clientId

- readonly clientId: string;+ readonly clientId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.clientId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.clientId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever clientId is read, e.g. config.clientId ?? ''.

Changed: EnterpriseConnectionOauthConfig.discoveryUrl

- readonly discoveryUrl: string;+ readonly discoveryUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.discoveryUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.discoveryUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever discoveryUrl is read, e.g. config.discoveryUrl ?? ''.

Changed: EnterpriseConnectionOauthConfig.logoPublicUrl

- readonly logoPublicUrl: string;+ readonly logoPublicUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.logoPublicUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.logoPublicUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever logoPublicUrl is read, e.g. config.logoPublicUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.undefined

 constructor(
id: string, name: string, - idpEntityId: string, - idpSsoUrl: string, - idpCertificate: string, - idpCertificateIssuedAt: number, - idpCertificateExpiresAt: number, - idpMetadataUrl: string, - idpMetadata: string, - acsUrl: string, - spEntityId: string, - spMetadataUrl: string, - syncUserAttributes: boolean, + idpEntityId: string | undefined, + idpSsoUrl: string | undefined, + idpCertificate: string | undefined, + idpCertificateIssuedAt: number | undefined, + idpCertificateExpiresAt: number | undefined, + idpMetadataUrl: string | undefined, + idpMetadata: string | undefined, + acsUrl: string | undefined, + spEntityId: string | undefined, + spMetadataUrl: string | undefined, + syncUserAttributes: boolean | undefined, 
allowSubdomains: boolean, - allowIdpInitiated: boolean);+ allowIdpInitiated: boolean, + active: boolean, + forceAuthn: boolean, + loginHint: EnterpriseConnectionSamlConnectionLoginHint);

Static analyzer: Breaking change in constructor EnterpriseConnectionSamlConnection.undefined: Parameter idpEntityId type changed: stringstring|undefined; Parameter idpSsoUrl type changed: stringstring|undefined; Parameter idpCertificate type changed: stringstring|undefined; Parameter idpCertificateIssuedAt type changed: numbernumber|undefined; Parameter idpCertificateExpiresAt type changed: numbernumber|undefined; Parameter idpMetadataUrl type changed: stringstring|undefined; Parameter idpMetadata type changed: stringstring|undefined; Parameter acsUrl type changed: stringstring|undefined; Parameter spEntityId type changed: stringstring|undefined; Parameter spMetadataUrl type changed: stringstring|undefined; Parameter syncUserAttributes type changed: booleanboolean|undefined; Required parameter active was added; Required parameter forceAuthn was added; Required parameter loginHint was added

🤖 AI review (confirmed) (95%): New required parameters (active, forceAuthn, loginHint) were added to the EnterpriseConnectionSamlConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionSamlConnection(...) calls to supply the newly required parameters: active, forceAuthn, and loginHint.

Changed: EnterpriseConnectionSamlConnection.acsUrl

- readonly acsUrl: string;+ readonly acsUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.acsUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.acsUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever acsUrl is read, e.g. conn.acsUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificate

- readonly idpCertificate: string;+ readonly idpCertificate: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificate: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificate changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificate is read, e.g. conn.idpCertificate ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificateExpiresAt

- readonly idpCertificateExpiresAt: number;+ readonly idpCertificateExpiresAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateExpiresAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateExpiresAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateExpiresAt is read, e.g. conn.idpCertificateExpiresAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpCertificateIssuedAt

- readonly idpCertificateIssuedAt: number;+ readonly idpCertificateIssuedAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateIssuedAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateIssuedAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateIssuedAt is read, e.g. conn.idpCertificateIssuedAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpEntityId

- readonly idpEntityId: string;+ readonly idpEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpEntityId is read, e.g. conn.idpEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadata

- readonly idpMetadata: string;+ readonly idpMetadata: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadata: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadata changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadata is read, e.g. conn.idpMetadata ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadataUrl

- readonly idpMetadataUrl: string;+ readonly idpMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadataUrl is read, e.g. conn.idpMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpSsoUrl

- readonly idpSsoUrl: string;+ readonly idpSsoUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpSsoUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpSsoUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpSsoUrl is read, e.g. conn.idpSsoUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.spEntityId

- readonly spEntityId: string;+ readonly spEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spEntityId is read, e.g. conn.spEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.spMetadataUrl

- readonly spMetadataUrl: string;+ readonly spMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spMetadataUrl is read, e.g. conn.spMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.syncUserAttributes

- readonly syncUserAttributes: boolean;+ readonly syncUserAttributes: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.syncUserAttributes: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.syncUserAttributes changed from boolean to boolean | undefined on an output property; consumers expecting a non-nullable boolean will now need to handle undefined.

Migration: Add an undefined guard wherever syncUserAttributes is read, e.g. conn.syncUserAttributes ?? false.

🟡 Non-breaking Changes (16)

Click to expand 16 changes

Modified: EnterpriseConnectionJSON.allow_subdomains

- allow_subdomains: boolean;+ allow_subdomains?: boolean;

Static analyzer: Modified property EnterpriseConnectionJSON.allow_subdomains: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.allow_subdomains becoming optional is a widening of an input/JSON interface; consumers constructing this type no longer need to supply the field, so no existing well-typed code breaks.

Modified: EnterpriseConnectionJSON.organization_id

- organization_id: string | null;+ organization_id?: string | null;

Static analyzer: Modified property EnterpriseConnectionJSON.organization_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.organization_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.client_id

- client_id: string;+ client_id?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.client_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.client_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.discovery_url

- discovery_url: string;+ discovery_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.discovery_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.discovery_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.logo_public_url

- logo_public_url: string;+ logo_public_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.logo_public_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.logo_public_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.acs_url

- acs_url: string;+ acs_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.acs_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.acs_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at

- idp_certificate_expires_at: number;+ idp_certificate_expires_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at

- idp_certificate_issued_at: number;+ idp_certificate_issued_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate

- idp_certificate: string;+ idp_certificate?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_entity_id

- idp_entity_id: string;+ idp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata_url

- idp_metadata_url: string;+ idp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata

- idp_metadata: string;+ idp_metadata?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_sso_url

- idp_sso_url: string;+ idp_sso_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_sso_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_sso_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_entity_id

- sp_entity_id: string;+ sp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_metadata_url

- sp_metadata_url: string;+ sp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sync_user_attributes

- sync_user_attributes: boolean;+ sync_user_attributes?: boolean;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sync_user_attributes: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sync_user_attributes becoming optional widens the input interface; existing code that already provides the field remains valid.

🟢 Additions (50)

Click to expand 50 changes

Added: EnterpriseConnection.allowOrganizationAccountLinking

+ readonly allowOrganizationAccountLinking: boolean;

Added property EnterpriseConnection.allowOrganizationAccountLinking

Added: EnterpriseConnection.authenticatable

+ readonly authenticatable: boolean;

Added property EnterpriseConnection.authenticatable

Added: EnterpriseConnection.customAttributes

+ readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined;

Added property EnterpriseConnection.customAttributes

Added: EnterpriseConnection.disableJitProvisioning

+ readonly disableJitProvisioning: boolean;

Added property EnterpriseConnection.disableJitProvisioning

Added: EnterpriseConnection.logoPublicUrl

+ readonly logoPublicUrl: string | undefined;

Added property EnterpriseConnection.logoPublicUrl

Added: EnterpriseConnection.provider

+ readonly provider: string;

Added property EnterpriseConnection.provider

Added: EnterpriseConnectionCustomAttribute

+ export declare class EnterpriseConnectionCustomAttribute

Added class EnterpriseConnectionCustomAttribute

Added: EnterpriseConnectionCustomAttribute.undefined

+ constructor(+ name: string, + key: string, + ssoPath: string, + scimPath: string, + multiValued: boolean);

Added constructor EnterpriseConnectionCustomAttribute.undefined

Added: EnterpriseConnectionCustomAttribute.fromJSON

+ static fromJSON(data: EnterpriseConnectionCustomAttributeJSON): EnterpriseConnectionCustomAttribute;

Added method EnterpriseConnectionCustomAttribute.fromJSON

Added: EnterpriseConnectionCustomAttribute.key

+ readonly key: string;

Added property EnterpriseConnectionCustomAttribute.key

Added: EnterpriseConnectionCustomAttribute.multiValued

+ readonly multiValued: boolean;

Added property EnterpriseConnectionCustomAttribute.multiValued

Added: EnterpriseConnectionCustomAttribute.name

+ readonly name: string;

Added property EnterpriseConnectionCustomAttribute.name

Added: EnterpriseConnectionCustomAttribute.scimPath

+ readonly scimPath: string;

Added property EnterpriseConnectionCustomAttribute.scimPath

Added: EnterpriseConnectionCustomAttribute.ssoPath

+ readonly ssoPath: string;

Added property EnterpriseConnectionCustomAttribute.ssoPath

Added: EnterpriseConnectionCustomAttributeJSON

+ export interface EnterpriseConnectionCustomAttributeJSON

Added interface EnterpriseConnectionCustomAttributeJSON

Added: EnterpriseConnectionCustomAttributeJSON.key

+ key: string;

Added property EnterpriseConnectionCustomAttributeJSON.key

Added: EnterpriseConnectionCustomAttributeJSON.multi_valued

+ multi_valued: boolean;

Added property EnterpriseConnectionCustomAttributeJSON.multi_valued

Added: EnterpriseConnectionCustomAttributeJSON.name

+ name: string;

Added property EnterpriseConnectionCustomAttributeJSON.name

Added: EnterpriseConnectionCustomAttributeJSON.scim_path

+ scim_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.scim_path

Added: EnterpriseConnectionCustomAttributeJSON.sso_path

+ sso_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.sso_path

Added: EnterpriseConnectionJSON.allow_organization_account_linking

+ allow_organization_account_linking: boolean;

Added property EnterpriseConnectionJSON.allow_organization_account_linking

Added: EnterpriseConnectionJSON.authenticatable

+ authenticatable: boolean;

Added property EnterpriseConnectionJSON.authenticatable

Added: EnterpriseConnectionJSON.custom_attributes

+ custom_attributes?: EnterpriseConnectionCustomAttributeJSON[];

Added property EnterpriseConnectionJSON.custom_attributes

Added: EnterpriseConnectionJSON.disable_jit_provisioning

+ disable_jit_provisioning: boolean;

Added property EnterpriseConnectionJSON.disable_jit_provisioning

Added: EnterpriseConnectionJSON.logo_public_url

+ logo_public_url?: string;

Added property EnterpriseConnectionJSON.logo_public_url

Added: EnterpriseConnectionJSON.provider

+ provider: string;

Added property EnterpriseConnectionJSON.provider

Added: EnterpriseConnectionOauthConfig.authUrl

+ readonly authUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.authUrl

Added: EnterpriseConnectionOauthConfig.providerKey

+ readonly providerKey: string;

Added property EnterpriseConnectionOauthConfig.providerKey

Added: EnterpriseConnectionOauthConfig.requiresPkce

+ readonly requiresPkce: boolean;

Added property EnterpriseConnectionOauthConfig.requiresPkce

Added: EnterpriseConnectionOauthConfig.tokenUrl

+ readonly tokenUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.tokenUrl

Added: EnterpriseConnectionOauthConfig.userInfoUrl

+ readonly userInfoUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.userInfoUrl

Added: EnterpriseConnectionOauthConfigJSON.auth_url

+ auth_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.auth_url

Added: EnterpriseConnectionOauthConfigJSON.provider_key

+ provider_key: string;

Added property EnterpriseConnectionOauthConfigJSON.provider_key

Added: EnterpriseConnectionOauthConfigJSON.requires_pkce

+ requires_pkce: boolean;

Added property EnterpriseConnectionOauthConfigJSON.requires_pkce

Added: EnterpriseConnectionOauthConfigJSON.token_url

+ token_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.token_url

Added: EnterpriseConnectionOauthConfigJSON.user_info_url

+ user_info_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.user_info_url

Added: EnterpriseConnectionSamlConnection.active

+ readonly active: boolean;

Added property EnterpriseConnectionSamlConnection.active

Added: EnterpriseConnectionSamlConnection.forceAuthn

+ readonly forceAuthn: boolean;

Added property EnterpriseConnectionSamlConnection.forceAuthn

Added: EnterpriseConnectionSamlConnection.loginHint

+ readonly loginHint: EnterpriseConnectionSamlConnectionLoginHint;

Added property EnterpriseConnectionSamlConnection.loginHint

Added: EnterpriseConnectionSamlConnectionJSON.active

+ active: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.active

Added: EnterpriseConnectionSamlConnectionJSON.force_authn

+ force_authn: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.force_authn

Added: EnterpriseConnectionSamlConnectionJSON.login_hint

+ login_hint: EnterpriseConnectionSamlConnectionLoginHintJSON;

Added property EnterpriseConnectionSamlConnectionJSON.login_hint

Added: EnterpriseConnectionSamlConnectionLoginHint

+ export declare class EnterpriseConnectionSamlConnectionLoginHint

Added class EnterpriseConnectionSamlConnectionLoginHint

Added: EnterpriseConnectionSamlConnectionLoginHint.undefined

+ constructor(+ mode: 'email_address' | 'custom_attribute' | 'off', + source?: string | undefined);

Added constructor EnterpriseConnectionSamlConnectionLoginHint.undefined

Added: EnterpriseConnectionSamlConnectionLoginHint.fromJSON

+ static fromJSON(data: EnterpriseConnectionSamlConnectionLoginHintJSON): EnterpriseConnectionSamlConnectionLoginHint;

Added method EnterpriseConnectionSamlConnectionLoginHint.fromJSON

Added: EnterpriseConnectionSamlConnectionLoginHint.mode

+ readonly mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHint.mode

Added: EnterpriseConnectionSamlConnectionLoginHint.source

+ readonly source?: string | undefined;

Added property EnterpriseConnectionSamlConnectionLoginHint.source

Added: EnterpriseConnectionSamlConnectionLoginHintJSON

+ export interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.mode

+ mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.mode

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.source

+ source?: string;

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.source


Report generated by Break Check

Last ran on ef1c9ed.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts`:
- Around line 350-386: Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts`:
- Around line 253-276: Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 104cd8a9-6a61-4602-875c-723186eda94d

📥 Commits

Reviewing files that changed from the base of the PR and between c904fb4 and f2a4865.

📒 Files selected for processing (5)
  • .changeset/major-poets-refuse.md
  • packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts
  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go(manual)
  • clerk/dashboard(manual)
  • clerk/accounts(manual)
  • clerk/backoffice(manual)
  • clerk/clerk(manual)
  • clerk/clerk-docs(manual)
  • clerk/cloudflare-workers(manual)

Comment on lines +350 to +386
expect(response.provider).toBe('saml_custom');
expect(response.logoPublicUrl).toBe('https://img.example.com/connection-logo.png');
expect(response.domains).toEqual(['clerk.dev']);
expect(response.active).toBe(true);
// organization_id is omitted by the Backend API when unset and normalized to null
expect(response.organizationId).toBeNull();
expect(response.allowOrganizationAccountLinking).toBe(true);
expect(response.authenticatable).toBe(true);
expect(response.disableJitProvisioning).toBe(false);
expect(response.customAttributes).toEqual([
{
name: 'Employee Number',
key: 'employee_number',
ssoPath: 'user.employeeNumber',
scimPath: '',
multiValued: false,
},
]);
expect(response.samlConnection).not.toBeNull();
expect(response.samlConnection?.id).toBe('samlc_1');
expect(response.samlConnection?.idpEntityId).toBe('https://idp.example.com');
expect(response.samlConnection?.idpCertificateIssuedAt).toBe(1672531200000);
expect(response.samlConnection?.idpCertificateExpiresAt).toBe(1704067200000);
expect(response.samlConnection?.active).toBe(true);
expect(response.samlConnection?.forceAuthn).toBe(false);
expect(response.samlConnection?.loginHint).toEqual({
mode: 'custom_attribute',
source: 'employee_number',
});
expect(response.oauthConfig).not.toBeNull();
expect(response.oauthConfig?.providerKey).toBe('custom_oidc');
expect(response.oauthConfig?.clientId).toBe('client_abc');
expect(response.oauthConfig?.discoveryUrl).toBe('https://oauth.example.com/.well-known/openid-configuration');
expect(response.oauthConfig?.authUrl).toBe('https://oauth.example.com/authorize');
expect(response.oauthConfig?.tokenUrl).toBe('https://oauth.example.com/token');
expect(response.oauthConfig?.userInfoUrl).toBe('https://oauth.example.com/userinfo');
expect(response.oauthConfig?.requiresPkce).toBe(false);

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover omitted optional response fields.

This fixture populates every newly optional SAML/OAuth field and custom_attributes. Add a case omitting them and assert the resource exposes undefined; this locks in the intended serializer-omission behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts` around
lines 350 - 386, Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.

Source: Coding guidelines

Comment on lines +253 to +276
/**
* The identity provider (IdP) of the connection. For example, `'saml_custom'` or `'oidc_custom'`.
*/
readonly provider: string,
/**
* The public URL of the provider logo, if available.
*/
readonly logoPublicUrl: string | undefined,
/**
* Whether existing users who are members of the organization can link their account to their enterprise identity.
*/
readonly allowOrganizationAccountLinking: boolean,
/**
* Whether the connection can be used for sign-in and sign-up.
*/
readonly authenticatable: boolean,
/**
* Whether Just-in-Time (JIT) provisioning of users is disabled for the connection.
*/
readonly disableJitProvisioning: boolean,
/**
* The custom attribute mappings of the connection. Only returned when the custom attributes feature is enabled for the instance.
*/
readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined,

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
rg -n -C 4 '"version"|"exports"' packages/backend/package.json
ast-grep outline packages/backend/src/api/resources/EnterpriseConnection.ts --items all --type class
rg -n -C 3 '\bEnterpriseConnection(SamlConnection|OauthConfig)?\b' packages/backend/src/index.ts

Repository: clerk/javascript

Length of output: 1546


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## Constructor definitions\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | nl -ba | sed -n '1,340p'printf'\n## Direct usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig|)\b' packages/backend/src ||trueprintf'\n## Package entry exports around backend index\n'
sed -n '120,190p' packages/backend/src/index.ts | nl -ba | sed -n '1,120p'printf'\n## Changeset\n'
sed -n '1,80p' .changeset/major-poets-refuse.md | nl -ba | sed -n '1,80p'

Repository: clerk/javascript

Length of output: 222


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## EnterpriseConnection.ts constructors\n'
grep -nE '^export class (EnterpriseConnectionSamlConnectionLoginHint|EnterpriseConnectionCustomAttribute|EnterpriseConnectionSamlConnection|EnterpriseConnectionOauthConfig|EnterpriseConnection)\b|^ constructor\(' packages/backend/src/api/resources/EnterpriseConnection.ts
printf'\n## Relevant source around constructors\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | cat -n | sed -n '1,340p'printf'\n## Public exports from backend entry\n'
grep -nE 'EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?' packages/backend/src/index.ts
printf'\n## Direct constructor usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?\b' packages/backend/src ||trueprintf'\n## Changeset\n'
cat -n .changeset/major-poets-refuse.md

Repository: clerk/javascript

Length of output: 15917


Bump @clerk/backend to a major release

These exported constructors are part of the public API, so adding required trailing parameters is a breaking change. Update .changeset/major-poets-refuse.md to major, or make the new arguments backward-compatible.

  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • .changeset/major-poets-refuse.md
📍 Affects 2 files
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L253-L276 (this comment)
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L94-L99
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L159-L178
  • .changeset/major-poets-refuse.md#L2-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts` around lines 253
- 276, Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.

Source: Coding guidelines

@wobsorianowobsoriano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Re | undefined question: The old types were wrong. Any downstream code that breaks on upgrade was already unsafe at runtime.

If there's a compiler error then it's just surfacing existing bugs rather than creating new ones. Minor bump is perfect!

@manovotny
manovotny merged commit 23071bd into mainJul 27, 2026
51 checks passed
@manovotny
manovotny deleted the manovotny/enterprise-connection-response-alignment branch July 27, 2026 22:14
Sign up for freeto 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.

2 participants

@manovotny@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(backend): Align EnterpriseConnection resource with the Backend API response - #9156

Merged
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment
Jul 27, 2026
Merged

fix(backend): Align EnterpriseConnection resource with the Backend API response#9156
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment

Conversation

@manovotny

@manovotnymanovotny commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #9155. The EnterpriseConnection resource classes and JSON types drifted from what BAPI's serializer returns (clerk_goapi/serialize/enterprise_connection.go). Some properties read fields BAPI never sends — typed string/boolean but always undefined at runtime — and several returned fields were missing from the SDK.

What changed:

  • EnterpriseConnection now exposes provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.
  • EnterpriseConnectionSamlConnection now exposes active, forceAuthn, and loginHint (required and non-null — BAPI's serializer always sends it).
  • EnterpriseConnectionOauthConfig now exposes providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.
  • Phantom fields are deprecated, not removed: top-level allowSubdomains (only exists on the nested SAML connection) and nested idpMetadata/syncUserAttributes. Removing them would break positional constructor callers, so they keep their slots and gain @deprecated notices pointing at the real field.
  • organizationId is normalized to null when BAPI omits the key, making the declared string | null true at runtime.
  • Fields backed by pointer+omitempty in Go (oauthConfig.clientId, the SAML idp_* fields, certificate timestamps) are retyped | undefined to match runtime behavior.

New constructor params are appended after existing ones. Adding required constructor params to resource classes in a non-major release follows repo precedent (#1544 added hasImage mid-constructor as a minor); this ships as a minor for the same reason.

One review call worth a second opinion: the | undefined retyping is a compile-time change for consumers with strict null checks. It converts silent runtime undefineds into visible type errors, but it will surface in downstream builds on upgrade.

Note

Review surfaced an upstream gap: BAPI's EnterpriseConnectionResponse is missing the object discriminator its sibling serializers all send, so the SDK's deserializer (which switches on object) currently returns raw snake_case JSON for enterprise connection responses in production — fromJSON only runs in tests, where the mock supplies object. The mock keeps object deliberately: it exercises the SDK path that the existing ObjectType.EnterpriseConnection deserializer case defines, and matches the contract once clerk_go adds the field. The upstream fix is filed separately — ORGS-1765.

To test: pnpm --filter @clerk/backend test

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

manovotnyand others added 2 commits July 13, 2026 22:55
…onParams
The Backend API validates provider as required on enterprise connection
creation, so calls without it type-checked but failed at runtime.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntract
Reuses the OrganizationEnterpriseConnectionProvider union from
@clerk/shared/types (matching the sibling SamlConnectionApi pattern) and
adds type-level tests so provider can't silently become optional or widen
back to string.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef1c9ed

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendMinor
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jul 14, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJul 27, 2026 9:12pm
swingsetReadyReadyPreview, CommentJul 27, 2026 9:12pm

Request Review

@coderabbitai

coderabbitaiBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The EnterpriseConnection response contracts and resource parsers now support expanded SAML, OAuth, and top-level fields, including login hints, custom attributes, provider metadata, capability flags, and OAuth endpoints. Optional and deprecated properties were adjusted to match Backend API responses, and omitted organization_id values are normalized to null. Related exports, API fixtures, assertions, and a package changeset were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clerk/javascript#9155: Updates enterprise connection create/update parameter typings and request serialization for related SAML and OIDC shapes.
  • clerk/javascript#9200: Adds ConfigureSSO UI logic consuming the OIDC provider and OAuth configuration fields.

Suggested reviewers:laurabeatris, alexisintech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: aligning EnterpriseConnection with Backend API responses.
Description check✅ PassedThe description is directly related to the changeset and accurately explains the API alignment work.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

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

manovotnyand 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>
manovotnyand others added 2 commits July 13, 2026 23:41
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>
…sponse
The resource classes and JSON types drifted from BAPI's serializer
(clerk_go api/serialize/enterprise_connection.go): several properties
read fields BAPI never sends, and several returned fields were missing.
New constructor params are appended to preserve positional compatibility.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d bump to minor
Codex review: BAPI's serializer always sends login_hint (no omitempty,
never nil), so the JSON type and resource property are non-nullable.
Changeset bumped to minor to match repo precedent for new resource
properties (e.g. hasImage).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-newBot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9156

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9156

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9156

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9156

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9156

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9156

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9156

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9156

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9156

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9156

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9156

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9156

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9156

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9156

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9156

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9156

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9156

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9156

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9156

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9156

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9156

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9156

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9156

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9156

commit: ef1c9ed

@github-actions

github-actionsBot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-27T21:14:23.638Z

Summary

MetricCount
Packages analyzed19
Packages with changes1
🔴 Breaking changes18
🟡 Non-breaking changes16
🟢 Additions50

Warning
18 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (18)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/backend.EnterpriseConnection.undefined
@clerk/backend.EnterpriseConnection.allowSubdomains
@clerk/backend.EnterpriseConnectionOauthConfig.undefined
@clerk/backend.EnterpriseConnectionOauthConfig.clientId
@clerk/backend.EnterpriseConnectionOauthConfig.discoveryUrl
@clerk/backend.EnterpriseConnectionOauthConfig.logoPublicUrl
@clerk/backend.EnterpriseConnectionSamlConnection.undefined
@clerk/backend.EnterpriseConnectionSamlConnection.acsUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificate
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateExpiresAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateIssuedAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadata
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpSsoUrl
@clerk/backend.EnterpriseConnectionSamlConnection.spEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.spMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.syncUserAttributes

@clerk/backend

Current version: 3.13.1
Recommended bump: MAJOR → 4.0.0

🔴 Breaking Changes (18)

Changed: EnterpriseConnection.undefined

// ... 4 unchanged lines elided ...
organizationId: string | null, active: boolean, syncUserAttributes: boolean, - allowSubdomains: boolean, + allowSubdomains: boolean | undefined, 
disableAdditionalIdentifications: boolean, createdAt: number, updatedAt: number, samlConnection: EnterpriseConnectionSamlConnection | null, - oauthConfig: EnterpriseConnectionOauthConfig | null);+ oauthConfig: EnterpriseConnectionOauthConfig | null, + provider: string, + logoPublicUrl: string | undefined, + allowOrganizationAccountLinking: boolean, + authenticatable: boolean, + disableJitProvisioning: boolean, + customAttributes: EnterpriseConnectionCustomAttribute[] | undefined);

Static analyzer: Breaking change in constructor EnterpriseConnection.undefined: Parameter allowSubdomains type changed: booleanboolean|undefined; Required parameter provider was added; Required parameter logoPublicUrl was added; Required parameter allowOrganizationAccountLinking was added; Required parameter authenticatable was added; Required parameter disableJitProvisioning was added; Required parameter customAttributes was added

🤖 AI review (confirmed) (95%): New required parameters (provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, customAttributes) were added to the EnterpriseConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnection(...) calls to supply the newly required parameters: provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.

Changed: EnterpriseConnection.allowSubdomains

- readonly allowSubdomains: boolean;+ readonly allowSubdomains: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnection.allowSubdomains: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnection.allowSubdomains changed from boolean to boolean | undefined on an output property; consumers reading this property and expecting a non-nullable boolean will now receive a potentially undefined value, requiring null-checks.

Migration: Add an undefined guard wherever allowSubdomains is read, e.g. connection.allowSubdomains ?? false.

Changed: EnterpriseConnectionOauthConfig.undefined

 constructor(
id: string, name: string, - clientId: string, - discoveryUrl: string, - logoPublicUrl: string, + clientId: string | undefined, + discoveryUrl: string | undefined, + logoPublicUrl: string | undefined, 
createdAt: number, - updatedAt: number);+ updatedAt: number, + providerKey: string, + authUrl: string | undefined, + tokenUrl: string | undefined, + userInfoUrl: string | undefined, + requiresPkce: boolean);

Static analyzer: Breaking change in constructor EnterpriseConnectionOauthConfig.undefined: Parameter clientId type changed: stringstring|undefined; Parameter discoveryUrl type changed: stringstring|undefined; Parameter logoPublicUrl type changed: stringstring|undefined; Required parameter providerKey was added; Required parameter authUrl was added; Required parameter tokenUrl was added; Required parameter userInfoUrl was added; Required parameter requiresPkce was added

🤖 AI review (confirmed) (95%): New required parameters (providerKey, authUrl, tokenUrl, userInfoUrl, requiresPkce) were added to the EnterpriseConnectionOauthConfig constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionOauthConfig(...) calls to supply the newly required parameters: providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.

Changed: EnterpriseConnectionOauthConfig.clientId

- readonly clientId: string;+ readonly clientId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.clientId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.clientId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever clientId is read, e.g. config.clientId ?? ''.

Changed: EnterpriseConnectionOauthConfig.discoveryUrl

- readonly discoveryUrl: string;+ readonly discoveryUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.discoveryUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.discoveryUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever discoveryUrl is read, e.g. config.discoveryUrl ?? ''.

Changed: EnterpriseConnectionOauthConfig.logoPublicUrl

- readonly logoPublicUrl: string;+ readonly logoPublicUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.logoPublicUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.logoPublicUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever logoPublicUrl is read, e.g. config.logoPublicUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.undefined

 constructor(
id: string, name: string, - idpEntityId: string, - idpSsoUrl: string, - idpCertificate: string, - idpCertificateIssuedAt: number, - idpCertificateExpiresAt: number, - idpMetadataUrl: string, - idpMetadata: string, - acsUrl: string, - spEntityId: string, - spMetadataUrl: string, - syncUserAttributes: boolean, + idpEntityId: string | undefined, + idpSsoUrl: string | undefined, + idpCertificate: string | undefined, + idpCertificateIssuedAt: number | undefined, + idpCertificateExpiresAt: number | undefined, + idpMetadataUrl: string | undefined, + idpMetadata: string | undefined, + acsUrl: string | undefined, + spEntityId: string | undefined, + spMetadataUrl: string | undefined, + syncUserAttributes: boolean | undefined, 
allowSubdomains: boolean, - allowIdpInitiated: boolean);+ allowIdpInitiated: boolean, + active: boolean, + forceAuthn: boolean, + loginHint: EnterpriseConnectionSamlConnectionLoginHint);

Static analyzer: Breaking change in constructor EnterpriseConnectionSamlConnection.undefined: Parameter idpEntityId type changed: stringstring|undefined; Parameter idpSsoUrl type changed: stringstring|undefined; Parameter idpCertificate type changed: stringstring|undefined; Parameter idpCertificateIssuedAt type changed: numbernumber|undefined; Parameter idpCertificateExpiresAt type changed: numbernumber|undefined; Parameter idpMetadataUrl type changed: stringstring|undefined; Parameter idpMetadata type changed: stringstring|undefined; Parameter acsUrl type changed: stringstring|undefined; Parameter spEntityId type changed: stringstring|undefined; Parameter spMetadataUrl type changed: stringstring|undefined; Parameter syncUserAttributes type changed: booleanboolean|undefined; Required parameter active was added; Required parameter forceAuthn was added; Required parameter loginHint was added

🤖 AI review (confirmed) (95%): New required parameters (active, forceAuthn, loginHint) were added to the EnterpriseConnectionSamlConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionSamlConnection(...) calls to supply the newly required parameters: active, forceAuthn, and loginHint.

Changed: EnterpriseConnectionSamlConnection.acsUrl

- readonly acsUrl: string;+ readonly acsUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.acsUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.acsUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever acsUrl is read, e.g. conn.acsUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificate

- readonly idpCertificate: string;+ readonly idpCertificate: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificate: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificate changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificate is read, e.g. conn.idpCertificate ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificateExpiresAt

- readonly idpCertificateExpiresAt: number;+ readonly idpCertificateExpiresAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateExpiresAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateExpiresAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateExpiresAt is read, e.g. conn.idpCertificateExpiresAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpCertificateIssuedAt

- readonly idpCertificateIssuedAt: number;+ readonly idpCertificateIssuedAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateIssuedAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateIssuedAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateIssuedAt is read, e.g. conn.idpCertificateIssuedAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpEntityId

- readonly idpEntityId: string;+ readonly idpEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpEntityId is read, e.g. conn.idpEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadata

- readonly idpMetadata: string;+ readonly idpMetadata: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadata: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadata changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadata is read, e.g. conn.idpMetadata ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadataUrl

- readonly idpMetadataUrl: string;+ readonly idpMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadataUrl is read, e.g. conn.idpMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpSsoUrl

- readonly idpSsoUrl: string;+ readonly idpSsoUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpSsoUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpSsoUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpSsoUrl is read, e.g. conn.idpSsoUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.spEntityId

- readonly spEntityId: string;+ readonly spEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spEntityId is read, e.g. conn.spEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.spMetadataUrl

- readonly spMetadataUrl: string;+ readonly spMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spMetadataUrl is read, e.g. conn.spMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.syncUserAttributes

- readonly syncUserAttributes: boolean;+ readonly syncUserAttributes: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.syncUserAttributes: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.syncUserAttributes changed from boolean to boolean | undefined on an output property; consumers expecting a non-nullable boolean will now need to handle undefined.

Migration: Add an undefined guard wherever syncUserAttributes is read, e.g. conn.syncUserAttributes ?? false.

🟡 Non-breaking Changes (16)

Click to expand 16 changes

Modified: EnterpriseConnectionJSON.allow_subdomains

- allow_subdomains: boolean;+ allow_subdomains?: boolean;

Static analyzer: Modified property EnterpriseConnectionJSON.allow_subdomains: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.allow_subdomains becoming optional is a widening of an input/JSON interface; consumers constructing this type no longer need to supply the field, so no existing well-typed code breaks.

Modified: EnterpriseConnectionJSON.organization_id

- organization_id: string | null;+ organization_id?: string | null;

Static analyzer: Modified property EnterpriseConnectionJSON.organization_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.organization_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.client_id

- client_id: string;+ client_id?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.client_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.client_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.discovery_url

- discovery_url: string;+ discovery_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.discovery_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.discovery_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.logo_public_url

- logo_public_url: string;+ logo_public_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.logo_public_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.logo_public_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.acs_url

- acs_url: string;+ acs_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.acs_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.acs_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at

- idp_certificate_expires_at: number;+ idp_certificate_expires_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at

- idp_certificate_issued_at: number;+ idp_certificate_issued_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate

- idp_certificate: string;+ idp_certificate?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_entity_id

- idp_entity_id: string;+ idp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata_url

- idp_metadata_url: string;+ idp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata

- idp_metadata: string;+ idp_metadata?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_sso_url

- idp_sso_url: string;+ idp_sso_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_sso_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_sso_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_entity_id

- sp_entity_id: string;+ sp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_metadata_url

- sp_metadata_url: string;+ sp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sync_user_attributes

- sync_user_attributes: boolean;+ sync_user_attributes?: boolean;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sync_user_attributes: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sync_user_attributes becoming optional widens the input interface; existing code that already provides the field remains valid.

🟢 Additions (50)

Click to expand 50 changes

Added: EnterpriseConnection.allowOrganizationAccountLinking

+ readonly allowOrganizationAccountLinking: boolean;

Added property EnterpriseConnection.allowOrganizationAccountLinking

Added: EnterpriseConnection.authenticatable

+ readonly authenticatable: boolean;

Added property EnterpriseConnection.authenticatable

Added: EnterpriseConnection.customAttributes

+ readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined;

Added property EnterpriseConnection.customAttributes

Added: EnterpriseConnection.disableJitProvisioning

+ readonly disableJitProvisioning: boolean;

Added property EnterpriseConnection.disableJitProvisioning

Added: EnterpriseConnection.logoPublicUrl

+ readonly logoPublicUrl: string | undefined;

Added property EnterpriseConnection.logoPublicUrl

Added: EnterpriseConnection.provider

+ readonly provider: string;

Added property EnterpriseConnection.provider

Added: EnterpriseConnectionCustomAttribute

+ export declare class EnterpriseConnectionCustomAttribute

Added class EnterpriseConnectionCustomAttribute

Added: EnterpriseConnectionCustomAttribute.undefined

+ constructor(+ name: string, + key: string, + ssoPath: string, + scimPath: string, + multiValued: boolean);

Added constructor EnterpriseConnectionCustomAttribute.undefined

Added: EnterpriseConnectionCustomAttribute.fromJSON

+ static fromJSON(data: EnterpriseConnectionCustomAttributeJSON): EnterpriseConnectionCustomAttribute;

Added method EnterpriseConnectionCustomAttribute.fromJSON

Added: EnterpriseConnectionCustomAttribute.key

+ readonly key: string;

Added property EnterpriseConnectionCustomAttribute.key

Added: EnterpriseConnectionCustomAttribute.multiValued

+ readonly multiValued: boolean;

Added property EnterpriseConnectionCustomAttribute.multiValued

Added: EnterpriseConnectionCustomAttribute.name

+ readonly name: string;

Added property EnterpriseConnectionCustomAttribute.name

Added: EnterpriseConnectionCustomAttribute.scimPath

+ readonly scimPath: string;

Added property EnterpriseConnectionCustomAttribute.scimPath

Added: EnterpriseConnectionCustomAttribute.ssoPath

+ readonly ssoPath: string;

Added property EnterpriseConnectionCustomAttribute.ssoPath

Added: EnterpriseConnectionCustomAttributeJSON

+ export interface EnterpriseConnectionCustomAttributeJSON

Added interface EnterpriseConnectionCustomAttributeJSON

Added: EnterpriseConnectionCustomAttributeJSON.key

+ key: string;

Added property EnterpriseConnectionCustomAttributeJSON.key

Added: EnterpriseConnectionCustomAttributeJSON.multi_valued

+ multi_valued: boolean;

Added property EnterpriseConnectionCustomAttributeJSON.multi_valued

Added: EnterpriseConnectionCustomAttributeJSON.name

+ name: string;

Added property EnterpriseConnectionCustomAttributeJSON.name

Added: EnterpriseConnectionCustomAttributeJSON.scim_path

+ scim_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.scim_path

Added: EnterpriseConnectionCustomAttributeJSON.sso_path

+ sso_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.sso_path

Added: EnterpriseConnectionJSON.allow_organization_account_linking

+ allow_organization_account_linking: boolean;

Added property EnterpriseConnectionJSON.allow_organization_account_linking

Added: EnterpriseConnectionJSON.authenticatable

+ authenticatable: boolean;

Added property EnterpriseConnectionJSON.authenticatable

Added: EnterpriseConnectionJSON.custom_attributes

+ custom_attributes?: EnterpriseConnectionCustomAttributeJSON[];

Added property EnterpriseConnectionJSON.custom_attributes

Added: EnterpriseConnectionJSON.disable_jit_provisioning

+ disable_jit_provisioning: boolean;

Added property EnterpriseConnectionJSON.disable_jit_provisioning

Added: EnterpriseConnectionJSON.logo_public_url

+ logo_public_url?: string;

Added property EnterpriseConnectionJSON.logo_public_url

Added: EnterpriseConnectionJSON.provider

+ provider: string;

Added property EnterpriseConnectionJSON.provider

Added: EnterpriseConnectionOauthConfig.authUrl

+ readonly authUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.authUrl

Added: EnterpriseConnectionOauthConfig.providerKey

+ readonly providerKey: string;

Added property EnterpriseConnectionOauthConfig.providerKey

Added: EnterpriseConnectionOauthConfig.requiresPkce

+ readonly requiresPkce: boolean;

Added property EnterpriseConnectionOauthConfig.requiresPkce

Added: EnterpriseConnectionOauthConfig.tokenUrl

+ readonly tokenUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.tokenUrl

Added: EnterpriseConnectionOauthConfig.userInfoUrl

+ readonly userInfoUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.userInfoUrl

Added: EnterpriseConnectionOauthConfigJSON.auth_url

+ auth_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.auth_url

Added: EnterpriseConnectionOauthConfigJSON.provider_key

+ provider_key: string;

Added property EnterpriseConnectionOauthConfigJSON.provider_key

Added: EnterpriseConnectionOauthConfigJSON.requires_pkce

+ requires_pkce: boolean;

Added property EnterpriseConnectionOauthConfigJSON.requires_pkce

Added: EnterpriseConnectionOauthConfigJSON.token_url

+ token_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.token_url

Added: EnterpriseConnectionOauthConfigJSON.user_info_url

+ user_info_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.user_info_url

Added: EnterpriseConnectionSamlConnection.active

+ readonly active: boolean;

Added property EnterpriseConnectionSamlConnection.active

Added: EnterpriseConnectionSamlConnection.forceAuthn

+ readonly forceAuthn: boolean;

Added property EnterpriseConnectionSamlConnection.forceAuthn

Added: EnterpriseConnectionSamlConnection.loginHint

+ readonly loginHint: EnterpriseConnectionSamlConnectionLoginHint;

Added property EnterpriseConnectionSamlConnection.loginHint

Added: EnterpriseConnectionSamlConnectionJSON.active

+ active: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.active

Added: EnterpriseConnectionSamlConnectionJSON.force_authn

+ force_authn: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.force_authn

Added: EnterpriseConnectionSamlConnectionJSON.login_hint

+ login_hint: EnterpriseConnectionSamlConnectionLoginHintJSON;

Added property EnterpriseConnectionSamlConnectionJSON.login_hint

Added: EnterpriseConnectionSamlConnectionLoginHint

+ export declare class EnterpriseConnectionSamlConnectionLoginHint

Added class EnterpriseConnectionSamlConnectionLoginHint

Added: EnterpriseConnectionSamlConnectionLoginHint.undefined

+ constructor(+ mode: 'email_address' | 'custom_attribute' | 'off', + source?: string | undefined);

Added constructor EnterpriseConnectionSamlConnectionLoginHint.undefined

Added: EnterpriseConnectionSamlConnectionLoginHint.fromJSON

+ static fromJSON(data: EnterpriseConnectionSamlConnectionLoginHintJSON): EnterpriseConnectionSamlConnectionLoginHint;

Added method EnterpriseConnectionSamlConnectionLoginHint.fromJSON

Added: EnterpriseConnectionSamlConnectionLoginHint.mode

+ readonly mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHint.mode

Added: EnterpriseConnectionSamlConnectionLoginHint.source

+ readonly source?: string | undefined;

Added property EnterpriseConnectionSamlConnectionLoginHint.source

Added: EnterpriseConnectionSamlConnectionLoginHintJSON

+ export interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.mode

+ mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.mode

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.source

+ source?: string;

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.source


Report generated by Break Check

Last ran on ef1c9ed.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts`:
- Around line 350-386: Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts`:
- Around line 253-276: Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 104cd8a9-6a61-4602-875c-723186eda94d

📥 Commits

Reviewing files that changed from the base of the PR and between c904fb4 and f2a4865.

📒 Files selected for processing (5)
  • .changeset/major-poets-refuse.md
  • packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts
  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go(manual)
  • clerk/dashboard(manual)
  • clerk/accounts(manual)
  • clerk/backoffice(manual)
  • clerk/clerk(manual)
  • clerk/clerk-docs(manual)
  • clerk/cloudflare-workers(manual)

Comment on lines +350 to +386
expect(response.provider).toBe('saml_custom');
expect(response.logoPublicUrl).toBe('https://img.example.com/connection-logo.png');
expect(response.domains).toEqual(['clerk.dev']);
expect(response.active).toBe(true);
// organization_id is omitted by the Backend API when unset and normalized to null
expect(response.organizationId).toBeNull();
expect(response.allowOrganizationAccountLinking).toBe(true);
expect(response.authenticatable).toBe(true);
expect(response.disableJitProvisioning).toBe(false);
expect(response.customAttributes).toEqual([
{
name: 'Employee Number',
key: 'employee_number',
ssoPath: 'user.employeeNumber',
scimPath: '',
multiValued: false,
},
]);
expect(response.samlConnection).not.toBeNull();
expect(response.samlConnection?.id).toBe('samlc_1');
expect(response.samlConnection?.idpEntityId).toBe('https://idp.example.com');
expect(response.samlConnection?.idpCertificateIssuedAt).toBe(1672531200000);
expect(response.samlConnection?.idpCertificateExpiresAt).toBe(1704067200000);
expect(response.samlConnection?.active).toBe(true);
expect(response.samlConnection?.forceAuthn).toBe(false);
expect(response.samlConnection?.loginHint).toEqual({
mode: 'custom_attribute',
source: 'employee_number',
});
expect(response.oauthConfig).not.toBeNull();
expect(response.oauthConfig?.providerKey).toBe('custom_oidc');
expect(response.oauthConfig?.clientId).toBe('client_abc');
expect(response.oauthConfig?.discoveryUrl).toBe('https://oauth.example.com/.well-known/openid-configuration');
expect(response.oauthConfig?.authUrl).toBe('https://oauth.example.com/authorize');
expect(response.oauthConfig?.tokenUrl).toBe('https://oauth.example.com/token');
expect(response.oauthConfig?.userInfoUrl).toBe('https://oauth.example.com/userinfo');
expect(response.oauthConfig?.requiresPkce).toBe(false);

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover omitted optional response fields.

This fixture populates every newly optional SAML/OAuth field and custom_attributes. Add a case omitting them and assert the resource exposes undefined; this locks in the intended serializer-omission behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts` around
lines 350 - 386, Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.

Source: Coding guidelines

Comment on lines +253 to +276
/**
* The identity provider (IdP) of the connection. For example, `'saml_custom'` or `'oidc_custom'`.
*/
readonly provider: string,
/**
* The public URL of the provider logo, if available.
*/
readonly logoPublicUrl: string | undefined,
/**
* Whether existing users who are members of the organization can link their account to their enterprise identity.
*/
readonly allowOrganizationAccountLinking: boolean,
/**
* Whether the connection can be used for sign-in and sign-up.
*/
readonly authenticatable: boolean,
/**
* Whether Just-in-Time (JIT) provisioning of users is disabled for the connection.
*/
readonly disableJitProvisioning: boolean,
/**
* The custom attribute mappings of the connection. Only returned when the custom attributes feature is enabled for the instance.
*/
readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined,

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
rg -n -C 4 '"version"|"exports"' packages/backend/package.json
ast-grep outline packages/backend/src/api/resources/EnterpriseConnection.ts --items all --type class
rg -n -C 3 '\bEnterpriseConnection(SamlConnection|OauthConfig)?\b' packages/backend/src/index.ts

Repository: clerk/javascript

Length of output: 1546


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## Constructor definitions\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | nl -ba | sed -n '1,340p'printf'\n## Direct usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig|)\b' packages/backend/src ||trueprintf'\n## Package entry exports around backend index\n'
sed -n '120,190p' packages/backend/src/index.ts | nl -ba | sed -n '1,120p'printf'\n## Changeset\n'
sed -n '1,80p' .changeset/major-poets-refuse.md | nl -ba | sed -n '1,80p'

Repository: clerk/javascript

Length of output: 222


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## EnterpriseConnection.ts constructors\n'
grep -nE '^export class (EnterpriseConnectionSamlConnectionLoginHint|EnterpriseConnectionCustomAttribute|EnterpriseConnectionSamlConnection|EnterpriseConnectionOauthConfig|EnterpriseConnection)\b|^ constructor\(' packages/backend/src/api/resources/EnterpriseConnection.ts
printf'\n## Relevant source around constructors\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | cat -n | sed -n '1,340p'printf'\n## Public exports from backend entry\n'
grep -nE 'EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?' packages/backend/src/index.ts
printf'\n## Direct constructor usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?\b' packages/backend/src ||trueprintf'\n## Changeset\n'
cat -n .changeset/major-poets-refuse.md

Repository: clerk/javascript

Length of output: 15917


Bump @clerk/backend to a major release

These exported constructors are part of the public API, so adding required trailing parameters is a breaking change. Update .changeset/major-poets-refuse.md to major, or make the new arguments backward-compatible.

  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • .changeset/major-poets-refuse.md
📍 Affects 2 files
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L253-L276 (this comment)
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L94-L99
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L159-L178
  • .changeset/major-poets-refuse.md#L2-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts` around lines 253
- 276, Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.

Source: Coding guidelines

@wobsorianowobsoriano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Re | undefined question: The old types were wrong. Any downstream code that breaks on upgrade was already unsafe at runtime.

If there's a compiler error then it's just surfacing existing bugs rather than creating new ones. Minor bump is perfect!

@manovotny
manovotny merged commit 23071bd into mainJul 27, 2026
51 checks passed
@manovotny
manovotny deleted the manovotny/enterprise-connection-response-alignment branch July 27, 2026 22:14
Sign up for freeto 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.

2 participants

@manovotny@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(backend): Align EnterpriseConnection resource with the Backend API response - #9156

Merged
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment
Jul 27, 2026
Merged

fix(backend): Align EnterpriseConnection resource with the Backend API response#9156
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment

Conversation

@manovotny

@manovotnymanovotny commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #9155. The EnterpriseConnection resource classes and JSON types drifted from what BAPI's serializer returns (clerk_goapi/serialize/enterprise_connection.go). Some properties read fields BAPI never sends — typed string/boolean but always undefined at runtime — and several returned fields were missing from the SDK.

What changed:

  • EnterpriseConnection now exposes provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.
  • EnterpriseConnectionSamlConnection now exposes active, forceAuthn, and loginHint (required and non-null — BAPI's serializer always sends it).
  • EnterpriseConnectionOauthConfig now exposes providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.
  • Phantom fields are deprecated, not removed: top-level allowSubdomains (only exists on the nested SAML connection) and nested idpMetadata/syncUserAttributes. Removing them would break positional constructor callers, so they keep their slots and gain @deprecated notices pointing at the real field.
  • organizationId is normalized to null when BAPI omits the key, making the declared string | null true at runtime.
  • Fields backed by pointer+omitempty in Go (oauthConfig.clientId, the SAML idp_* fields, certificate timestamps) are retyped | undefined to match runtime behavior.

New constructor params are appended after existing ones. Adding required constructor params to resource classes in a non-major release follows repo precedent (#1544 added hasImage mid-constructor as a minor); this ships as a minor for the same reason.

One review call worth a second opinion: the | undefined retyping is a compile-time change for consumers with strict null checks. It converts silent runtime undefineds into visible type errors, but it will surface in downstream builds on upgrade.

Note

Review surfaced an upstream gap: BAPI's EnterpriseConnectionResponse is missing the object discriminator its sibling serializers all send, so the SDK's deserializer (which switches on object) currently returns raw snake_case JSON for enterprise connection responses in production — fromJSON only runs in tests, where the mock supplies object. The mock keeps object deliberately: it exercises the SDK path that the existing ObjectType.EnterpriseConnection deserializer case defines, and matches the contract once clerk_go adds the field. The upstream fix is filed separately — ORGS-1765.

To test: pnpm --filter @clerk/backend test

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

manovotnyand others added 2 commits July 13, 2026 22:55
…onParams
The Backend API validates provider as required on enterprise connection
creation, so calls without it type-checked but failed at runtime.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntract
Reuses the OrganizationEnterpriseConnectionProvider union from
@clerk/shared/types (matching the sibling SamlConnectionApi pattern) and
adds type-level tests so provider can't silently become optional or widen
back to string.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef1c9ed

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendMinor
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jul 14, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJul 27, 2026 9:12pm
swingsetReadyReadyPreview, CommentJul 27, 2026 9:12pm

Request Review

@coderabbitai

coderabbitaiBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The EnterpriseConnection response contracts and resource parsers now support expanded SAML, OAuth, and top-level fields, including login hints, custom attributes, provider metadata, capability flags, and OAuth endpoints. Optional and deprecated properties were adjusted to match Backend API responses, and omitted organization_id values are normalized to null. Related exports, API fixtures, assertions, and a package changeset were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clerk/javascript#9155: Updates enterprise connection create/update parameter typings and request serialization for related SAML and OIDC shapes.
  • clerk/javascript#9200: Adds ConfigureSSO UI logic consuming the OIDC provider and OAuth configuration fields.

Suggested reviewers:laurabeatris, alexisintech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: aligning EnterpriseConnection with Backend API responses.
Description check✅ PassedThe description is directly related to the changeset and accurately explains the API alignment work.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

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

manovotnyand 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>
manovotnyand others added 2 commits July 13, 2026 23:41
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>
…sponse
The resource classes and JSON types drifted from BAPI's serializer
(clerk_go api/serialize/enterprise_connection.go): several properties
read fields BAPI never sends, and several returned fields were missing.
New constructor params are appended to preserve positional compatibility.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d bump to minor
Codex review: BAPI's serializer always sends login_hint (no omitempty,
never nil), so the JSON type and resource property are non-nullable.
Changeset bumped to minor to match repo precedent for new resource
properties (e.g. hasImage).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-newBot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9156

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9156

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9156

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9156

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9156

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9156

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9156

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9156

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9156

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9156

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9156

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9156

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9156

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9156

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9156

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9156

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9156

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9156

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9156

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9156

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9156

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9156

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9156

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9156

commit: ef1c9ed

@github-actions

github-actionsBot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-27T21:14:23.638Z

Summary

MetricCount
Packages analyzed19
Packages with changes1
🔴 Breaking changes18
🟡 Non-breaking changes16
🟢 Additions50

Warning
18 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (18)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/backend.EnterpriseConnection.undefined
@clerk/backend.EnterpriseConnection.allowSubdomains
@clerk/backend.EnterpriseConnectionOauthConfig.undefined
@clerk/backend.EnterpriseConnectionOauthConfig.clientId
@clerk/backend.EnterpriseConnectionOauthConfig.discoveryUrl
@clerk/backend.EnterpriseConnectionOauthConfig.logoPublicUrl
@clerk/backend.EnterpriseConnectionSamlConnection.undefined
@clerk/backend.EnterpriseConnectionSamlConnection.acsUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificate
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateExpiresAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateIssuedAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadata
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpSsoUrl
@clerk/backend.EnterpriseConnectionSamlConnection.spEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.spMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.syncUserAttributes

@clerk/backend

Current version: 3.13.1
Recommended bump: MAJOR → 4.0.0

🔴 Breaking Changes (18)

Changed: EnterpriseConnection.undefined

// ... 4 unchanged lines elided ...
organizationId: string | null, active: boolean, syncUserAttributes: boolean, - allowSubdomains: boolean, + allowSubdomains: boolean | undefined, 
disableAdditionalIdentifications: boolean, createdAt: number, updatedAt: number, samlConnection: EnterpriseConnectionSamlConnection | null, - oauthConfig: EnterpriseConnectionOauthConfig | null);+ oauthConfig: EnterpriseConnectionOauthConfig | null, + provider: string, + logoPublicUrl: string | undefined, + allowOrganizationAccountLinking: boolean, + authenticatable: boolean, + disableJitProvisioning: boolean, + customAttributes: EnterpriseConnectionCustomAttribute[] | undefined);

Static analyzer: Breaking change in constructor EnterpriseConnection.undefined: Parameter allowSubdomains type changed: booleanboolean|undefined; Required parameter provider was added; Required parameter logoPublicUrl was added; Required parameter allowOrganizationAccountLinking was added; Required parameter authenticatable was added; Required parameter disableJitProvisioning was added; Required parameter customAttributes was added

🤖 AI review (confirmed) (95%): New required parameters (provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, customAttributes) were added to the EnterpriseConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnection(...) calls to supply the newly required parameters: provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.

Changed: EnterpriseConnection.allowSubdomains

- readonly allowSubdomains: boolean;+ readonly allowSubdomains: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnection.allowSubdomains: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnection.allowSubdomains changed from boolean to boolean | undefined on an output property; consumers reading this property and expecting a non-nullable boolean will now receive a potentially undefined value, requiring null-checks.

Migration: Add an undefined guard wherever allowSubdomains is read, e.g. connection.allowSubdomains ?? false.

Changed: EnterpriseConnectionOauthConfig.undefined

 constructor(
id: string, name: string, - clientId: string, - discoveryUrl: string, - logoPublicUrl: string, + clientId: string | undefined, + discoveryUrl: string | undefined, + logoPublicUrl: string | undefined, 
createdAt: number, - updatedAt: number);+ updatedAt: number, + providerKey: string, + authUrl: string | undefined, + tokenUrl: string | undefined, + userInfoUrl: string | undefined, + requiresPkce: boolean);

Static analyzer: Breaking change in constructor EnterpriseConnectionOauthConfig.undefined: Parameter clientId type changed: stringstring|undefined; Parameter discoveryUrl type changed: stringstring|undefined; Parameter logoPublicUrl type changed: stringstring|undefined; Required parameter providerKey was added; Required parameter authUrl was added; Required parameter tokenUrl was added; Required parameter userInfoUrl was added; Required parameter requiresPkce was added

🤖 AI review (confirmed) (95%): New required parameters (providerKey, authUrl, tokenUrl, userInfoUrl, requiresPkce) were added to the EnterpriseConnectionOauthConfig constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionOauthConfig(...) calls to supply the newly required parameters: providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.

Changed: EnterpriseConnectionOauthConfig.clientId

- readonly clientId: string;+ readonly clientId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.clientId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.clientId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever clientId is read, e.g. config.clientId ?? ''.

Changed: EnterpriseConnectionOauthConfig.discoveryUrl

- readonly discoveryUrl: string;+ readonly discoveryUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.discoveryUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.discoveryUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever discoveryUrl is read, e.g. config.discoveryUrl ?? ''.

Changed: EnterpriseConnectionOauthConfig.logoPublicUrl

- readonly logoPublicUrl: string;+ readonly logoPublicUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.logoPublicUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.logoPublicUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever logoPublicUrl is read, e.g. config.logoPublicUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.undefined

 constructor(
id: string, name: string, - idpEntityId: string, - idpSsoUrl: string, - idpCertificate: string, - idpCertificateIssuedAt: number, - idpCertificateExpiresAt: number, - idpMetadataUrl: string, - idpMetadata: string, - acsUrl: string, - spEntityId: string, - spMetadataUrl: string, - syncUserAttributes: boolean, + idpEntityId: string | undefined, + idpSsoUrl: string | undefined, + idpCertificate: string | undefined, + idpCertificateIssuedAt: number | undefined, + idpCertificateExpiresAt: number | undefined, + idpMetadataUrl: string | undefined, + idpMetadata: string | undefined, + acsUrl: string | undefined, + spEntityId: string | undefined, + spMetadataUrl: string | undefined, + syncUserAttributes: boolean | undefined, 
allowSubdomains: boolean, - allowIdpInitiated: boolean);+ allowIdpInitiated: boolean, + active: boolean, + forceAuthn: boolean, + loginHint: EnterpriseConnectionSamlConnectionLoginHint);

Static analyzer: Breaking change in constructor EnterpriseConnectionSamlConnection.undefined: Parameter idpEntityId type changed: stringstring|undefined; Parameter idpSsoUrl type changed: stringstring|undefined; Parameter idpCertificate type changed: stringstring|undefined; Parameter idpCertificateIssuedAt type changed: numbernumber|undefined; Parameter idpCertificateExpiresAt type changed: numbernumber|undefined; Parameter idpMetadataUrl type changed: stringstring|undefined; Parameter idpMetadata type changed: stringstring|undefined; Parameter acsUrl type changed: stringstring|undefined; Parameter spEntityId type changed: stringstring|undefined; Parameter spMetadataUrl type changed: stringstring|undefined; Parameter syncUserAttributes type changed: booleanboolean|undefined; Required parameter active was added; Required parameter forceAuthn was added; Required parameter loginHint was added

🤖 AI review (confirmed) (95%): New required parameters (active, forceAuthn, loginHint) were added to the EnterpriseConnectionSamlConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionSamlConnection(...) calls to supply the newly required parameters: active, forceAuthn, and loginHint.

Changed: EnterpriseConnectionSamlConnection.acsUrl

- readonly acsUrl: string;+ readonly acsUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.acsUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.acsUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever acsUrl is read, e.g. conn.acsUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificate

- readonly idpCertificate: string;+ readonly idpCertificate: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificate: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificate changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificate is read, e.g. conn.idpCertificate ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificateExpiresAt

- readonly idpCertificateExpiresAt: number;+ readonly idpCertificateExpiresAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateExpiresAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateExpiresAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateExpiresAt is read, e.g. conn.idpCertificateExpiresAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpCertificateIssuedAt

- readonly idpCertificateIssuedAt: number;+ readonly idpCertificateIssuedAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateIssuedAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateIssuedAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateIssuedAt is read, e.g. conn.idpCertificateIssuedAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpEntityId

- readonly idpEntityId: string;+ readonly idpEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpEntityId is read, e.g. conn.idpEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadata

- readonly idpMetadata: string;+ readonly idpMetadata: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadata: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadata changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadata is read, e.g. conn.idpMetadata ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadataUrl

- readonly idpMetadataUrl: string;+ readonly idpMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadataUrl is read, e.g. conn.idpMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpSsoUrl

- readonly idpSsoUrl: string;+ readonly idpSsoUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpSsoUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpSsoUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpSsoUrl is read, e.g. conn.idpSsoUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.spEntityId

- readonly spEntityId: string;+ readonly spEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spEntityId is read, e.g. conn.spEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.spMetadataUrl

- readonly spMetadataUrl: string;+ readonly spMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spMetadataUrl is read, e.g. conn.spMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.syncUserAttributes

- readonly syncUserAttributes: boolean;+ readonly syncUserAttributes: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.syncUserAttributes: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.syncUserAttributes changed from boolean to boolean | undefined on an output property; consumers expecting a non-nullable boolean will now need to handle undefined.

Migration: Add an undefined guard wherever syncUserAttributes is read, e.g. conn.syncUserAttributes ?? false.

🟡 Non-breaking Changes (16)

Click to expand 16 changes

Modified: EnterpriseConnectionJSON.allow_subdomains

- allow_subdomains: boolean;+ allow_subdomains?: boolean;

Static analyzer: Modified property EnterpriseConnectionJSON.allow_subdomains: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.allow_subdomains becoming optional is a widening of an input/JSON interface; consumers constructing this type no longer need to supply the field, so no existing well-typed code breaks.

Modified: EnterpriseConnectionJSON.organization_id

- organization_id: string | null;+ organization_id?: string | null;

Static analyzer: Modified property EnterpriseConnectionJSON.organization_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.organization_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.client_id

- client_id: string;+ client_id?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.client_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.client_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.discovery_url

- discovery_url: string;+ discovery_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.discovery_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.discovery_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.logo_public_url

- logo_public_url: string;+ logo_public_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.logo_public_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.logo_public_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.acs_url

- acs_url: string;+ acs_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.acs_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.acs_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at

- idp_certificate_expires_at: number;+ idp_certificate_expires_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at

- idp_certificate_issued_at: number;+ idp_certificate_issued_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate

- idp_certificate: string;+ idp_certificate?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_entity_id

- idp_entity_id: string;+ idp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata_url

- idp_metadata_url: string;+ idp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata

- idp_metadata: string;+ idp_metadata?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_sso_url

- idp_sso_url: string;+ idp_sso_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_sso_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_sso_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_entity_id

- sp_entity_id: string;+ sp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_metadata_url

- sp_metadata_url: string;+ sp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sync_user_attributes

- sync_user_attributes: boolean;+ sync_user_attributes?: boolean;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sync_user_attributes: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sync_user_attributes becoming optional widens the input interface; existing code that already provides the field remains valid.

🟢 Additions (50)

Click to expand 50 changes

Added: EnterpriseConnection.allowOrganizationAccountLinking

+ readonly allowOrganizationAccountLinking: boolean;

Added property EnterpriseConnection.allowOrganizationAccountLinking

Added: EnterpriseConnection.authenticatable

+ readonly authenticatable: boolean;

Added property EnterpriseConnection.authenticatable

Added: EnterpriseConnection.customAttributes

+ readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined;

Added property EnterpriseConnection.customAttributes

Added: EnterpriseConnection.disableJitProvisioning

+ readonly disableJitProvisioning: boolean;

Added property EnterpriseConnection.disableJitProvisioning

Added: EnterpriseConnection.logoPublicUrl

+ readonly logoPublicUrl: string | undefined;

Added property EnterpriseConnection.logoPublicUrl

Added: EnterpriseConnection.provider

+ readonly provider: string;

Added property EnterpriseConnection.provider

Added: EnterpriseConnectionCustomAttribute

+ export declare class EnterpriseConnectionCustomAttribute

Added class EnterpriseConnectionCustomAttribute

Added: EnterpriseConnectionCustomAttribute.undefined

+ constructor(+ name: string, + key: string, + ssoPath: string, + scimPath: string, + multiValued: boolean);

Added constructor EnterpriseConnectionCustomAttribute.undefined

Added: EnterpriseConnectionCustomAttribute.fromJSON

+ static fromJSON(data: EnterpriseConnectionCustomAttributeJSON): EnterpriseConnectionCustomAttribute;

Added method EnterpriseConnectionCustomAttribute.fromJSON

Added: EnterpriseConnectionCustomAttribute.key

+ readonly key: string;

Added property EnterpriseConnectionCustomAttribute.key

Added: EnterpriseConnectionCustomAttribute.multiValued

+ readonly multiValued: boolean;

Added property EnterpriseConnectionCustomAttribute.multiValued

Added: EnterpriseConnectionCustomAttribute.name

+ readonly name: string;

Added property EnterpriseConnectionCustomAttribute.name

Added: EnterpriseConnectionCustomAttribute.scimPath

+ readonly scimPath: string;

Added property EnterpriseConnectionCustomAttribute.scimPath

Added: EnterpriseConnectionCustomAttribute.ssoPath

+ readonly ssoPath: string;

Added property EnterpriseConnectionCustomAttribute.ssoPath

Added: EnterpriseConnectionCustomAttributeJSON

+ export interface EnterpriseConnectionCustomAttributeJSON

Added interface EnterpriseConnectionCustomAttributeJSON

Added: EnterpriseConnectionCustomAttributeJSON.key

+ key: string;

Added property EnterpriseConnectionCustomAttributeJSON.key

Added: EnterpriseConnectionCustomAttributeJSON.multi_valued

+ multi_valued: boolean;

Added property EnterpriseConnectionCustomAttributeJSON.multi_valued

Added: EnterpriseConnectionCustomAttributeJSON.name

+ name: string;

Added property EnterpriseConnectionCustomAttributeJSON.name

Added: EnterpriseConnectionCustomAttributeJSON.scim_path

+ scim_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.scim_path

Added: EnterpriseConnectionCustomAttributeJSON.sso_path

+ sso_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.sso_path

Added: EnterpriseConnectionJSON.allow_organization_account_linking

+ allow_organization_account_linking: boolean;

Added property EnterpriseConnectionJSON.allow_organization_account_linking

Added: EnterpriseConnectionJSON.authenticatable

+ authenticatable: boolean;

Added property EnterpriseConnectionJSON.authenticatable

Added: EnterpriseConnectionJSON.custom_attributes

+ custom_attributes?: EnterpriseConnectionCustomAttributeJSON[];

Added property EnterpriseConnectionJSON.custom_attributes

Added: EnterpriseConnectionJSON.disable_jit_provisioning

+ disable_jit_provisioning: boolean;

Added property EnterpriseConnectionJSON.disable_jit_provisioning

Added: EnterpriseConnectionJSON.logo_public_url

+ logo_public_url?: string;

Added property EnterpriseConnectionJSON.logo_public_url

Added: EnterpriseConnectionJSON.provider

+ provider: string;

Added property EnterpriseConnectionJSON.provider

Added: EnterpriseConnectionOauthConfig.authUrl

+ readonly authUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.authUrl

Added: EnterpriseConnectionOauthConfig.providerKey

+ readonly providerKey: string;

Added property EnterpriseConnectionOauthConfig.providerKey

Added: EnterpriseConnectionOauthConfig.requiresPkce

+ readonly requiresPkce: boolean;

Added property EnterpriseConnectionOauthConfig.requiresPkce

Added: EnterpriseConnectionOauthConfig.tokenUrl

+ readonly tokenUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.tokenUrl

Added: EnterpriseConnectionOauthConfig.userInfoUrl

+ readonly userInfoUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.userInfoUrl

Added: EnterpriseConnectionOauthConfigJSON.auth_url

+ auth_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.auth_url

Added: EnterpriseConnectionOauthConfigJSON.provider_key

+ provider_key: string;

Added property EnterpriseConnectionOauthConfigJSON.provider_key

Added: EnterpriseConnectionOauthConfigJSON.requires_pkce

+ requires_pkce: boolean;

Added property EnterpriseConnectionOauthConfigJSON.requires_pkce

Added: EnterpriseConnectionOauthConfigJSON.token_url

+ token_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.token_url

Added: EnterpriseConnectionOauthConfigJSON.user_info_url

+ user_info_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.user_info_url

Added: EnterpriseConnectionSamlConnection.active

+ readonly active: boolean;

Added property EnterpriseConnectionSamlConnection.active

Added: EnterpriseConnectionSamlConnection.forceAuthn

+ readonly forceAuthn: boolean;

Added property EnterpriseConnectionSamlConnection.forceAuthn

Added: EnterpriseConnectionSamlConnection.loginHint

+ readonly loginHint: EnterpriseConnectionSamlConnectionLoginHint;

Added property EnterpriseConnectionSamlConnection.loginHint

Added: EnterpriseConnectionSamlConnectionJSON.active

+ active: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.active

Added: EnterpriseConnectionSamlConnectionJSON.force_authn

+ force_authn: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.force_authn

Added: EnterpriseConnectionSamlConnectionJSON.login_hint

+ login_hint: EnterpriseConnectionSamlConnectionLoginHintJSON;

Added property EnterpriseConnectionSamlConnectionJSON.login_hint

Added: EnterpriseConnectionSamlConnectionLoginHint

+ export declare class EnterpriseConnectionSamlConnectionLoginHint

Added class EnterpriseConnectionSamlConnectionLoginHint

Added: EnterpriseConnectionSamlConnectionLoginHint.undefined

+ constructor(+ mode: 'email_address' | 'custom_attribute' | 'off', + source?: string | undefined);

Added constructor EnterpriseConnectionSamlConnectionLoginHint.undefined

Added: EnterpriseConnectionSamlConnectionLoginHint.fromJSON

+ static fromJSON(data: EnterpriseConnectionSamlConnectionLoginHintJSON): EnterpriseConnectionSamlConnectionLoginHint;

Added method EnterpriseConnectionSamlConnectionLoginHint.fromJSON

Added: EnterpriseConnectionSamlConnectionLoginHint.mode

+ readonly mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHint.mode

Added: EnterpriseConnectionSamlConnectionLoginHint.source

+ readonly source?: string | undefined;

Added property EnterpriseConnectionSamlConnectionLoginHint.source

Added: EnterpriseConnectionSamlConnectionLoginHintJSON

+ export interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.mode

+ mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.mode

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.source

+ source?: string;

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.source


Report generated by Break Check

Last ran on ef1c9ed.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts`:
- Around line 350-386: Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts`:
- Around line 253-276: Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 104cd8a9-6a61-4602-875c-723186eda94d

📥 Commits

Reviewing files that changed from the base of the PR and between c904fb4 and f2a4865.

📒 Files selected for processing (5)
  • .changeset/major-poets-refuse.md
  • packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts
  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go(manual)
  • clerk/dashboard(manual)
  • clerk/accounts(manual)
  • clerk/backoffice(manual)
  • clerk/clerk(manual)
  • clerk/clerk-docs(manual)
  • clerk/cloudflare-workers(manual)

Comment on lines +350 to +386
expect(response.provider).toBe('saml_custom');
expect(response.logoPublicUrl).toBe('https://img.example.com/connection-logo.png');
expect(response.domains).toEqual(['clerk.dev']);
expect(response.active).toBe(true);
// organization_id is omitted by the Backend API when unset and normalized to null
expect(response.organizationId).toBeNull();
expect(response.allowOrganizationAccountLinking).toBe(true);
expect(response.authenticatable).toBe(true);
expect(response.disableJitProvisioning).toBe(false);
expect(response.customAttributes).toEqual([
{
name: 'Employee Number',
key: 'employee_number',
ssoPath: 'user.employeeNumber',
scimPath: '',
multiValued: false,
},
]);
expect(response.samlConnection).not.toBeNull();
expect(response.samlConnection?.id).toBe('samlc_1');
expect(response.samlConnection?.idpEntityId).toBe('https://idp.example.com');
expect(response.samlConnection?.idpCertificateIssuedAt).toBe(1672531200000);
expect(response.samlConnection?.idpCertificateExpiresAt).toBe(1704067200000);
expect(response.samlConnection?.active).toBe(true);
expect(response.samlConnection?.forceAuthn).toBe(false);
expect(response.samlConnection?.loginHint).toEqual({
mode: 'custom_attribute',
source: 'employee_number',
});
expect(response.oauthConfig).not.toBeNull();
expect(response.oauthConfig?.providerKey).toBe('custom_oidc');
expect(response.oauthConfig?.clientId).toBe('client_abc');
expect(response.oauthConfig?.discoveryUrl).toBe('https://oauth.example.com/.well-known/openid-configuration');
expect(response.oauthConfig?.authUrl).toBe('https://oauth.example.com/authorize');
expect(response.oauthConfig?.tokenUrl).toBe('https://oauth.example.com/token');
expect(response.oauthConfig?.userInfoUrl).toBe('https://oauth.example.com/userinfo');
expect(response.oauthConfig?.requiresPkce).toBe(false);

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover omitted optional response fields.

This fixture populates every newly optional SAML/OAuth field and custom_attributes. Add a case omitting them and assert the resource exposes undefined; this locks in the intended serializer-omission behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts` around
lines 350 - 386, Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.

Source: Coding guidelines

Comment on lines +253 to +276
/**
* The identity provider (IdP) of the connection. For example, `'saml_custom'` or `'oidc_custom'`.
*/
readonly provider: string,
/**
* The public URL of the provider logo, if available.
*/
readonly logoPublicUrl: string | undefined,
/**
* Whether existing users who are members of the organization can link their account to their enterprise identity.
*/
readonly allowOrganizationAccountLinking: boolean,
/**
* Whether the connection can be used for sign-in and sign-up.
*/
readonly authenticatable: boolean,
/**
* Whether Just-in-Time (JIT) provisioning of users is disabled for the connection.
*/
readonly disableJitProvisioning: boolean,
/**
* The custom attribute mappings of the connection. Only returned when the custom attributes feature is enabled for the instance.
*/
readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined,

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
rg -n -C 4 '"version"|"exports"' packages/backend/package.json
ast-grep outline packages/backend/src/api/resources/EnterpriseConnection.ts --items all --type class
rg -n -C 3 '\bEnterpriseConnection(SamlConnection|OauthConfig)?\b' packages/backend/src/index.ts

Repository: clerk/javascript

Length of output: 1546


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## Constructor definitions\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | nl -ba | sed -n '1,340p'printf'\n## Direct usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig|)\b' packages/backend/src ||trueprintf'\n## Package entry exports around backend index\n'
sed -n '120,190p' packages/backend/src/index.ts | nl -ba | sed -n '1,120p'printf'\n## Changeset\n'
sed -n '1,80p' .changeset/major-poets-refuse.md | nl -ba | sed -n '1,80p'

Repository: clerk/javascript

Length of output: 222


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## EnterpriseConnection.ts constructors\n'
grep -nE '^export class (EnterpriseConnectionSamlConnectionLoginHint|EnterpriseConnectionCustomAttribute|EnterpriseConnectionSamlConnection|EnterpriseConnectionOauthConfig|EnterpriseConnection)\b|^ constructor\(' packages/backend/src/api/resources/EnterpriseConnection.ts
printf'\n## Relevant source around constructors\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | cat -n | sed -n '1,340p'printf'\n## Public exports from backend entry\n'
grep -nE 'EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?' packages/backend/src/index.ts
printf'\n## Direct constructor usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?\b' packages/backend/src ||trueprintf'\n## Changeset\n'
cat -n .changeset/major-poets-refuse.md

Repository: clerk/javascript

Length of output: 15917


Bump @clerk/backend to a major release

These exported constructors are part of the public API, so adding required trailing parameters is a breaking change. Update .changeset/major-poets-refuse.md to major, or make the new arguments backward-compatible.

  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • .changeset/major-poets-refuse.md
📍 Affects 2 files
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L253-L276 (this comment)
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L94-L99
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L159-L178
  • .changeset/major-poets-refuse.md#L2-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts` around lines 253
- 276, Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.

Source: Coding guidelines

@wobsorianowobsoriano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Re | undefined question: The old types were wrong. Any downstream code that breaks on upgrade was already unsafe at runtime.

If there's a compiler error then it's just surfacing existing bugs rather than creating new ones. Minor bump is perfect!

@manovotny
manovotny merged commit 23071bd into mainJul 27, 2026
51 checks passed
@manovotny
manovotny deleted the manovotny/enterprise-connection-response-alignment branch July 27, 2026 22:14
Sign up for freeto 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.

2 participants

@manovotny@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

fix(backend): Align EnterpriseConnection resource with the Backend API response - #9156

Merged
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment
Jul 27, 2026
Merged

fix(backend): Align EnterpriseConnection resource with the Backend API response#9156
manovotny merged 9 commits into
mainfrom
manovotny/enterprise-connection-response-alignment

Conversation

@manovotny

@manovotnymanovotny commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #9155. The EnterpriseConnection resource classes and JSON types drifted from what BAPI's serializer returns (clerk_goapi/serialize/enterprise_connection.go). Some properties read fields BAPI never sends — typed string/boolean but always undefined at runtime — and several returned fields were missing from the SDK.

What changed:

  • EnterpriseConnection now exposes provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.
  • EnterpriseConnectionSamlConnection now exposes active, forceAuthn, and loginHint (required and non-null — BAPI's serializer always sends it).
  • EnterpriseConnectionOauthConfig now exposes providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.
  • Phantom fields are deprecated, not removed: top-level allowSubdomains (only exists on the nested SAML connection) and nested idpMetadata/syncUserAttributes. Removing them would break positional constructor callers, so they keep their slots and gain @deprecated notices pointing at the real field.
  • organizationId is normalized to null when BAPI omits the key, making the declared string | null true at runtime.
  • Fields backed by pointer+omitempty in Go (oauthConfig.clientId, the SAML idp_* fields, certificate timestamps) are retyped | undefined to match runtime behavior.

New constructor params are appended after existing ones. Adding required constructor params to resource classes in a non-major release follows repo precedent (#1544 added hasImage mid-constructor as a minor); this ships as a minor for the same reason.

One review call worth a second opinion: the | undefined retyping is a compile-time change for consumers with strict null checks. It converts silent runtime undefineds into visible type errors, but it will surface in downstream builds on upgrade.

Note

Review surfaced an upstream gap: BAPI's EnterpriseConnectionResponse is missing the object discriminator its sibling serializers all send, so the SDK's deserializer (which switches on object) currently returns raw snake_case JSON for enterprise connection responses in production — fromJSON only runs in tests, where the mock supplies object. The mock keeps object deliberately: it exercises the SDK path that the existing ObjectType.EnterpriseConnection deserializer case defines, and matches the contract once clerk_go adds the field. The upstream fix is filed separately — ORGS-1765.

To test: pnpm --filter @clerk/backend test

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

manovotnyand others added 2 commits July 13, 2026 22:55
…onParams
The Backend API validates provider as required on enterprise connection
creation, so calls without it type-checked but failed at runtime.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntract
Reuses the OrganizationEnterpriseConnectionProvider union from
@clerk/shared/types (matching the sibling SamlConnectionApi pattern) and
adds type-level tests so provider can't silently become optional or widen
back to string.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ef1c9ed

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendMinor
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jul 14, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJul 27, 2026 9:12pm
swingsetReadyReadyPreview, CommentJul 27, 2026 9:12pm

Request Review

@coderabbitai

coderabbitaiBot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The EnterpriseConnection response contracts and resource parsers now support expanded SAML, OAuth, and top-level fields, including login hints, custom attributes, provider metadata, capability flags, and OAuth endpoints. Optional and deprecated properties were adjusted to match Backend API responses, and omitted organization_id values are normalized to null. Related exports, API fixtures, assertions, and a package changeset were updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clerk/javascript#9155: Updates enterprise connection create/update parameter typings and request serialization for related SAML and OIDC shapes.
  • clerk/javascript#9200: Adds ConfigureSSO UI logic consuming the OIDC provider and OAuth configuration fields.

Suggested reviewers:laurabeatris, alexisintech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: aligning EnterpriseConnection with Backend API responses.
Description check✅ PassedThe description is directly related to the changeset and accurately explains the API alignment work.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

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

manovotnyand 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>
manovotnyand others added 2 commits July 13, 2026 23:41
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>
…sponse
The resource classes and JSON types drifted from BAPI's serializer
(clerk_go api/serialize/enterprise_connection.go): several properties
read fields BAPI never sends, and several returned fields were missing.
New constructor params are appended to preserve positional compatibility.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d bump to minor
Codex review: BAPI's serializer always sends login_hint (no omitempty,
never nil), so the JSON type and resource property are non-nullable.
Changeset bumped to minor to match repo precedent for new resource
properties (e.g. hasImage).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-newBot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9156

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9156

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9156

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9156

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9156

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9156

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9156

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9156

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9156

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9156

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9156

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9156

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9156

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9156

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9156

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9156

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9156

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9156

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9156

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9156

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9156

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9156

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9156

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9156

commit: ef1c9ed

@github-actions

github-actionsBot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-27T21:14:23.638Z

Summary

MetricCount
Packages analyzed19
Packages with changes1
🔴 Breaking changes18
🟡 Non-breaking changes16
🟢 Additions50

Warning
18 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (18)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/backend.EnterpriseConnection.undefined
@clerk/backend.EnterpriseConnection.allowSubdomains
@clerk/backend.EnterpriseConnectionOauthConfig.undefined
@clerk/backend.EnterpriseConnectionOauthConfig.clientId
@clerk/backend.EnterpriseConnectionOauthConfig.discoveryUrl
@clerk/backend.EnterpriseConnectionOauthConfig.logoPublicUrl
@clerk/backend.EnterpriseConnectionSamlConnection.undefined
@clerk/backend.EnterpriseConnectionSamlConnection.acsUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificate
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateExpiresAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpCertificateIssuedAt
@clerk/backend.EnterpriseConnectionSamlConnection.idpEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadata
@clerk/backend.EnterpriseConnectionSamlConnection.idpMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.idpSsoUrl
@clerk/backend.EnterpriseConnectionSamlConnection.spEntityId
@clerk/backend.EnterpriseConnectionSamlConnection.spMetadataUrl
@clerk/backend.EnterpriseConnectionSamlConnection.syncUserAttributes

@clerk/backend

Current version: 3.13.1
Recommended bump: MAJOR → 4.0.0

🔴 Breaking Changes (18)

Changed: EnterpriseConnection.undefined

// ... 4 unchanged lines elided ...
organizationId: string | null, active: boolean, syncUserAttributes: boolean, - allowSubdomains: boolean, + allowSubdomains: boolean | undefined, 
disableAdditionalIdentifications: boolean, createdAt: number, updatedAt: number, samlConnection: EnterpriseConnectionSamlConnection | null, - oauthConfig: EnterpriseConnectionOauthConfig | null);+ oauthConfig: EnterpriseConnectionOauthConfig | null, + provider: string, + logoPublicUrl: string | undefined, + allowOrganizationAccountLinking: boolean, + authenticatable: boolean, + disableJitProvisioning: boolean, + customAttributes: EnterpriseConnectionCustomAttribute[] | undefined);

Static analyzer: Breaking change in constructor EnterpriseConnection.undefined: Parameter allowSubdomains type changed: booleanboolean|undefined; Required parameter provider was added; Required parameter logoPublicUrl was added; Required parameter allowOrganizationAccountLinking was added; Required parameter authenticatable was added; Required parameter disableJitProvisioning was added; Required parameter customAttributes was added

🤖 AI review (confirmed) (95%): New required parameters (provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, customAttributes) were added to the EnterpriseConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnection(...) calls to supply the newly required parameters: provider, logoPublicUrl, allowOrganizationAccountLinking, authenticatable, disableJitProvisioning, and customAttributes.

Changed: EnterpriseConnection.allowSubdomains

- readonly allowSubdomains: boolean;+ readonly allowSubdomains: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnection.allowSubdomains: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnection.allowSubdomains changed from boolean to boolean | undefined on an output property; consumers reading this property and expecting a non-nullable boolean will now receive a potentially undefined value, requiring null-checks.

Migration: Add an undefined guard wherever allowSubdomains is read, e.g. connection.allowSubdomains ?? false.

Changed: EnterpriseConnectionOauthConfig.undefined

 constructor(
id: string, name: string, - clientId: string, - discoveryUrl: string, - logoPublicUrl: string, + clientId: string | undefined, + discoveryUrl: string | undefined, + logoPublicUrl: string | undefined, 
createdAt: number, - updatedAt: number);+ updatedAt: number, + providerKey: string, + authUrl: string | undefined, + tokenUrl: string | undefined, + userInfoUrl: string | undefined, + requiresPkce: boolean);

Static analyzer: Breaking change in constructor EnterpriseConnectionOauthConfig.undefined: Parameter clientId type changed: stringstring|undefined; Parameter discoveryUrl type changed: stringstring|undefined; Parameter logoPublicUrl type changed: stringstring|undefined; Required parameter providerKey was added; Required parameter authUrl was added; Required parameter tokenUrl was added; Required parameter userInfoUrl was added; Required parameter requiresPkce was added

🤖 AI review (confirmed) (95%): New required parameters (providerKey, authUrl, tokenUrl, userInfoUrl, requiresPkce) were added to the EnterpriseConnectionOauthConfig constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionOauthConfig(...) calls to supply the newly required parameters: providerKey, authUrl, tokenUrl, userInfoUrl, and requiresPkce.

Changed: EnterpriseConnectionOauthConfig.clientId

- readonly clientId: string;+ readonly clientId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.clientId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.clientId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever clientId is read, e.g. config.clientId ?? ''.

Changed: EnterpriseConnectionOauthConfig.discoveryUrl

- readonly discoveryUrl: string;+ readonly discoveryUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.discoveryUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.discoveryUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever discoveryUrl is read, e.g. config.discoveryUrl ?? ''.

Changed: EnterpriseConnectionOauthConfig.logoPublicUrl

- readonly logoPublicUrl: string;+ readonly logoPublicUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionOauthConfig.logoPublicUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionOauthConfig.logoPublicUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever logoPublicUrl is read, e.g. config.logoPublicUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.undefined

 constructor(
id: string, name: string, - idpEntityId: string, - idpSsoUrl: string, - idpCertificate: string, - idpCertificateIssuedAt: number, - idpCertificateExpiresAt: number, - idpMetadataUrl: string, - idpMetadata: string, - acsUrl: string, - spEntityId: string, - spMetadataUrl: string, - syncUserAttributes: boolean, + idpEntityId: string | undefined, + idpSsoUrl: string | undefined, + idpCertificate: string | undefined, + idpCertificateIssuedAt: number | undefined, + idpCertificateExpiresAt: number | undefined, + idpMetadataUrl: string | undefined, + idpMetadata: string | undefined, + acsUrl: string | undefined, + spEntityId: string | undefined, + spMetadataUrl: string | undefined, + syncUserAttributes: boolean | undefined, 
allowSubdomains: boolean, - allowIdpInitiated: boolean);+ allowIdpInitiated: boolean, + active: boolean, + forceAuthn: boolean, + loginHint: EnterpriseConnectionSamlConnectionLoginHint);

Static analyzer: Breaking change in constructor EnterpriseConnectionSamlConnection.undefined: Parameter idpEntityId type changed: stringstring|undefined; Parameter idpSsoUrl type changed: stringstring|undefined; Parameter idpCertificate type changed: stringstring|undefined; Parameter idpCertificateIssuedAt type changed: numbernumber|undefined; Parameter idpCertificateExpiresAt type changed: numbernumber|undefined; Parameter idpMetadataUrl type changed: stringstring|undefined; Parameter idpMetadata type changed: stringstring|undefined; Parameter acsUrl type changed: stringstring|undefined; Parameter spEntityId type changed: stringstring|undefined; Parameter spMetadataUrl type changed: stringstring|undefined; Parameter syncUserAttributes type changed: booleanboolean|undefined; Required parameter active was added; Required parameter forceAuthn was added; Required parameter loginHint was added

🤖 AI review (confirmed) (95%): New required parameters (active, forceAuthn, loginHint) were added to the EnterpriseConnectionSamlConnection constructor, breaking any existing direct instantiation.

Migration: Update all direct new EnterpriseConnectionSamlConnection(...) calls to supply the newly required parameters: active, forceAuthn, and loginHint.

Changed: EnterpriseConnectionSamlConnection.acsUrl

- readonly acsUrl: string;+ readonly acsUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.acsUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.acsUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever acsUrl is read, e.g. conn.acsUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificate

- readonly idpCertificate: string;+ readonly idpCertificate: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificate: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificate changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificate is read, e.g. conn.idpCertificate ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpCertificateExpiresAt

- readonly idpCertificateExpiresAt: number;+ readonly idpCertificateExpiresAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateExpiresAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateExpiresAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateExpiresAt is read, e.g. conn.idpCertificateExpiresAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpCertificateIssuedAt

- readonly idpCertificateIssuedAt: number;+ readonly idpCertificateIssuedAt: number | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpCertificateIssuedAt: Type changed: numbernumber|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpCertificateIssuedAt changed from number to number | undefined on an output property; consumers expecting a non-nullable number will now need to handle undefined.

Migration: Add an undefined guard wherever idpCertificateIssuedAt is read, e.g. conn.idpCertificateIssuedAt ?? 0.

Changed: EnterpriseConnectionSamlConnection.idpEntityId

- readonly idpEntityId: string;+ readonly idpEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpEntityId is read, e.g. conn.idpEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadata

- readonly idpMetadata: string;+ readonly idpMetadata: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadata: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadata changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadata is read, e.g. conn.idpMetadata ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpMetadataUrl

- readonly idpMetadataUrl: string;+ readonly idpMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpMetadataUrl is read, e.g. conn.idpMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.idpSsoUrl

- readonly idpSsoUrl: string;+ readonly idpSsoUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.idpSsoUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.idpSsoUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever idpSsoUrl is read, e.g. conn.idpSsoUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.spEntityId

- readonly spEntityId: string;+ readonly spEntityId: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spEntityId: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spEntityId changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spEntityId is read, e.g. conn.spEntityId ?? ''.

Changed: EnterpriseConnectionSamlConnection.spMetadataUrl

- readonly spMetadataUrl: string;+ readonly spMetadataUrl: string | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.spMetadataUrl: Type changed: stringstring|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.spMetadataUrl changed from string to string | undefined on an output property; consumers expecting a non-nullable string will now need to handle undefined.

Migration: Add an undefined guard wherever spMetadataUrl is read, e.g. conn.spMetadataUrl ?? ''.

Changed: EnterpriseConnectionSamlConnection.syncUserAttributes

- readonly syncUserAttributes: boolean;+ readonly syncUserAttributes: boolean | undefined;

Static analyzer: Breaking change in property EnterpriseConnectionSamlConnection.syncUserAttributes: Type changed: booleanboolean|undefined

🤖 AI review (confirmed) (90%): EnterpriseConnectionSamlConnection.syncUserAttributes changed from boolean to boolean | undefined on an output property; consumers expecting a non-nullable boolean will now need to handle undefined.

Migration: Add an undefined guard wherever syncUserAttributes is read, e.g. conn.syncUserAttributes ?? false.

🟡 Non-breaking Changes (16)

Click to expand 16 changes

Modified: EnterpriseConnectionJSON.allow_subdomains

- allow_subdomains: boolean;+ allow_subdomains?: boolean;

Static analyzer: Modified property EnterpriseConnectionJSON.allow_subdomains: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.allow_subdomains becoming optional is a widening of an input/JSON interface; consumers constructing this type no longer need to supply the field, so no existing well-typed code breaks.

Modified: EnterpriseConnectionJSON.organization_id

- organization_id: string | null;+ organization_id?: string | null;

Static analyzer: Modified property EnterpriseConnectionJSON.organization_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionJSON.organization_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.client_id

- client_id: string;+ client_id?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.client_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.client_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.discovery_url

- discovery_url: string;+ discovery_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.discovery_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.discovery_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionOauthConfigJSON.logo_public_url

- logo_public_url: string;+ logo_public_url?: string;

Static analyzer: Modified property EnterpriseConnectionOauthConfigJSON.logo_public_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionOauthConfigJSON.logo_public_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.acs_url

- acs_url: string;+ acs_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.acs_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.acs_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at

- idp_certificate_expires_at: number;+ idp_certificate_expires_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_expires_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at

- idp_certificate_issued_at: number;+ idp_certificate_issued_at?: number;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate_issued_at becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_certificate

- idp_certificate: string;+ idp_certificate?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_certificate: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_certificate becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_entity_id

- idp_entity_id: string;+ idp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata_url

- idp_metadata_url: string;+ idp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_metadata

- idp_metadata: string;+ idp_metadata?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_metadata: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_metadata becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.idp_sso_url

- idp_sso_url: string;+ idp_sso_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.idp_sso_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.idp_sso_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_entity_id

- sp_entity_id: string;+ sp_entity_id?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_entity_id: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_entity_id becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sp_metadata_url

- sp_metadata_url: string;+ sp_metadata_url?: string;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sp_metadata_url: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sp_metadata_url becoming optional widens the input interface; existing code that already provides the field remains valid.

Modified: EnterpriseConnectionSamlConnectionJSON.sync_user_attributes

- sync_user_attributes: boolean;+ sync_user_attributes?: boolean;

Static analyzer: Modified property EnterpriseConnectionSamlConnectionJSON.sync_user_attributes: Member became optional

🤖 AI review (confirmed) (95%): EnterpriseConnectionSamlConnectionJSON.sync_user_attributes becoming optional widens the input interface; existing code that already provides the field remains valid.

🟢 Additions (50)

Click to expand 50 changes

Added: EnterpriseConnection.allowOrganizationAccountLinking

+ readonly allowOrganizationAccountLinking: boolean;

Added property EnterpriseConnection.allowOrganizationAccountLinking

Added: EnterpriseConnection.authenticatable

+ readonly authenticatable: boolean;

Added property EnterpriseConnection.authenticatable

Added: EnterpriseConnection.customAttributes

+ readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined;

Added property EnterpriseConnection.customAttributes

Added: EnterpriseConnection.disableJitProvisioning

+ readonly disableJitProvisioning: boolean;

Added property EnterpriseConnection.disableJitProvisioning

Added: EnterpriseConnection.logoPublicUrl

+ readonly logoPublicUrl: string | undefined;

Added property EnterpriseConnection.logoPublicUrl

Added: EnterpriseConnection.provider

+ readonly provider: string;

Added property EnterpriseConnection.provider

Added: EnterpriseConnectionCustomAttribute

+ export declare class EnterpriseConnectionCustomAttribute

Added class EnterpriseConnectionCustomAttribute

Added: EnterpriseConnectionCustomAttribute.undefined

+ constructor(+ name: string, + key: string, + ssoPath: string, + scimPath: string, + multiValued: boolean);

Added constructor EnterpriseConnectionCustomAttribute.undefined

Added: EnterpriseConnectionCustomAttribute.fromJSON

+ static fromJSON(data: EnterpriseConnectionCustomAttributeJSON): EnterpriseConnectionCustomAttribute;

Added method EnterpriseConnectionCustomAttribute.fromJSON

Added: EnterpriseConnectionCustomAttribute.key

+ readonly key: string;

Added property EnterpriseConnectionCustomAttribute.key

Added: EnterpriseConnectionCustomAttribute.multiValued

+ readonly multiValued: boolean;

Added property EnterpriseConnectionCustomAttribute.multiValued

Added: EnterpriseConnectionCustomAttribute.name

+ readonly name: string;

Added property EnterpriseConnectionCustomAttribute.name

Added: EnterpriseConnectionCustomAttribute.scimPath

+ readonly scimPath: string;

Added property EnterpriseConnectionCustomAttribute.scimPath

Added: EnterpriseConnectionCustomAttribute.ssoPath

+ readonly ssoPath: string;

Added property EnterpriseConnectionCustomAttribute.ssoPath

Added: EnterpriseConnectionCustomAttributeJSON

+ export interface EnterpriseConnectionCustomAttributeJSON

Added interface EnterpriseConnectionCustomAttributeJSON

Added: EnterpriseConnectionCustomAttributeJSON.key

+ key: string;

Added property EnterpriseConnectionCustomAttributeJSON.key

Added: EnterpriseConnectionCustomAttributeJSON.multi_valued

+ multi_valued: boolean;

Added property EnterpriseConnectionCustomAttributeJSON.multi_valued

Added: EnterpriseConnectionCustomAttributeJSON.name

+ name: string;

Added property EnterpriseConnectionCustomAttributeJSON.name

Added: EnterpriseConnectionCustomAttributeJSON.scim_path

+ scim_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.scim_path

Added: EnterpriseConnectionCustomAttributeJSON.sso_path

+ sso_path: string;

Added property EnterpriseConnectionCustomAttributeJSON.sso_path

Added: EnterpriseConnectionJSON.allow_organization_account_linking

+ allow_organization_account_linking: boolean;

Added property EnterpriseConnectionJSON.allow_organization_account_linking

Added: EnterpriseConnectionJSON.authenticatable

+ authenticatable: boolean;

Added property EnterpriseConnectionJSON.authenticatable

Added: EnterpriseConnectionJSON.custom_attributes

+ custom_attributes?: EnterpriseConnectionCustomAttributeJSON[];

Added property EnterpriseConnectionJSON.custom_attributes

Added: EnterpriseConnectionJSON.disable_jit_provisioning

+ disable_jit_provisioning: boolean;

Added property EnterpriseConnectionJSON.disable_jit_provisioning

Added: EnterpriseConnectionJSON.logo_public_url

+ logo_public_url?: string;

Added property EnterpriseConnectionJSON.logo_public_url

Added: EnterpriseConnectionJSON.provider

+ provider: string;

Added property EnterpriseConnectionJSON.provider

Added: EnterpriseConnectionOauthConfig.authUrl

+ readonly authUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.authUrl

Added: EnterpriseConnectionOauthConfig.providerKey

+ readonly providerKey: string;

Added property EnterpriseConnectionOauthConfig.providerKey

Added: EnterpriseConnectionOauthConfig.requiresPkce

+ readonly requiresPkce: boolean;

Added property EnterpriseConnectionOauthConfig.requiresPkce

Added: EnterpriseConnectionOauthConfig.tokenUrl

+ readonly tokenUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.tokenUrl

Added: EnterpriseConnectionOauthConfig.userInfoUrl

+ readonly userInfoUrl: string | undefined;

Added property EnterpriseConnectionOauthConfig.userInfoUrl

Added: EnterpriseConnectionOauthConfigJSON.auth_url

+ auth_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.auth_url

Added: EnterpriseConnectionOauthConfigJSON.provider_key

+ provider_key: string;

Added property EnterpriseConnectionOauthConfigJSON.provider_key

Added: EnterpriseConnectionOauthConfigJSON.requires_pkce

+ requires_pkce: boolean;

Added property EnterpriseConnectionOauthConfigJSON.requires_pkce

Added: EnterpriseConnectionOauthConfigJSON.token_url

+ token_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.token_url

Added: EnterpriseConnectionOauthConfigJSON.user_info_url

+ user_info_url?: string;

Added property EnterpriseConnectionOauthConfigJSON.user_info_url

Added: EnterpriseConnectionSamlConnection.active

+ readonly active: boolean;

Added property EnterpriseConnectionSamlConnection.active

Added: EnterpriseConnectionSamlConnection.forceAuthn

+ readonly forceAuthn: boolean;

Added property EnterpriseConnectionSamlConnection.forceAuthn

Added: EnterpriseConnectionSamlConnection.loginHint

+ readonly loginHint: EnterpriseConnectionSamlConnectionLoginHint;

Added property EnterpriseConnectionSamlConnection.loginHint

Added: EnterpriseConnectionSamlConnectionJSON.active

+ active: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.active

Added: EnterpriseConnectionSamlConnectionJSON.force_authn

+ force_authn: boolean;

Added property EnterpriseConnectionSamlConnectionJSON.force_authn

Added: EnterpriseConnectionSamlConnectionJSON.login_hint

+ login_hint: EnterpriseConnectionSamlConnectionLoginHintJSON;

Added property EnterpriseConnectionSamlConnectionJSON.login_hint

Added: EnterpriseConnectionSamlConnectionLoginHint

+ export declare class EnterpriseConnectionSamlConnectionLoginHint

Added class EnterpriseConnectionSamlConnectionLoginHint

Added: EnterpriseConnectionSamlConnectionLoginHint.undefined

+ constructor(+ mode: 'email_address' | 'custom_attribute' | 'off', + source?: string | undefined);

Added constructor EnterpriseConnectionSamlConnectionLoginHint.undefined

Added: EnterpriseConnectionSamlConnectionLoginHint.fromJSON

+ static fromJSON(data: EnterpriseConnectionSamlConnectionLoginHintJSON): EnterpriseConnectionSamlConnectionLoginHint;

Added method EnterpriseConnectionSamlConnectionLoginHint.fromJSON

Added: EnterpriseConnectionSamlConnectionLoginHint.mode

+ readonly mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHint.mode

Added: EnterpriseConnectionSamlConnectionLoginHint.source

+ readonly source?: string | undefined;

Added property EnterpriseConnectionSamlConnectionLoginHint.source

Added: EnterpriseConnectionSamlConnectionLoginHintJSON

+ export interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added interface EnterpriseConnectionSamlConnectionLoginHintJSON

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.mode

+ mode: 'email_address' | 'custom_attribute' | 'off';

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.mode

Added: EnterpriseConnectionSamlConnectionLoginHintJSON.source

+ source?: string;

Added property EnterpriseConnectionSamlConnectionLoginHintJSON.source


Report generated by Break Check

Last ran on ef1c9ed.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts`:
- Around line 350-386: Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts`:
- Around line 253-276: Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 104cd8a9-6a61-4602-875c-723186eda94d

📥 Commits

Reviewing files that changed from the base of the PR and between c904fb4 and f2a4865.

📒 Files selected for processing (5)
  • .changeset/major-poets-refuse.md
  • packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts
  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go(manual)
  • clerk/dashboard(manual)
  • clerk/accounts(manual)
  • clerk/backoffice(manual)
  • clerk/clerk(manual)
  • clerk/clerk-docs(manual)
  • clerk/cloudflare-workers(manual)

Comment on lines +350 to +386
expect(response.provider).toBe('saml_custom');
expect(response.logoPublicUrl).toBe('https://img.example.com/connection-logo.png');
expect(response.domains).toEqual(['clerk.dev']);
expect(response.active).toBe(true);
// organization_id is omitted by the Backend API when unset and normalized to null
expect(response.organizationId).toBeNull();
expect(response.allowOrganizationAccountLinking).toBe(true);
expect(response.authenticatable).toBe(true);
expect(response.disableJitProvisioning).toBe(false);
expect(response.customAttributes).toEqual([
{
name: 'Employee Number',
key: 'employee_number',
ssoPath: 'user.employeeNumber',
scimPath: '',
multiValued: false,
},
]);
expect(response.samlConnection).not.toBeNull();
expect(response.samlConnection?.id).toBe('samlc_1');
expect(response.samlConnection?.idpEntityId).toBe('https://idp.example.com');
expect(response.samlConnection?.idpCertificateIssuedAt).toBe(1672531200000);
expect(response.samlConnection?.idpCertificateExpiresAt).toBe(1704067200000);
expect(response.samlConnection?.active).toBe(true);
expect(response.samlConnection?.forceAuthn).toBe(false);
expect(response.samlConnection?.loginHint).toEqual({
mode: 'custom_attribute',
source: 'employee_number',
});
expect(response.oauthConfig).not.toBeNull();
expect(response.oauthConfig?.providerKey).toBe('custom_oidc');
expect(response.oauthConfig?.clientId).toBe('client_abc');
expect(response.oauthConfig?.discoveryUrl).toBe('https://oauth.example.com/.well-known/openid-configuration');
expect(response.oauthConfig?.authUrl).toBe('https://oauth.example.com/authorize');
expect(response.oauthConfig?.tokenUrl).toBe('https://oauth.example.com/token');
expect(response.oauthConfig?.userInfoUrl).toBe('https://oauth.example.com/userinfo');
expect(response.oauthConfig?.requiresPkce).toBe(false);

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover omitted optional response fields.

This fixture populates every newly optional SAML/OAuth field and custom_attributes. Add a case omitting them and assert the resource exposes undefined; this locks in the intended serializer-omission behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/__tests__/EnterpriseConnectionApi.test.ts` around
lines 350 - 386, Add a separate test case in the EnterpriseConnectionApi
response tests using a fixture that omits the optional SAML/OAuth fields and
custom_attributes. Assert the normalized resource exposes undefined for each
omitted optional property, including the relevant fields on samlConnection and
oauthConfig, to preserve serializer-omission behavior.

Source: Coding guidelines

Comment on lines +253 to +276
/**
* The identity provider (IdP) of the connection. For example, `'saml_custom'` or `'oidc_custom'`.
*/
readonly provider: string,
/**
* The public URL of the provider logo, if available.
*/
readonly logoPublicUrl: string | undefined,
/**
* Whether existing users who are members of the organization can link their account to their enterprise identity.
*/
readonly allowOrganizationAccountLinking: boolean,
/**
* Whether the connection can be used for sign-in and sign-up.
*/
readonly authenticatable: boolean,
/**
* Whether Just-in-Time (JIT) provisioning of users is disabled for the connection.
*/
readonly disableJitProvisioning: boolean,
/**
* The custom attribute mappings of the connection. Only returned when the custom attributes feature is enabled for the instance.
*/
readonly customAttributes: EnterpriseConnectionCustomAttribute[] | undefined,

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
rg -n -C 4 '"version"|"exports"' packages/backend/package.json
ast-grep outline packages/backend/src/api/resources/EnterpriseConnection.ts --items all --type class
rg -n -C 3 '\bEnterpriseConnection(SamlConnection|OauthConfig)?\b' packages/backend/src/index.ts

Repository: clerk/javascript

Length of output: 1546


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## Constructor definitions\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | nl -ba | sed -n '1,340p'printf'\n## Direct usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig|)\b' packages/backend/src ||trueprintf'\n## Package entry exports around backend index\n'
sed -n '120,190p' packages/backend/src/index.ts | nl -ba | sed -n '1,120p'printf'\n## Changeset\n'
sed -n '1,80p' .changeset/major-poets-refuse.md | nl -ba | sed -n '1,80p'

Repository: clerk/javascript

Length of output: 222


🏁 Script executed:

#!/bin/bashset -euo pipefail
printf'\n## EnterpriseConnection.ts constructors\n'
grep -nE '^export class (EnterpriseConnectionSamlConnectionLoginHint|EnterpriseConnectionCustomAttribute|EnterpriseConnectionSamlConnection|EnterpriseConnectionOauthConfig|EnterpriseConnection)\b|^ constructor\(' packages/backend/src/api/resources/EnterpriseConnection.ts
printf'\n## Relevant source around constructors\n'
sed -n '1,340p' packages/backend/src/api/resources/EnterpriseConnection.ts | cat -n | sed -n '1,340p'printf'\n## Public exports from backend entry\n'
grep -nE 'EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?' packages/backend/src/index.ts
printf'\n## Direct constructor usages in repo\n'
rg -n 'new\s+EnterpriseConnection(SamlConnectionLoginHint|CustomAttribute|SamlConnection|OauthConfig)?\b' packages/backend/src ||trueprintf'\n## Changeset\n'
cat -n .changeset/major-poets-refuse.md

Repository: clerk/javascript

Length of output: 15917


Bump @clerk/backend to a major release

These exported constructors are part of the public API, so adding required trailing parameters is a breaking change. Update .changeset/major-poets-refuse.md to major, or make the new arguments backward-compatible.

  • packages/backend/src/api/resources/EnterpriseConnection.ts
  • .changeset/major-poets-refuse.md
📍 Affects 2 files
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L253-L276 (this comment)
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L94-L99
  • packages/backend/src/api/resources/EnterpriseConnection.ts#L159-L178
  • .changeset/major-poets-refuse.md#L2-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/backend/src/api/resources/EnterpriseConnection.ts` around lines 253
- 276, Update the public EnterpriseConnection constructors at
packages/backend/src/api/resources/EnterpriseConnection.ts lines 94-99, 159-178,
and 253-276 so the newly added parameters are backward-compatible, or classify
the API change as major by changing .changeset/major-poets-refuse.md line 2 to
major; ensure all affected constructor signatures follow the same choice.

Source: Coding guidelines

@wobsorianowobsoriano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Re | undefined question: The old types were wrong. Any downstream code that breaks on upgrade was already unsafe at runtime.

If there's a compiler error then it's just surfacing existing bugs rather than creating new ones. Minor bump is perfect!

@manovotny
manovotny merged commit 23071bd into mainJul 27, 2026
51 checks passed
@manovotny
manovotny deleted the manovotny/enterprise-connection-response-alignment branch July 27, 2026 22:14
Sign up for freeto 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.

2 participants

@manovotny@wobsoriano