Skip to content

Commit

Permalink
refactor(core,schemas): refactor the sso connector factory type (#5541)
Browse files Browse the repository at this point in the history
* refactor(core,schemas): refactor the sso connector factory type

refactor the sso connector factory type and add providerType to the config data

* fix(core): fix ut

fix ut

* refactor(schemas): add the providerType to the providerDetails return type

add the new providerType property to the providerDetails return type
  • Loading branch information
simeng-li authored Mar 27, 2024
1 parent 592d467 commit 92d45f2
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
singleSignOnConnectorSessionGuard,
singleSignOnInteractionIdentifierResultGuard,
type SingleSignOnInteractionIdentifierResult,
} from '#src/sso/types/session.js';
} from '#src/sso/index.js';
import assertThat from '#src/utils/assert-that.js';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import RequestError from '#src/errors/RequestError/index.js';
import { type WithLogContext } from '#src/middleware/koa-audit-log.js';
import { OidcSsoConnector } from '#src/sso/OidcSsoConnector/index.js';
import { ssoConnectorFactories } from '#src/sso/index.js';
import { type SingleSignOnConnectorData } from '#src/sso/types/index.js';
import { type SingleSignOnConnectorData } from '#src/sso/types/connector.js';
import { createMockLogContext } from '#src/test-utils/koa-audit-log.js';
import { createMockProvider } from '#src/test-utils/oidc-provider.js';
import { MockTenant } from '#src/test-utils/tenant.js';
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/routes/interaction/utils/single-sign-on.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import { z } from 'zod';
import RequestError from '#src/errors/RequestError/index.js';
import { type WithLogContext } from '#src/middleware/koa-audit-log.js';
import { type WithInteractionDetailsContext } from '#src/routes/interaction/middleware/koa-interaction-details.js';
import { ssoConnectorFactories } from '#src/sso/index.js';
import { type SingleSignOnConnectorSession } from '#src/sso/types/index.js';
import { ssoConnectorFactories, type SingleSignOnConnectorSession } from '#src/sso/index.js';
import type Queries from '#src/tenants/Queries.js';
import type TenantContext from '#src/tenants/TenantContext.js';
import assertThat from '#src/utils/assert-that.js';
Expand Down
7 changes: 5 additions & 2 deletions packages/core/src/routes/sso-connector/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ const mockTenantId = 'mock_tenant_id';

describe('parseFactoryDetail', () => {
it.each(Object.values(SsoProviderName))('should return correct detail for %s', (providerName) => {
const { logo, logoDark, description, name } = ssoConnectorFactories[providerName];
const { logo, logoDark, description, name, providerType } = ssoConnectorFactories[providerName];
const detail = parseFactoryDetail(ssoConnectorFactories[providerName], 'en');

expect(detail).toEqual({
providerName,
providerType,
logo,
logoDark,
description: description.en,
Expand All @@ -35,11 +36,13 @@ describe('parseFactoryDetail', () => {
it.each(Object.values(SsoProviderName))(
'should return correct detail for %s with unknown locale',
(providerName) => {
const { logo, logoDark, description, name } = ssoConnectorFactories[providerName];
const { logo, logoDark, description, name, providerType } =
ssoConnectorFactories[providerName];
const detail = parseFactoryDetail(ssoConnectorFactories[providerName], 'zh');

expect(detail).toEqual({
providerName,
providerType,
logo,
logoDark,
description: description.en,
Expand Down
8 changes: 5 additions & 3 deletions packages/core/src/routes/sso-connector/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { trySafe } from '@silverhand/essentials';
import RequestError from '#src/errors/RequestError/index.js';
import SamlConnector from '#src/sso/SamlConnector/index.js';
import { type SingleSignOnFactory, ssoConnectorFactories } from '#src/sso/index.js';
import { type SingleSignOnConnectorData } from '#src/sso/types/index.js';
import { type SingleSignOnConnectorData } from '#src/sso/types/connector.js';

const isKeyOfI18nPhrases = (key: string, phrases: I18nPhrases): key is keyof I18nPhrases =>
key in phrases;
Expand All @@ -20,10 +20,11 @@ export const parseFactoryDetail = (
factory: SingleSignOnFactory<SsoProviderName>,
locale: string
) => {
const { providerName, logo, logoDark, description, name } = factory;
const { providerName, logo, logoDark, description, name, providerType } = factory;

return {
providerName,
providerType,
logo,
logoDark,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- falsy value expected
Expand Down Expand Up @@ -61,7 +62,7 @@ export const fetchConnectorProviderDetails = async (
): Promise<SsoConnectorWithProviderConfig> => {
const { providerName } = connector;

const { logo, logoDark, constructor, name } = ssoConnectorFactories[providerName];
const { logo, logoDark, constructor, name, providerType } = ssoConnectorFactories[providerName];

/*
Safely fetch and parse the detailed connector config from provider.
Expand All @@ -76,6 +77,7 @@ export const fetchConnectorProviderDetails = async (
...connector,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- falsy value expected
name: (isKeyOfI18nPhrases(locale, name) && name[locale]) || name.en,
providerType,
providerLogo: logo,
providerLogoDark: logoDark,
providerConfig,
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/sso/AzureAdSsoConnector/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SsoProviderName } from '@logto/schemas';
import { SsoProviderName, SsoProviderType } from '@logto/schemas';

import { SamlSsoConnector } from '../SamlSsoConnector/index.js';
import { type SingleSignOnFactory } from '../index.js';
Expand All @@ -8,6 +8,7 @@ export class AzureAdSsoConnector extends SamlSsoConnector {}

export const azureAdSsoConnectorFactory: SingleSignOnFactory<SsoProviderName.AZURE_AD> = {
providerName: SsoProviderName.AZURE_AD,
providerType: SsoProviderType.SAML,
logo: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUuMDY5MzQgMTguNzA5N0M1LjU4NjY3IDE5LjAzMjMgNi40NDY2NyAxOS4zOTEgNy4zNTYgMTkuMzkxQzguMTg0IDE5LjM5MSA4Ljk1MzM0IDE5LjE1MSA5LjU5MDY3IDE4Ljc0MTdDOS41OTA2NyAxOC43NDE3IDkuNTkyIDE4Ljc0MTcgOS41OTMzNCAxOC43NDAzTDEyI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Mi42NjUzQzEyLjM4NCAyMi42NjUzIDEyLjc2NTMgMjIuNTYxMyAxMy4wOTg3IDIyLjM1MzNMMjMuMDk4NyAxNi4xMDI3VjE2LjEwNFoiIGZpbGw9IiMwNzQ3OTMiLz4KPHBhdGggZD0iTTEyLjAwMTMgMS4zMzMwMVY3LjAzMzAxTDEyLjE0NjcgNi44NjkwMUMxMi44OCA2LjAzMzAxIDEzLjk4MjcgNS41MDEwMSAxNS4yMTYgNS41MDEwMUMxNS44NDUzIDUuNTAxMDEgMTYuNDM3MyA1LjY0MzY3IDE2Ljk2NjcgNS44ODkwMUwxMy41MjggMi4wMTAzNEMxMy4xMjkzIDEuNTU5NjcgMTIuNTY0IDEuMzM0MzQgMTIgMS4zMzQzNEwxMi4wMDEzIDEuMzMzMDFaIiBmaWxsPSIjMDI5NEU0Ii8+CjxwYXRoIGQ9Ik0xNy44MiAxMy41OTkyTDEyLjAwMTMgNy4wMzUxNlYxNy4yMzUyTDE3LjgyIDEzLjU5OTJaIiBmaWxsPSIjOTZCQ0MyIi8+Cjwvc3ZnPgo=',
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/sso/AzureOidcSsoConnector/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SsoProviderName } from '@logto/schemas';
import { SsoProviderName, SsoProviderType } from '@logto/schemas';
import { conditional } from '@silverhand/essentials';
import camelcaseKeys from 'camelcase-keys';

Expand Down Expand Up @@ -65,6 +65,7 @@ export class AzureOidcSsoConnector extends OidcSsoConnector {

export const azureOidcSsoConnectorFactory: SingleSignOnFactory<SsoProviderName.AZURE_AD_OIDC> = {
providerName: SsoProviderName.AZURE_AD_OIDC,
providerType: SsoProviderType.OIDC,
logo: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4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LjMwMTMgMTQuMTYxMyAyMy41MjkzIDEzLjI4OTNMMTYuOTY4IDUuODg4QzE2LjQzODcgNS42NDEzMyAxNS44NDUzIDUuNSAxNS4yMTczIDUuNUMxMy45ODQgNS41IDEyLjg4MTMgNi4wMzIgMTIuMTQ4IDYuODY4TDEyLjAwMjcgNy4wMzJMMTcuODIxMyAxMy41OTczTDEyLjAwMTMgMTcuMjM0N1YyMi42NjUzQzEyLjM4NCAyMi42NjUzIDEyLjc2NTMgMjIuNTYxMyAxMy4wOTg3IDIyLjM1MzNMMjMuMDk4NyAxNi4xMDI3VjE2LjEwNFoiIGZpbGw9IiMwNzQ3OTMiLz4KPHBhdGggZD0iTTEyLjAwMTMgMS4zMzMwMVY3LjAzMzAxTDEyLjE0NjcgNi44NjkwMUMxMi44OCA2LjAzMzAxIDEzLjk4MjcgNS41MDEwMSAxNS4yMTYgNS41MDEwMUMxNS44NDUzIDUuNTAxMDEgMTYuNDM3MyA1LjY0MzY3IDE2Ljk2NjcgNS44ODkwMUwxMy41MjggMi4wMTAzNEMxMy4xMjkzIDEuNTU5NjcgMTIuNTY0IDEuMzM0MzQgMTIgMS4zMzQzNEwxMi4wMDEzIDEuMzMzMDFaIiBmaWxsPSIjMDI5NEU0Ii8+CjxwYXRoIGQ9Ik0xNy44MiAxMy41OTkyTDEyLjAwMTMgNy4wMzUxNlYxNy4yMzUyTDE3LjgyIDEzLjU5OTJaIiBmaWxsPSIjOTZCQ0MyIi8+Cjwvc3ZnPgo=',
Expand Down
10 changes: 4 additions & 6 deletions packages/core/src/sso/GoogleWorkspaceSsoConnector/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { SsoProviderName } from '@logto/schemas';
import { SsoProviderName, SsoProviderType } from '@logto/schemas';

import OidcConnector from '../OidcConnector/index.js';
import { type SingleSignOnFactory } from '../index.js';
import {
type CreateSingleSignOnSession,
type SingleSignOn,
type SingleSignOnConnectorData,
} from '../types/index.js';
import { type SingleSignOn, type SingleSignOnConnectorData } from '../types/connector.js';
import { basicOidcConnectorConfigGuard } from '../types/oidc.js';
import { type CreateSingleSignOnSession } from '../types/session.js';

// Google use static issue endpoint.
const googleIssuer = 'https://accounts.google.com';
Expand Down Expand Up @@ -53,6 +50,7 @@ export const googleWorkspaceSsoConnectorConfigGuard = basicOidcConnectorConfigGu
export const googleWorkSpaceSsoConnectorFactory: SingleSignOnFactory<SsoProviderName.GOOGLE_WORKSPACE> =
{
providerName: SsoProviderName.GOOGLE_WORKSPACE,
providerType: SsoProviderType.OIDC,
logo: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMy41MiAxMi4yNzI5QzIzLjUyIDExLjQyMiAyMy40NDM2IDEwLjYwMzggMjMuMzAxOCA5LjgxODM2SDEyVjE0LjQ2MDJIMTguNDU4MkMxOC4xOCAxNS45NjAyIDE3LjMzNDUgMTcuMjMxMSAxNi4wNjM2IDE4LjA4MlYyMS4wOTI5SDE5Ljk0MThDMjIuMjEwOSAxOS4wMDM4IDIzLjUyIDE1LjkyNzQgMjMuNTIgMTIuMjcyOVYxMi4yNzI5WiIgZmlsbD0iIzQyODVGNCIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDIzLjk5OTNDMTUuMjQgMjMuOTk5MyAxNy45NTY0IDIyLjkyNDggMTkuOTQxOCAyMS4wOTJMMTYuMDYzNiAxOC4wODExQzE0Ljk4OTEgMTguODAxMSAxMy42MTQ1IDE5LjIyNjYgMTIgMTkuMjI2NkM4Ljg3NDU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