From 3205e36e32cb362904d5e2544ef953cec377d389 Mon Sep 17 00:00:00 2001 From: wangsijie Date: Fri, 19 Jul 2024 18:23:09 +0800 Subject: [PATCH] chore: remove feature guard for token exchange (#6246) --- .../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 7fc7bedfe..76003b617 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 f79d26a02..b845ed0d7 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 a6ec845f4..930729f88 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 bc906d85e..c84b7e87d 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 () => {