From 55c4489108adb4dc1623b89f00e06f2185ae827f Mon Sep 17 00:00:00 2001 From: Darcy Ye Date: Fri, 17 Jan 2025 11:42:10 +0800 Subject: [PATCH] feat(console): add SAML app flow (#6944) * feat(console): add SAML app * fix: integration test setup --- .github/workflows/integration-test.yml | 8 +++++--- packages/console/src/assets/docs/guides/saml-idp/index.ts | 2 +- packages/console/src/components/Guide/hooks.ts | 6 ++---- packages/console/src/types/applications.ts | 1 + .../src/locales/en/translation/admin-console/guide.ts | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 076267b87..6b47bc1de 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -16,7 +16,9 @@ jobs: matrix: # Run the integration tests with and without dev features enabled dev-features-enabled: [true, false] - runs-on: ubuntu-latest + # An error will occur if we use a newer version of Ubuntu in the CI environment, as it has restrictions on unprivileged user namespaces and sandbox usage, which prevents Chromium (used by Puppeteer) from launching properly during integration tests. So we lock the Ubuntu version to 22.04. + # See error record: https://github.com/logto-io/logto/actions/runs/12803809008/job/35697654974 + runs-on: ubuntu-22.04 env: INTEGRATION_TEST: true DEV_FEATURES_ENABLED: ${{ matrix.dev-features-enabled }} @@ -35,7 +37,7 @@ jobs: # Run the integration tests with and without dev features enabled dev-features-enabled: [true, false] needs: package - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: INTEGRATION_TEST: true DEV_FEATURES_ENABLED: ${{ matrix.dev-features-enabled }} @@ -53,7 +55,7 @@ jobs: rerun-on-failure: needs: run-logto if: failure() && fromJSON(github.run_attempt) < 3 - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - env: GH_REPO: ${{ github.repository }} diff --git a/packages/console/src/assets/docs/guides/saml-idp/index.ts b/packages/console/src/assets/docs/guides/saml-idp/index.ts index 0d4e64faf..927a1f675 100644 --- a/packages/console/src/assets/docs/guides/saml-idp/index.ts +++ b/packages/console/src/assets/docs/guides/saml-idp/index.ts @@ -6,7 +6,7 @@ const metadata = Object.freeze({ name: 'SAML', description: 'Use Logto as a SAML identity provider (IdP) for your application.', target: ApplicationType.SAML, - isThirdParty: true, + isThirdParty: false, skipGuideAfterCreation: true, isCloud: true, isDevFeature: true, diff --git a/packages/console/src/components/Guide/hooks.ts b/packages/console/src/components/Guide/hooks.ts index fae7aba7b..13fe41bac 100644 --- a/packages/console/src/components/Guide/hooks.ts +++ b/packages/console/src/components/Guide/hooks.ts @@ -1,4 +1,3 @@ -import { ApplicationType } from '@logto/schemas'; import { useCallback, useMemo } from 'react'; import { guides } from '@/assets/docs/guides'; @@ -17,6 +16,7 @@ const defaultStructuredMetadata: StructuredAppGuideMetadata = { Native: [], MachineToMachine: [], Protected: [], + SAML: [], ThirdParty: [], }; @@ -100,9 +100,7 @@ export const useAppGuideMetadata = (): { return accumulated; } - // We have ensured that SAML applications are always third party in DB schema, we use `||` here to make TypeScript happy. - // TODO: @darcy fix this when SAML third-party app guide is ready - if (target === ApplicationType.SAML || isThirdParty) { + if (isThirdParty) { return { ...accumulated, [thirdPartyAppCategory]: [...accumulated[thirdPartyAppCategory], guide], diff --git a/packages/console/src/types/applications.ts b/packages/console/src/types/applications.ts index b7ed2b811..cd076e594 100644 --- a/packages/console/src/types/applications.ts +++ b/packages/console/src/types/applications.ts @@ -25,6 +25,7 @@ export const allAppGuideCategories = Object.freeze([ 'Native', 'Protected', 'MachineToMachine', + 'SAML', thirdPartyAppCategory, ] as const); diff --git a/packages/phrases/src/locales/en/translation/admin-console/guide.ts b/packages/phrases/src/locales/en/translation/admin-console/guide.ts index 284561212..f9d3cd1a3 100644 --- a/packages/phrases/src/locales/en/translation/admin-console/guide.ts +++ b/packages/phrases/src/locales/en/translation/admin-console/guide.ts @@ -9,7 +9,7 @@ const guide = { MachineToMachine: 'Machine-to-machine', Protected: 'Non-SDK Integration', ThirdParty: 'Third-party app', - SAML: 'SAML', + SAML: 'SAML app', }, filter: { title: 'Filter framework',