feat(sso): add configure_auth_type to enable or disable an SSO configuration - #1675
Conversation
…uration 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 sso_id, 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. Body composition lives in the shared base, with thin sync and async methods. 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 configuration endpoint wrapper (
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 configure_auth_type to enable/disable a single SSO configuration's auth type without touching its stored settings, mappings, or domains.
Actionable comments posted: 0
Merge risk: 🟢 Low: body composition and truthy sso_id handling exactly mirror the existing configure_xaa_settings/_compose_configure_xaa_settings_body pattern, endpoint path matches the spec, and the new test covers the failure path plus both sso_id-present and default-configuration cases in sync and async modes.
Declared coverage: FULL — 6/6 changed files reviewed.
delete_settings could only delete a tenant's default SSO configuration, so a multi-SSO tenant's additional configurations were unreachable from this SDK. The node and go SDKs already pass ssoId through; this brings python in line. Optional keyword, so existing calls are unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)descope/management/common.py
descope/management/sso_settings_async.py
descope/management/_sso_settings_base.py
descope/management/sso_settings.py
|
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
delete_settings, which drops the connection: re-enabling meantnew_settingsplus a fullconfigure_saml_settings/configure_oidc_settingsreplay, 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.configure_auth_typeleaves the stored configuration intact, so re-enabling needs no payload.Body composition sits in
_sso_settings_base.pywith thin sync and async methods, matchingconfigure_xaa_settings.Second commit —
delete_settingsacceptssso_id. It previously sent onlytenantId, so it could only delete a tenant's default configuration and a multi-SSO tenant's additional configurations were unreachable from this SDK. The node and go SDKs already passssoIdthrough. Optional keyword, so existing calls are unaffected.Tests
test_configure_auth_type— the failure path, the request body with ansso_id, and the default-configuration call that omits it.test_delete_settings— extended with the specific-configuration case assertingssoIdreaches the query params.Both run in sync and async modes. Full suite: 1084 passed, 26 skipped.
ruff checkandruff format --checkclean.