feat(tenant): add generate_sso_configuration_link to Tenant management#1534
Conversation
Update the generate_sso_configuration_link method to include all optional parameters from the API specification: - Make tenant_id and expire_time optional (as per API docs) - Add email parameter for admin email address - Add sso_id parameter for SSO identifier This ensures full compatibility with the /v2/mgmt/tenant/adminlinks/sso/generate API endpoint as documented in the Descope API reference. Changes: - Update method signature to include all optional parameters - Implement conditional parameter inclusion in request body - Add comprehensive tests for all parameter combinations - Add test for minimal parameters (no arguments) Resolves: #0F83 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds/updates the Tenant management API to generate a JIT SSO (admin self-service) configuration link with full optional parameter support, aligning the Python SDK surface with the management API spec.
Changes:
- Updated
Tenant.generate_sso_configuration_linkto accept optionaltenant_id,expire_time,email, andsso_id, and to only send provided fields. - Expanded tenant management tests to cover “all parameters” and “no parameters” request shapes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
descope/management/tenant.py |
Expands the SDK method signature and request body construction for SSO configuration link generation. |
tests/management/test_tenant.py |
Adds unit tests validating request payloads for full and minimal parameter usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)descope/management/tenant.py
|
|
@shuni tenant_id should not be optional, and also fix pr title |
|
🐕 Done! Updated PR: #1534 📋 Actions TakenView AI responsePerfect! I've completed both requested changes: ✅ Changes Made1. Made
|
Make tenant_id a required parameter instead of optional, as it's needed for the API to function correctly. Update test to pass tenant_id when calling with minimal parameters. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes descope/etc#15591
View workflow run
Perfect! I've updated the implementation to include all the missing parameters from the API specification. Here's what was changed:
🎯 Changes Made
Updated Method:
generate_sso_configuration_linkNew signature with all API parameters:
Key Updates:
Added Missing Parameters:
email- Email address associated with the adminsso_id- SSO identifier for the tenantMade All Parameters Optional:
tenant_id- Now optional (per API docs)expire_time- Now optional (per API docs)Enhanced Tests:
📊 Quality Gate Results ✅
💻 Usage Examples
The implementation now fully matches the API specification! 🚀
Created by Shuni 🐕