Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove feature guard for token exchange #6246

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -79,7 +78,7 @@ function InstructionTab({ isActive }: Props) {
/>
</GuideCard>
)}
{isDevFeaturesEnabled && tokenType === LogtoJwtTokenKeyType.AccessToken && (
{tokenType === LogtoJwtTokenKeyType.AccessToken && (
<GuideCard
name={CardType.GrantData}
isExpanded={expendCard === CardType.GrantData}
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/routes/subject-token.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
5 changes: 0 additions & 5 deletions packages/core/src/routes/subject-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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 }),
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/routes/swagger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ 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,
generatePassword,
generateUsername,
} from '#src/utils.js';

const { describe, it } = devFeatureTest;

describe('Token Exchange', () => {
const username = generateUsername();
const password = generatePassword();
Expand Down
3 changes: 0 additions & 3 deletions packages/integration-tests/src/tests/api/security.test.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down
Loading