0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -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 { 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) {
/>
</GuideCard>
)}
{isDevFeaturesEnabled && tokenType === LogtoJwtTokenKeyType.AccessToken && (
{tokenType === LogtoJwtTokenKeyType.AccessToken && (
<GuideCard
name={CardType.GrantData}
isExpanded={expendCard === CardType.GrantData}

View file

@ -3,8 +3,7 @@
{
"name": "Subject tokens",
"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": {
"/api/subject-tokens": {

View file

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

View file

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

View file

@ -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();

View file

@ -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 () => {