From 521e1acd6b6023cb9df7214bdd6cb521baedc64e Mon Sep 17 00:00:00 2001 From: Haris Chaniotakis Date: Mon, 29 Jan 2024 17:56:40 +0200 Subject: [PATCH] feat: Expose saml connection sp_metadata_url property As part of the SAML Connection response, we now also return the 'sp_metadata_url' property which someone can use it in order to configure faster the IdP --- clerk/saml_connections.go | 1 + clerk/saml_connections_test.go | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/clerk/saml_connections.go b/clerk/saml_connections.go index 28aa1c45..12c2cca5 100644 --- a/clerk/saml_connections.go +++ b/clerk/saml_connections.go @@ -17,6 +17,7 @@ type SAMLConnection struct { IdpCertificate *string `json:"idp_certificate"` AcsURL string `json:"acs_url"` SPEntityID string `json:"sp_entity_id"` + SPMetadataURL string `json:"sp_metadata_url"` Active bool `json:"active"` Provider string `json:"provider"` UserCount int64 `json:"user_count"` diff --git a/clerk/saml_connections_test.go b/clerk/saml_connections_test.go index b7265b0f..f0234c6a 100644 --- a/clerk/saml_connections_test.go +++ b/clerk/saml_connections_test.go @@ -182,8 +182,9 @@ const ( "idp_entity_id": "test-idp-entity-id", "idp_sso_url": "https://example.com/saml/sso", "idp_certificate": "` + dummySAMLConnectionCertificate + `", - "acs_url": "` + "https://clerk.example.com/v1/saml/acs" + dummySAMLConnectionID + `", - "sp_entity_id": "` + "https://clerk.example.com/acs" + dummySAMLConnectionID + `", + "acs_url": "` + "https://clerk.example.com/v1/saml/acs/" + dummySAMLConnectionID + `", + "sp_entity_id": "` + "https://clerk.example.com/saml/" + dummySAMLConnectionID + `", + "sp_metadata_url": "` + "https://clerk.example.com/v1/saml/metadata/" + dummySAMLConnectionID + `", "active": false, "provider": "saml_custom", "user_count": 3, @@ -199,8 +200,9 @@ const ( "idp_entity_id": "test-idp-entity-id", "idp_sso_url": "https://example.com/saml/sso", "idp_certificate": "` + dummySAMLConnectionCertificate + `", - "acs_url": "` + "https://clerk.example.com/v1/saml/acs" + dummySAMLConnectionID + `", - "sp_entity_id": "` + "https://clerk.example.com/acs" + dummySAMLConnectionID + `", + "acs_url": "` + "https://clerk.example.com/v1/saml/acs/" + dummySAMLConnectionID + `", + "sp_entity_id": "` + "https://clerk.example.com/saml/" + dummySAMLConnectionID + `", + "sp_metadata_url": "` + "https://clerk.example.com/v1/saml/metadata/" + dummySAMLConnectionID + `", "active": true, "provider": "saml_custom", "user_count": 3,