fix(backend): Add required provider field to CreateEnterpriseConnectionParams#9153
fix(backend): Add required provider field to CreateEnterpriseConnectionParams#9153manovotny wants to merge 2 commits into
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 2092c3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe enterprise connection creation parameters now require a supported ChangesEnterprise connection provider
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
…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>
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
…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>
Description
CreateEnterpriseConnectionParamswas missing theproviderfield, but the Backend API requires it (validate:"required"on BAPI'sCreateParams). Calls tocreateEnterpriseConnection()without it type-checked fine and then failed validation at runtime. The type now carries a requiredprovider, typed as theOrganizationEnterpriseConnectionProviderunion from@clerk/shared/types— the same narrow-union patternSamlConnectionApialready uses — so both missing and unsupported values are caught at compile time.Verified against the clerk_go source:
provideris required on create, and the shared union exactly matches the server allowlist —saml_custom,saml_okta,saml_google,saml_microsoft,oidc_custom,oidc_github_enterprise, andoidc_gitlab.Two side effects worth calling out:
providerbehind anascast to work around the missing field. The cast is now removed.To test:
pnpm --filter @clerk/backend test:node EnterpriseConnectionApi.test.ts— both create tests passproviderand assert it reaches the request body, and type-level assertions lock in thatprovideris required and rejects unsupported values.A follow-up will align the remaining create-params gaps with the BAPI contract (
nameanddomainsare also required server-side).Discovered while reviewing clerk/clerk#2887, where a docs code sample calling
createEnterpriseConnectionwithoutproviderwould fail BAPI validation despite type-checking.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
Bug Fixes
Tests