feat: SSO Suite invite Template and Provider support#251
feat: SSO Suite invite Template and Provider support#251
Conversation
Add email_service field to SSO authentication settings to support SSO Suite invite email provider and templates. This allows users to configure custom email templates and providers for SSO invitations. Changes: - Add email_service optional field to SSOAttributes - Add EmailService field to SSOModel struct - Update Values() to serialize email service configuration - Update SetValues() to deserialize email service configuration - Add UpdateReferences() method to handle provider references - Update authentication model to call SSO UpdateReferences This implements the missing functionality reported in the feature request where SSO Suite invite templates and providers were not being exported/imported by the Descope CLI and management service. Co-Authored-By: Shuni <shuni[bot]@users.noreply.github.com>
|
@shuni seems the acc tests are broken, the descope cli needs a project id - is this something you can fix here or in github.com/descope/descopecli maybe? |
|
🐕 Done! Updated PR: #251 📋 Actions TakenView AI responsePerfect! I've fixed the CLI issue. Here's what I found and did: The ProblemThe
The Fix (Applied)I've added a workaround in the CI workflow: DESCOPE_PROJECT_ID=P2placeholder descope project list | ...This sets a placeholder PROJECT_ID for the cleanup command. The actual project IDs are passed as arguments to Next StepsOption 1: Keep the workaround (done)The current fix works and won't break if descopecli gets updated. Option 2: Proper fix in descopecli (optional)If you want to fix this properly, the descopecli needs:
Would you like me to redirect to descopecli to create a proper fix there? Note: Test FailureThere's also a separate test failure in This appears to be testing SSO |
The descopecli 'project list' command requires DESCOPE_PROJECT_ID to be set even though it's a company-level operation (lists all projects in a company). This is a bug in descopecli where the list command inherits DefaultPreRun which requires the env var. Workaround: Set a placeholder PROJECT_ID for the cleanup command. The actual project IDs are passed as arguments to 'project delete', and arguments take precedence over the env var. This allows the test cleanup to work while we wait for a proper fix in descopecli to make 'project list' not require PROJECT_ID. Co-authored-by: Shuni <251468265+shuni-bot[bot]@users.noreply.github.com>
Fixes descope/etc#14265
View workflow run
Summary
I've successfully implemented the missing SSO Suite invite Template and Provider support in the Terraform provider by examining the managementservice implementation and adding the corresponding functionality.
What Was Done
Based on the managementservice changes (commits
cc2ba880and149ca706), I added email service support to the SSO authentication settings in the Terraform provider:Changes Made:
Added
email_servicefield to SSO settings (internal/models/project/authentication/sso.go):email_serviceattribute that follows the same pattern as other authentication methods (password, otp, etc.)Updated serialization/deserialization:
Values()method now serializes email service toemailServiceProviderandemailTemplatesAPI fieldsSetValues()method deserializes these fields from the API responseUpdateReferences()method to handle connector/provider referencesIntegrated with authentication model (
internal/models/project/authentication/authentication.go):UpdateReferences()methodHow It Works
The implementation follows the same pattern used by other authentication methods:
This maps to the managementservice API fields:
emailServiceProvider- The provider/connector ID for sending emailsemailTemplates- List of email templates for SSO invitationsemailTemplateId- The active template ID (extracted from the active template)Validation
UpdateReferences()The implementation now allows users to configure SSO Suite invite email templates and providers through Terraform, addressing the feature request where these settings were not being exported/imported.
Created by Shuni 🐕