0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-13 21:30:30 -05:00

chore: remove feature guard for token exchange (#6246)

This commit is contained in:
wangsijie 2024-07-19 18:23:09 +08:00 committed by GitHub
parent 7537c510f7
commit 3205e36e32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 2 additions and 16 deletions

View file

@ -5,7 +5,6 @@ import { useState } from 'react';
import { useFormContext } from 'react-hook-form'; import { useFormContext } from 'react-hook-form';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { isDevFeaturesEnabled } from '@/consts/env';
import { type JwtCustomizerForm } from '@/pages/CustomizeJwtDetails/type'; import { type JwtCustomizerForm } from '@/pages/CustomizeJwtDetails/type';
import { import {
environmentVariablesCodeExample, environmentVariablesCodeExample,
@ -79,7 +78,7 @@ function InstructionTab({ isActive }: Props) {
/> />
</GuideCard> </GuideCard>
)} )}
{isDevFeaturesEnabled && tokenType === LogtoJwtTokenKeyType.AccessToken && ( {tokenType === LogtoJwtTokenKeyType.AccessToken && (
<GuideCard <GuideCard
name={CardType.GrantData} name={CardType.GrantData}
isExpanded={expendCard === CardType.GrantData} isExpanded={expendCard === CardType.GrantData}

View file

@ -3,8 +3,7 @@
{ {
"name": "Subject tokens", "name": "Subject tokens",
"description": "The subject token API provides the ability to create a new subject token for the use of impersonating the user." "description": "The subject token API provides the ability to create a new subject token for the use of impersonating the user."
}, }
{ "name": "Dev feature" }
], ],
"paths": { "paths": {
"/api/subject-tokens": { "/api/subject-tokens": {

View file

@ -4,7 +4,6 @@ import { addSeconds } from 'date-fns';
import { object, string } from 'zod'; import { object, string } from 'zod';
import { subjectTokenExpiresIn, subjectTokenPrefix } from '#src/constants/index.js'; import { subjectTokenExpiresIn, subjectTokenPrefix } from '#src/constants/index.js';
import { EnvSet } from '#src/env-set/index.js';
import koaGuard from '#src/middleware/koa-guard.js'; import koaGuard from '#src/middleware/koa-guard.js';
import koaQuotaGuard from '#src/middleware/koa-quota-guard.js'; import koaQuotaGuard from '#src/middleware/koa-quota-guard.js';
@ -24,10 +23,6 @@ export default function subjectTokenRoutes<T extends ManagementApiRouter>(
subjectTokens: { insertSubjectToken }, subjectTokens: { insertSubjectToken },
} = queries; } = queries;
if (!EnvSet.values.isDevFeaturesEnabled) {
return;
}
router.post( router.post(
'/subject-tokens', '/subject-tokens',
koaQuotaGuard({ key: 'subjectTokenEnabled', quota }), koaQuotaGuard({ key: 'subjectTokenEnabled', quota }),

View file

@ -155,7 +155,6 @@ const identifiableEntityNames = Object.freeze([
const additionalTags = Object.freeze( const additionalTags = Object.freeze(
condArray<string>( condArray<string>(
'Organization applications', 'Organization applications',
EnvSet.values.isDevFeaturesEnabled && 'Subject tokens',
EnvSet.values.isDevFeaturesEnabled && 'Custom UI assets', EnvSet.values.isDevFeaturesEnabled && 'Custom UI assets',
'Organization users' 'Organization users'
) )

View file

@ -22,7 +22,6 @@ import { createUserByAdmin } from '#src/helpers/index.js';
import { OrganizationApiTest } from '#src/helpers/organization.js'; import { OrganizationApiTest } from '#src/helpers/organization.js';
import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js'; import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js';
import { import {
devFeatureTest,
getAccessTokenPayload, getAccessTokenPayload,
randomString, randomString,
generateName, generateName,
@ -30,8 +29,6 @@ import {
generateUsername, generateUsername,
} from '#src/utils.js'; } from '#src/utils.js';
const { describe, it } = devFeatureTest;
describe('Token Exchange', () => { describe('Token Exchange', () => {
const username = generateUsername(); const username = generateUsername();
const password = generatePassword(); const password = generatePassword();

View file

@ -1,8 +1,5 @@
import { createSubjectToken } from '#src/api/subject-token.js'; import { createSubjectToken } from '#src/api/subject-token.js';
import { createUserByAdmin } from '#src/helpers/index.js'; import { createUserByAdmin } from '#src/helpers/index.js';
import { devFeatureTest } from '#src/utils.js';
const { describe, it } = devFeatureTest;
describe('subject-tokens', () => { describe('subject-tokens', () => {
it('should create a subject token successfully', async () => { it('should create a subject token successfully', async () => {