feat(tenant): add method for jit sso link generation#1530
Merged
Conversation
Add new method to generate tenant admin self-service links for SSO configuration, following the pattern from Go SDK PR #457. - Add tenant_generate_sso_configuration_link_path constant to MgmtV1 - Implement generate_sso_configuration_link method in Tenant class - Add comprehensive tests for success and failure scenarios - Update README with usage example The method generates a time-limited link that allows tenant admins to configure SSO settings. The expireTime parameter is specified in seconds (e.g., 21600 for 6 hours). Endpoint: POST /v2/mgmt/tenant/adminlinks/sso/generate Request: {"tenantId": string, "expireTime": int} Response: {"adminSSOConfigurationLink": string} Related: #457 (Go SDK), descope/etc#7560
Contributor
There was a problem hiding this comment.
Pull request overview
Adds tenant-management support for generating a JIT SSO configuration self-service admin link, exposing a new SDK method wired to the corresponding management API endpoint and documenting/test-driving the behavior.
Changes:
- Added a new management API path constant for generating SSO configuration links.
- Implemented
Tenant.generate_sso_configuration_link(tenant_id, expire_time) -> strthat POSTs the required payload and returns the generated link. - Added unit tests for success/failure flows and a README usage example.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
descope/management/common.py |
Adds the new mgmt endpoint path constant used by the tenant management client. |
descope/management/tenant.py |
Introduces generate_sso_configuration_link that calls the new endpoint and returns the link from the response JSON. |
tests/management/test_tenant.py |
Adds success/failure unit tests validating request shape and error handling. |
README.md |
Documents how to call the new tenant SSO configuration link generator. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aviadl
approved these changes
May 13, 2026
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)descope/management/tenant.py
descope/management/common.py
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes descope/etc#15591
View workflow run
Perfect! I've successfully implemented the
generate_sso_configuration_linkmethod in the Python SDK, following the pattern from the Go SDK PR #457.Summary of Changes
1. API Path Constant (
descope/management/common.py)tenant_generate_sso_configuration_link_path = "/v2/mgmt/tenant/adminlinks/sso/generate"2. Method Implementation (
descope/management/tenant.py)generate_sso_configuration_link(tenant_id: str, expire_time: int) -> strtenant_id: The tenant IDexpire_time: Expiration duration in seconds (e.g., 21600 for 6 hours)3. Tests (
tests/management/test_tenant.py)test_generate_sso_configuration_link_success: Verifies successful link generationtest_generate_sso_configuration_link_failed: Verifies error handling4. Documentation (
README.md)Quality Gate Results ✅
Implementation Details
POST /v2/mgmt/tenant/adminlinks/sso/generate{"tenantId": string, "expireTime": int}{"adminSSOConfigurationLink": string}The implementation follows the exact pattern from the Go SDK and is consistent with existing Python SDK conventions. All tests pass and code quality checks are green! 🎉
Created by Shuni 🐕