feat(sso): add configureAuthType to enable or disable an SSO configuration - #800
Conversation
…ation Wraps POST /v1/mgmt/sso/settings/authtype: none disables one SSO configuration without deleting it, saml/oidc enable it on that protocol with its stored settings. Takes an optional ssoId, so a multi-SSO tenant can have a single connection taken out of service and put back without replaying its IdP payload, and without the new ACS URL a delete plus recreate hands a SAML tenant. Also names the shared 'none' | 'saml' | 'oidc' union SSOAuthType and reuses it on Tenant and TenantSettings, which already inlined it. Requires descope/backend#2355. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
🐕 Suggested ReviewersSelected reviewers to provide comprehensive coverage across all changed files and expertise areas. The strategy prioritizes: (1) Core SSO domain expertise from contributors with multiple SSO-related commits; (2) Broad file coverage spanning paths, types, implementation, tests, and documentation; (3) Testing validation from dedicated test contributors; (4) Documentation review from README experts.
Suggested by Shuni based on git history and PR context. Names are not @-mentioned to avoid notifying anyone — request a review from whoever fits best. |
There was a problem hiding this comment.
🐕 Shuni Review
Adds configureAuthType to enable/disable a single SSO configuration without deleting its stored settings, plus a shared SSOAuthType type reused on Tenant/TenantSettings.
Actionable comments posted: 0
Merge risk: 🟢 Low: minimal, isolated addition that mirrors the existing deleteSettings/configureSSORedirectURL request-building pattern exactly, the type consolidation is type-identical (non-breaking), and the new tests match established conventions for both the with-ssoId and default-configuration cases.
Declared coverage: FULL — 5/5 changed files reviewed.
Description
Wraps the new management endpoint
POST /v1/mgmt/sso/settings/authtypeWhy. A customer running their own admin UI on the management APIs needs to temporarily disable one SSO connection of a multi-SSO tenant. Until now the only per-connection off switch was
deleteSettings, which drops the connection: re-enabling meantnewSettingsplus a fullconfigureSAMLSettings/configureOIDCSettingsreplay, and the caller had to store the mappings, the domains and the OIDCclientSecret(never returned on read). For SAML it was worse, since a recreated connection gets a new ACS URL and the tenant's IdP admin has to reconfigure.configureAuthTypekeeps the stored configuration intact, so re-enabling needs no payload.Also names the
'none' | 'saml' | 'oidc'unionSSOAuthTypeand reuses it onTenantandTenantSettings, which both already inlined it. Type-identical, so not a breaking change.Tests
lib/management/sso.test.ts— the request shape with anssoId, and the default-configuration call that omits it. Full suite green.