Skip to content

Commit 653e04d

Browse files
committed
feat(backend): deprecate domain field in favor of domains on SAML connection and account
This commit deprecates the existing `domain` field, and introduces a new field on both models: - SAML connection - SAML account It also updates the create and update params to support the new fields
1 parent 55e8fca commit 653e04d

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

.changeset/lucky-spoons-wonder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': minor
3+
---
4+
5+
Deprecates `domain` field and introduce `domains`. Now, SAML connections support multiple domains, the `domain` field still supported but it's deprecated and will be removed on a future API version.

packages/backend/src/api/endpoints/SamlConnectionApi.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ type SamlConnectionListParams = {
1313
type CreateSamlConnectionParams = {
1414
name: string;
1515
provider: SamlIdpSlug;
16+
/** @deprecated Use `domains` array instead. This field will be removed in a future API version.. */
1617
domain: string;
18+
domains: string[];
1719
organizationId?: string;
1820
idpEntityId?: string;
1921
idpSsoUrl?: string;
@@ -31,7 +33,9 @@ type CreateSamlConnectionParams = {
3133
type UpdateSamlConnectionParams = {
3234
name?: string;
3335
provider?: SamlIdpSlug;
36+
/** @deprecated Use `domains` array instead. This field will be removed in a future API version.. */
3437
domain?: string;
38+
domains?: string[];
3539
organizationId?: string;
3640
idpEntityId?: string;
3741
idpSsoUrl?: string;

packages/backend/src/api/resources/JSON.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ export interface SamlConnectionJSON extends ClerkResourceJSON {
631631
object: typeof ObjectType.SamlConnection;
632632
name: string;
633633
domain: string;
634+
domains: string[];
634635
organization_id: string | null;
635636
idp_entity_id: string;
636637
idp_sso_url: string;
@@ -688,6 +689,7 @@ export interface SamlAccountConnectionJSON extends ClerkResourceJSON {
688689
id: string;
689690
name: string;
690691
domain: string;
692+
domains: string[];
691693
active: boolean;
692694
provider: string;
693695
sync_user_attributes: boolean;

packages/backend/src/api/resources/SamlConnection.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ export class SamlConnection {
1414
*/
1515
readonly name: string,
1616
/**
17-
* The domain of your organization. Sign in flows using an email with this domain will use the connection.
17+
* @deprecated The domain of your organization. Sign in flows using an email with this domain will use the connection.
1818
*/
1919
readonly domain: string,
20+
/**
21+
* The domains of your organization. Sign in flows using an email with one of these domains will use the connection.
22+
*/
23+
readonly domains: string[],
2024
/**
2125
* The organization ID of the organization.
2226
*/
@@ -95,6 +99,7 @@ export class SamlConnection {
9599
data.id,
96100
data.name,
97101
data.domain,
102+
data.domains,
98103
data.organization_id,
99104
data.idp_entity_id,
100105
data.idp_sso_url,
@@ -121,7 +126,11 @@ export class SamlAccountConnection {
121126
constructor(
122127
readonly id: string,
123128
readonly name: string,
129+
/**
130+
* @deprecated Use `domains` array instead. This field will be removed in a future version.
131+
*/
124132
readonly domain: string,
133+
readonly domains: string[],
125134
readonly active: boolean,
126135
readonly provider: string,
127136
readonly syncUserAttributes: boolean,
@@ -135,6 +144,7 @@ export class SamlAccountConnection {
135144
data.id,
136145
data.name,
137146
data.domain,
147+
data.domains,
138148
data.active,
139149
data.provider,
140150
data.sync_user_attributes,

0 commit comments

Comments
 (0)