From 3332fb6356e798e4da47a20edf183eee03ab6d7a Mon Sep 17 00:00:00 2001 From: wangsijie Date: Mon, 15 Jul 2024 11:00:31 +0800 Subject: [PATCH] chore: remove feature guard for token exchange --- .../MainContent/SettingsSection/InstructionTab/index.tsx | 3 +-- packages/core/src/routes/subject-token.openapi.json | 3 +-- packages/core/src/routes/subject-token.ts | 5 ----- packages/core/src/routes/swagger/index.ts | 1 - .../src/tests/api/oidc/token-exchange.test.ts | 3 --- packages/integration-tests/src/tests/api/security.test.ts | 3 --- 6 files changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/console/src/pages/CustomizeJwtDetails/MainContent/SettingsSection/InstructionTab/index.tsx b/packages/console/src/pages/CustomizeJwtDetails/MainContent/SettingsSection/InstructionTab/index.tsx index 7fc7bedfe6c..76003b617a4 100644 --- a/packages/console/src/pages/CustomizeJwtDetails/MainContent/SettingsSection/InstructionTab/index.tsx +++ b/packages/console/src/pages/CustomizeJwtDetails/MainContent/SettingsSection/InstructionTab/index.tsx @@ -5,7 +5,6 @@ import { useState } from 'react'; import { useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; -import { isDevFeaturesEnabled } from '@/consts/env'; import { type JwtCustomizerForm } from '@/pages/CustomizeJwtDetails/type'; import { environmentVariablesCodeExample, @@ -79,7 +78,7 @@ function InstructionTab({ isActive }: Props) { /> )} - {isDevFeaturesEnabled && tokenType === LogtoJwtTokenKeyType.AccessToken && ( + {tokenType === LogtoJwtTokenKeyType.AccessToken && ( ( subjectTokens: { insertSubjectToken }, } = queries; - if (!EnvSet.values.isDevFeaturesEnabled) { - return; - } - router.post( '/subject-tokens', koaQuotaGuard({ key: 'subjectTokenEnabled', quota }), diff --git a/packages/core/src/routes/swagger/index.ts b/packages/core/src/routes/swagger/index.ts index f79d26a02c7..b845ed0d72f 100644 --- a/packages/core/src/routes/swagger/index.ts +++ b/packages/core/src/routes/swagger/index.ts @@ -155,7 +155,6 @@ const identifiableEntityNames = Object.freeze([ const additionalTags = Object.freeze( condArray( 'Organization applications', - EnvSet.values.isDevFeaturesEnabled && 'Subject tokens', EnvSet.values.isDevFeaturesEnabled && 'Custom UI assets', 'Organization users' ) diff --git a/packages/integration-tests/src/tests/api/oidc/token-exchange.test.ts b/packages/integration-tests/src/tests/api/oidc/token-exchange.test.ts index a6ec845f421..930729f88a2 100644 --- a/packages/integration-tests/src/tests/api/oidc/token-exchange.test.ts +++ b/packages/integration-tests/src/tests/api/oidc/token-exchange.test.ts @@ -22,7 +22,6 @@ import { createUserByAdmin } from '#src/helpers/index.js'; import { OrganizationApiTest } from '#src/helpers/organization.js'; import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js'; import { - devFeatureTest, getAccessTokenPayload, randomString, generateName, @@ -30,8 +29,6 @@ import { generateUsername, } from '#src/utils.js'; -const { describe, it } = devFeatureTest; - describe('Token Exchange', () => { const username = generateUsername(); const password = generatePassword(); diff --git a/packages/integration-tests/src/tests/api/security.test.ts b/packages/integration-tests/src/tests/api/security.test.ts index bc906d85e14..c84b7e87d8f 100644 --- a/packages/integration-tests/src/tests/api/security.test.ts +++ b/packages/integration-tests/src/tests/api/security.test.ts @@ -1,8 +1,5 @@ import { createSubjectToken } from '#src/api/subject-token.js'; import { createUserByAdmin } from '#src/helpers/index.js'; -import { devFeatureTest } from '#src/utils.js'; - -const { describe, it } = devFeatureTest; describe('subject-tokens', () => { it('should create a subject token successfully', async () => {