From a83fb3561fbe849f26af4d6345f67b01445366ae Mon Sep 17 00:00:00 2001 From: Paul Asjes Date: Mon, 21 Oct 2024 14:40:32 +0200 Subject: [PATCH] Add domain_verification intent --- pkg/portal/client.go | 9 +++++---- pkg/portal/client_test.go | 12 ++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/pkg/portal/client.go b/pkg/portal/client.go index ab83c3a..202393f 100644 --- a/pkg/portal/client.go +++ b/pkg/portal/client.go @@ -63,11 +63,12 @@ type GenerateLinkIntent string // Constants that enumerate the available GenerateLinkIntent types. const ( - SSO GenerateLinkIntent = "sso" - DSync GenerateLinkIntent = "dsync" - AuditLogs GenerateLinkIntent = "audit_logs" - LogStreams GenerateLinkIntent = "log_streams" + SSO GenerateLinkIntent = "sso" + DSync GenerateLinkIntent = "dsync" + AuditLogs GenerateLinkIntent = "audit_logs" + LogStreams GenerateLinkIntent = "log_streams" CertificateRenewal GenerateLinkIntent = "certificate_renewal" + DomainVerification GenerateLinkIntent = "domain_verification" ) // GenerateLinkOpts contains the options to request Organizations. diff --git a/pkg/portal/client_test.go b/pkg/portal/client_test.go index 4d0a08d..2a7c6f7 100644 --- a/pkg/portal/client_test.go +++ b/pkg/portal/client_test.go @@ -83,6 +83,18 @@ func TestGenerateLink(t *testing.T) { }, expected: "https://id.workos.test/portal/launch?secret=1234", }, + { + scenario: "Request returns link with domain_verification intent", + client: &Client{ + APIKey: "test", + }, + options: GenerateLinkOpts{ + Intent: DomainVerification, + Organization: "organization_id", + ReturnURL: "https://foo-corp.app.com/settings", + }, + expected: "https://id.workos.test/portal/launch?secret=1234", + }, } for _, test := range tests {