feat(ui): Self-serve SSO within OrganizationProfile#8600
Conversation
🦋 Changeset detectedLatest commit: d951d19 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ceca5e5 to
d586173
Compare
d586173 to
5cf9dcd
Compare
81ae14b to
e755033
Compare
e755033 to
4023c00
Compare
4023c00 to
d00e41c
Compare
d00e41c to
b166045
Compare
b166045 to
2d3eb25
Compare
2d3eb25 to
384aab2
Compare
384aab2 to
d6040c3
Compare
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@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: |
d6040c3 to
07abb56
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR adds organization-level self-serve SSO support: a boolean flag on the Organization resource (wiring in clerk-js, types, and snapshot), a localization entry and icon, exported ConfigureSSO protect/content components with an updated permission key, a conditional Organization Self-Serve SSO page and route integrated into the custom pages pipeline, fixture/test updates, and a changeset marking the packages as minor releases. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsx (1)
37-41:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winPermission mismatch between test and implementation.
The test grants
org:sys_enterprise_connections:managebutConfigureSSOProtectnow checks fororg:sys_entconns:manage. This test will fail because the user won't have the required permission.🐛 Proposed fix
f.withUser({ email_addresses: ['test@clerk.com'], - organization_memberships: [{ name: 'Org1', permissions: ['org:sys_enterprise_connections:manage'] }], + organization_memberships: [{ name: 'Org1', permissions: ['org:sys_entconns:manage'] }], });🤖 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/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsx` around lines 37 - 41, The test grants the old permission string so ConfigureSSOProtect's permission check fails; update the test user setup in ConfigureSSO.test.tsx (the f.withUser call) to use the new permission key 'org:sys_entconns:manage' instead of 'org:sys_enterprise_connections:manage' so the user has the permission that ConfigureSSOProtect checks for.
🤖 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.
Outside diff comments:
In `@packages/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsx`:
- Around line 37-41: The test grants the old permission string so
ConfigureSSOProtect's permission check fails; update the test user setup in
ConfigureSSO.test.tsx (the f.withUser call) to use the new permission key
'org:sys_entconns:manage' instead of 'org:sys_enterprise_connections:manage' so
the user has the permission that ConfigureSSOProtect checks for.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: e66b12c4-cc3b-4435-9dde-6c76b5ce8c7e
⛔ Files ignored due to path filters (1)
packages/ui/src/icons/connections.svgis excluded by!**/*.svg
📒 Files selected for processing (18)
packages/backend/src/api/resources/JSON.tspackages/backend/src/api/resources/Organization.tspackages/clerk-js/src/core/resources/Organization.tspackages/clerk-js/src/core/resources/__tests__/Organization.test.tspackages/localizations/src/en-US.tspackages/shared/src/types/json.tspackages/shared/src/types/localization.tspackages/shared/src/types/organization.tspackages/ui/src/components/ConfigureSSO/ConfigureSSO.tsxpackages/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsxpackages/ui/src/components/OrganizationProfile/OrganizationProfileRoutes.tsxpackages/ui/src/components/OrganizationProfile/OrganizationSelfServeSSOPage.tsxpackages/ui/src/components/OrganizationProfile/__tests__/OrganizationProfile.test.tsxpackages/ui/src/constants.tspackages/ui/src/contexts/components/OrganizationProfile.tspackages/ui/src/icons/index.tspackages/ui/src/test/fixture-helpers.tspackages/ui/src/utils/createCustomPages.tsx
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsx (1)
32-51:⚠️ Potential issue | 🟠 Major | ⚡ Quick winTest fixture uses outdated permission key.
The test fixture at line 39 uses
org:sys_enterprise_connections:managebut the implementation inConfigureSSOProtectnow checks fororg:sys_entconns:manage. This test passes coincidentally because it grants permissions the component no longer checks for, meaning it doesn't validate the actual authorization logic.🐛 Proposed fix to use the correct permission key
organization_memberships: [{ name: 'Org1', permissions: ['org:sys_enterprise_connections:manage'] }], + organization_memberships: [{ name: 'Org1', permissions: ['org:sys_entconns:manage'] }],🤖 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/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsx` around lines 32 - 51, The test grants the old permission key so it doesn't validate the component's current check; update the permission string in the fixture used by ConfigureSSO.test.tsx from "org:sys_enterprise_connections:manage" to the current key "org:sys_entconns:manage" (the user object created in the createFixtures call / organization_memberships array) so ConfigureSSO/ConfigureSSOProtect's permission check is exercised correctly.
🤖 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/ui/src/components/OrganizationProfile/OrganizationProfileRoutes.tsx`:
- Around line 153-161: The lazy-loaded OrganizationSelfServeSSOPage is rendered
without a Suspense boundary; wrap its usage inside a React.Suspense with an
appropriate fallback (matching other routes like
OrganizationBillingPage/OrganizationAPIKeysPage) so the lazy import can load
without throwing; update the JSX in OrganizationProfileRoutes where
OrganizationSelfServeSSOPage is rendered (the Route/Route index block) to
include a Suspense wrapper around <OrganizationSelfServeSSOPage />.
---
Outside diff comments:
In `@packages/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsx`:
- Around line 32-51: The test grants the old permission key so it doesn't
validate the component's current check; update the permission string in the
fixture used by ConfigureSSO.test.tsx from
"org:sys_enterprise_connections:manage" to the current key
"org:sys_entconns:manage" (the user object created in the createFixtures call /
organization_memberships array) so ConfigureSSO/ConfigureSSOProtect's permission
check is exercised correctly.
🪄 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
Run ID: 530d621d-2e90-4427-ae47-e3508d7ee3f1
⛔ Files ignored due to path filters (1)
packages/ui/src/icons/connections.svgis excluded by!**/*.svg
📒 Files selected for processing (16)
packages/clerk-js/src/core/resources/Organization.tspackages/clerk-js/src/core/resources/__tests__/Organization.test.tspackages/localizations/src/en-US.tspackages/shared/src/types/json.tspackages/shared/src/types/localization.tspackages/shared/src/types/organization.tspackages/ui/src/components/ConfigureSSO/ConfigureSSO.tsxpackages/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsxpackages/ui/src/components/OrganizationProfile/OrganizationProfileRoutes.tsxpackages/ui/src/components/OrganizationProfile/OrganizationSelfServeSSOPage.tsxpackages/ui/src/components/OrganizationProfile/__tests__/OrganizationProfile.test.tsxpackages/ui/src/constants.tspackages/ui/src/contexts/components/OrganizationProfile.tspackages/ui/src/icons/index.tspackages/ui/src/test/fixture-helpers.tspackages/ui/src/utils/createCustomPages.tsx
✅ Files skipped from review due to trivial changes (1)
- packages/ui/src/test/fixture-helpers.ts
b325d60 to
4d96908
Compare
1a7f147 to
6f5a23a
Compare
6f5a23a to
d951d19
Compare
Description
Introduces "Single Sign-On" section in
OrganizationProfile, if self-serve SSO is enabled for the organizationChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change