feat(sso): add ConfigureAuthType to enable or disable an SSO configuration - #836
Conversation
…ation Wraps POST /v1/mgmt/sso/settings/authtype: descope.SSOAuthTypeNone disables one SSO configuration without deleting it, SSOAuthTypeSaml/SSOAuthTypeOidc 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. Requires descope/backend#2355. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
🐕 Suggested ReviewersThis PR introduces a new SSO management endpoint for configuring authentication types. The changes span API client definitions, SDK management interfaces, SSO-specific business logic, and comprehensive testing. The review strategy prioritizes contributors with deep expertise in the SSO domain and broad coverage across the SDK's architectural layers. Selected reviewers include specialists in SSO implementation (with both implementation and testing experience) and senior contributors familiar with the broader API/SDK structure to ensure consistency and quality across all modified areas.
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's auth type without dropping its stored settings, following the existing SSO management method pattern end-to-end.
Actionable comments posted: 0
Merge risk: 🟢 Low: small additive change, implementation/route/interface/mock/tests all consistent with sibling SSO methods (e.g. ConfigureSSORedirectURL, ConfigureOIDCSettings), no enum validation gaps beyond existing precedent, no missing integration points found.
Declared coverage: FULL — 7/7 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, with the caller storing the mappings, the domains and the OIDC client secret (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.ConfigureAuthTypeleaves the stored configuration intact, so re-enabling needs no payload.Adds
descope.SSOAuthTypewithSSOAuthTypeNone/SSOAuthTypeSaml/SSOAuthTypeOidc, following the existingRoleInheritance/AuthFactorconstant pattern.Tests
descope/internal/mgmt/sso_test.go— the request body with anssoID, the default-configuration call that omits it, and both missing-argument guards.MockSSO.ConfigureAuthTypeadded for consumers. Full suite green.