Skip to content

Commit cda5d7b

Browse files
authored
feat(shared): Export SAML_IDPS from @clerk/shared/saml (#6682)
1 parent e9f538a commit cda5d7b

File tree

16 files changed

+336
-308
lines changed

16 files changed

+336
-308
lines changed

.changeset/new-deer-attend.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@clerk/shared': patch
3+
'@clerk/types': patch
4+
---
5+
6+
The `SAML_IDPS` export was moved from `@clerk/types` to `@clerk/shared/saml` and was marked as deprecated.
7+
8+
Please use `import { SAML_IDPS } from "@clerk/shared/saml"` instead.

packages/shared/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"object",
116116
"oauth",
117117
"web3",
118+
"saml",
118119
"getEnvVariable",
119120
"pathMatcher",
120121
"organization",

packages/shared/src/saml.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { SamlIdpMap } from '@clerk/types';
2+
3+
export const SAML_IDPS: SamlIdpMap = {
4+
saml_okta: {
5+
name: 'Okta Workforce',
6+
logo: 'okta',
7+
},
8+
saml_google: {
9+
name: 'Google Workspace',
10+
logo: 'google',
11+
},
12+
saml_microsoft: {
13+
name: 'Microsoft Entra ID (Formerly AD)',
14+
logo: 'azure',
15+
},
16+
saml_custom: {
17+
name: 'SAML',
18+
logo: 'saml',
19+
},
20+
};

packages/types/src/authConfig.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { PhoneCodeChannel } from 'phoneCodeChannel';
2-
1+
import type { PhoneCodeChannel } from './phoneCodeChannel';
32
import type { ClerkResource } from './resource';
43
import type { AuthConfigJSONSnapshot } from './snapshots';
54

packages/types/src/commerceSettings.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import type { CommerceSettingsJSONSnapshot } from 'snapshots';
2-
31
import type { ClerkResourceJSON } from './json';
42
import type { ClerkResource } from './resource';
3+
import type { CommerceSettingsJSONSnapshot } from './snapshots';
54

65
export interface CommerceSettingsJSON extends ClerkResourceJSON {
76
billing: {

packages/types/src/hooks.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import type { OrganizationCustomRoleKey } from 'organizationMembership';
2-
import type { SignInResource } from 'signIn';
3-
41
import type { SetActive, SignOut } from './clerk';
52
import type { ActClaim, JwtPayload } from './jwtv2';
3+
import type { OrganizationCustomRoleKey } from './organizationMembership';
64
import type {
75
CheckAuthorizationWithCustomPermissions,
86
GetToken,
97
SessionResource,
108
SignedInSessionResource,
119
} from './session';
10+
import type { SignInResource } from './signIn';
1211
import type { SignUpResource } from './signUp';
1312
import type { UserResource } from './user';
1413

packages/types/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export * from './redirects';
5050
export * from './resource';
5151
export * from './role';
5252
export * from './router';
53+
/**
54+
* TODO @revamp-hooks: Drop this in the next major release.
55+
*/
56+
export * from './runtime-values';
5357
export * from './saml';
5458
export * from './samlAccount';
5559
export * from './samlConnection';

packages/types/src/oauth.ts

Lines changed: 0 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -69,221 +69,3 @@ export type OAuthProvider =
6969
| EnstallOauthProvider
7070
| HuggingfaceOAuthProvider
7171
| CustomOauthProvider;
72-
73-
/**
74-
* @deprecated Use `import { OAUTH_PROVIDERS } from "@clerk/shared/oauth"` instead.
75-
*
76-
* @hidden
77-
*/
78-
export const OAUTH_PROVIDERS: OAuthProviderData[] = [
79-
{
80-
provider: 'google',
81-
strategy: 'oauth_google',
82-
name: 'Google',
83-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/google',
84-
},
85-
{
86-
provider: 'discord',
87-
strategy: 'oauth_discord',
88-
name: 'Discord',
89-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/discord',
90-
},
91-
{
92-
provider: 'facebook',
93-
strategy: 'oauth_facebook',
94-
name: 'Facebook',
95-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/facebook',
96-
},
97-
{
98-
provider: 'twitch',
99-
strategy: 'oauth_twitch',
100-
name: 'Twitch',
101-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/twitch',
102-
},
103-
{
104-
provider: 'twitter',
105-
strategy: 'oauth_twitter',
106-
name: 'Twitter',
107-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/twitter',
108-
},
109-
{
110-
provider: 'microsoft',
111-
strategy: 'oauth_microsoft',
112-
name: 'Microsoft',
113-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/microsoft',
114-
},
115-
{
116-
provider: 'tiktok',
117-
strategy: 'oauth_tiktok',
118-
name: 'TikTok',
119-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/tiktok',
120-
},
121-
{
122-
provider: 'linkedin',
123-
strategy: 'oauth_linkedin',
124-
name: 'LinkedIn',
125-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/linkedin',
126-
},
127-
{
128-
provider: 'linkedin_oidc',
129-
strategy: 'oauth_linkedin_oidc',
130-
name: 'LinkedIn',
131-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/linkedin-oidc',
132-
},
133-
{
134-
provider: 'github',
135-
strategy: 'oauth_github',
136-
name: 'GitHub',
137-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/github',
138-
},
139-
{
140-
provider: 'gitlab',
141-
strategy: 'oauth_gitlab',
142-
name: 'GitLab',
143-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/gitlab',
144-
},
145-
{
146-
provider: 'dropbox',
147-
strategy: 'oauth_dropbox',
148-
name: 'Dropbox',
149-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/dropbox',
150-
},
151-
{
152-
provider: 'atlassian',
153-
strategy: 'oauth_atlassian',
154-
name: 'Atlassian',
155-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/atlassian',
156-
},
157-
{
158-
provider: 'bitbucket',
159-
strategy: 'oauth_bitbucket',
160-
name: 'Bitbucket',
161-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/bitbucket',
162-
},
163-
{
164-
provider: 'hubspot',
165-
strategy: 'oauth_hubspot',
166-
name: 'HubSpot',
167-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/hubspot',
168-
},
169-
{
170-
provider: 'notion',
171-
strategy: 'oauth_notion',
172-
name: 'Notion',
173-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/notion',
174-
},
175-
{
176-
provider: 'apple',
177-
strategy: 'oauth_apple',
178-
name: 'Apple',
179-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/apple',
180-
},
181-
{
182-
provider: 'line',
183-
strategy: 'oauth_line',
184-
name: 'LINE',
185-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/line',
186-
},
187-
{
188-
provider: 'instagram',
189-
strategy: 'oauth_instagram',
190-
name: 'Instagram',
191-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/instagram',
192-
},
193-
{
194-
provider: 'coinbase',
195-
strategy: 'oauth_coinbase',
196-
name: 'Coinbase',
197-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/coinbase',
198-
},
199-
{
200-
provider: 'spotify',
201-
strategy: 'oauth_spotify',
202-
name: 'Spotify',
203-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/spotify',
204-
},
205-
{
206-
provider: 'xero',
207-
strategy: 'oauth_xero',
208-
name: 'Xero',
209-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/xero',
210-
},
211-
{
212-
provider: 'box',
213-
strategy: 'oauth_box',
214-
name: 'Box',
215-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/box',
216-
},
217-
{
218-
provider: 'slack',
219-
strategy: 'oauth_slack',
220-
name: 'Slack',
221-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/slack',
222-
},
223-
{
224-
provider: 'linear',
225-
strategy: 'oauth_linear',
226-
name: 'Linear',
227-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/linear',
228-
},
229-
{
230-
provider: 'x',
231-
strategy: 'oauth_x',
232-
name: 'X / Twitter',
233-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/x-twitter-v2',
234-
},
235-
{
236-
provider: 'enstall',
237-
strategy: 'oauth_enstall',
238-
name: 'Enstall',
239-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/enstall',
240-
},
241-
{
242-
provider: 'huggingface',
243-
strategy: 'oauth_huggingface',
244-
name: 'Hugging Face',
245-
docsUrl: 'https://clerk.com/docs/authentication/social-connections/huggingface',
246-
},
247-
];
248-
249-
interface getOAuthProviderDataProps {
250-
provider?: OAuthProvider;
251-
strategy?: OAuthStrategy;
252-
}
253-
254-
/**
255-
* @deprecated This utility will be dropped in the next major release.
256-
*
257-
* @hidden
258-
*/
259-
export function getOAuthProviderData({
260-
provider,
261-
strategy,
262-
}: getOAuthProviderDataProps): OAuthProviderData | undefined | null {
263-
if (provider) {
264-
return OAUTH_PROVIDERS.find(oauth_provider => oauth_provider.provider == provider);
265-
}
266-
267-
return OAUTH_PROVIDERS.find(oauth_provider => oauth_provider.strategy == strategy);
268-
}
269-
270-
/**
271-
* @deprecated This utility will be dropped in the next major release.
272-
*
273-
* @hidden
274-
*/
275-
export function sortedOAuthProviders(sortingArray: OAuthStrategy[]) {
276-
return OAUTH_PROVIDERS.slice().sort((a, b) => {
277-
let aPos = sortingArray.indexOf(a.strategy);
278-
if (aPos == -1) {
279-
aPos = Number.MAX_SAFE_INTEGER;
280-
}
281-
282-
let bPos = sortingArray.indexOf(b.strategy);
283-
if (bPos == -1) {
284-
bPos = Number.MAX_SAFE_INTEGER;
285-
}
286-
287-
return aPos - bPos;
288-
});
289-
}

packages/types/src/phoneNumber.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type { PhoneCodeChannel } from 'phoneCodeChannel';
2-
31
import type { IdentificationLinkResource } from './identificationLink';
2+
import type { PhoneCodeChannel } from './phoneCodeChannel';
43
import type { ClerkResource } from './resource';
54
import type { PhoneNumberJSONSnapshot } from './snapshots';
65
import type { PhoneCodeStrategy } from './strategies';

0 commit comments

Comments
 (0)