mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
chore: remove feature guard (#6818)
This commit is contained in:
parent
9ca5ae8f30
commit
9a3f78d342
12 changed files with 5 additions and 43 deletions
|
@ -3,9 +3,6 @@
|
||||||
{
|
{
|
||||||
"name": "Account center",
|
"name": "Account center",
|
||||||
"description": "Customize your account API settings."
|
"description": "Customize your account API settings."
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Dev feature"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
{
|
{
|
||||||
"name": "Account",
|
"name": "Account",
|
||||||
"description": "Account routes provide functionality for managing user profile for the end user to interact directly with access tokens."
|
"description": "Account routes provide functionality for managing user profile for the end user to interact directly with access tokens."
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Dev feature"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { z } from 'zod';
|
||||||
|
|
||||||
import koaGuard from '#src/middleware/koa-guard.js';
|
import koaGuard from '#src/middleware/koa-guard.js';
|
||||||
|
|
||||||
import { EnvSet } from '../../env-set/index.js';
|
|
||||||
import RequestError from '../../errors/RequestError/index.js';
|
import RequestError from '../../errors/RequestError/index.js';
|
||||||
import { encryptUserPassword } from '../../libraries/user.utils.js';
|
import { encryptUserPassword } from '../../libraries/user.utils.js';
|
||||||
import assertThat from '../../utils/assert-that.js';
|
import assertThat from '../../utils/assert-that.js';
|
||||||
|
@ -35,10 +34,6 @@ export default function accountRoutes<T extends UserRouter>(...args: RouterInitA
|
||||||
|
|
||||||
router.use(koaAccountCenter(queries));
|
router.use(koaAccountCenter(queries));
|
||||||
|
|
||||||
if (!EnvSet.values.isDevFeaturesEnabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
router.get(
|
router.get(
|
||||||
`${accountApiPrefix}`,
|
`${accountApiPrefix}`,
|
||||||
koaGuard({
|
koaGuard({
|
||||||
|
|
|
@ -98,9 +98,7 @@ const createRouters = (tenant: TenantContext) => {
|
||||||
ssoConnectors(managementRouter, tenant);
|
ssoConnectors(managementRouter, tenant);
|
||||||
systemRoutes(managementRouter, tenant);
|
systemRoutes(managementRouter, tenant);
|
||||||
subjectTokenRoutes(managementRouter, tenant);
|
subjectTokenRoutes(managementRouter, tenant);
|
||||||
if (EnvSet.values.isDevFeaturesEnabled) {
|
accountCentersRoutes(managementRouter, tenant);
|
||||||
accountCentersRoutes(managementRouter, tenant);
|
|
||||||
}
|
|
||||||
|
|
||||||
const anonymousRouter: AnonymousRouter = new Router();
|
const anonymousRouter: AnonymousRouter = new Router();
|
||||||
|
|
||||||
|
|
|
@ -51,12 +51,7 @@ const managementApiIdentifiableEntityNames = Object.freeze([
|
||||||
|
|
||||||
/** Additional tags that cannot be inferred from the path. */
|
/** Additional tags that cannot be inferred from the path. */
|
||||||
const additionalTags = Object.freeze(
|
const additionalTags = Object.freeze(
|
||||||
condArray<string>(
|
condArray<string>('Organization applications', 'Custom UI assets', 'Organization users')
|
||||||
'Organization applications',
|
|
||||||
'Custom UI assets',
|
|
||||||
'Organization users',
|
|
||||||
EnvSet.values.isDevFeaturesEnabled && 'Account center'
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
export const buildManagementApiBaseDocument = (
|
export const buildManagementApiBaseDocument = (
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
{
|
{
|
||||||
"name": "Verifications",
|
"name": "Verifications",
|
||||||
"description": "Endpoints for creating and validating verification records, which can be used in Profile routes."
|
"description": "Endpoints for creating and validating verification records, which can be used in Profile routes."
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Dev feature"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { z } from 'zod';
|
||||||
|
|
||||||
import koaGuard from '#src/middleware/koa-guard.js';
|
import koaGuard from '#src/middleware/koa-guard.js';
|
||||||
|
|
||||||
import { EnvSet } from '../../env-set/index.js';
|
|
||||||
import {
|
import {
|
||||||
buildVerificationRecordByIdAndType,
|
buildVerificationRecordByIdAndType,
|
||||||
insertVerificationRecord,
|
insertVerificationRecord,
|
||||||
|
@ -31,10 +30,6 @@ export default function verificationRoutes<T extends UserRouter>(
|
||||||
) {
|
) {
|
||||||
const { queries, libraries, sentinel } = tenantContext;
|
const { queries, libraries, sentinel } = tenantContext;
|
||||||
|
|
||||||
if (!EnvSet.values.isDevFeaturesEnabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
`${verificationApiPrefix}/password`,
|
`${verificationApiPrefix}/password`,
|
||||||
koaGuard({
|
koaGuard({
|
||||||
|
|
|
@ -5,9 +5,6 @@ import {
|
||||||
getAccountCenter,
|
getAccountCenter,
|
||||||
updateAccountCenter,
|
updateAccountCenter,
|
||||||
} from '#src/api/account-center.js';
|
} from '#src/api/account-center.js';
|
||||||
import { devFeatureTest } from '#src/utils.js';
|
|
||||||
|
|
||||||
const { describe, it } = devFeatureTest;
|
|
||||||
|
|
||||||
describe('account center', () => {
|
describe('account center', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
|
|
@ -21,9 +21,7 @@ import {
|
||||||
signInAndGetUserApi,
|
signInAndGetUserApi,
|
||||||
} from '#src/helpers/profile.js';
|
} from '#src/helpers/profile.js';
|
||||||
import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js';
|
import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js';
|
||||||
import { devFeatureTest, generateEmail, generatePhone } from '#src/utils.js';
|
import { generateEmail, generatePhone } from '#src/utils.js';
|
||||||
|
|
||||||
const { describe, it } = devFeatureTest;
|
|
||||||
|
|
||||||
const expectedError = {
|
const expectedError = {
|
||||||
code: 'account_center.filed_not_editable',
|
code: 'account_center.filed_not_editable',
|
||||||
|
|
|
@ -23,9 +23,7 @@ import {
|
||||||
signInAndGetUserApi,
|
signInAndGetUserApi,
|
||||||
} from '#src/helpers/profile.js';
|
} from '#src/helpers/profile.js';
|
||||||
import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js';
|
import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js';
|
||||||
import { devFeatureTest, generateEmail, generatePhone } from '#src/utils.js';
|
import { generateEmail, generatePhone } from '#src/utils.js';
|
||||||
|
|
||||||
const { describe, it } = devFeatureTest;
|
|
||||||
|
|
||||||
describe('account (email and phone)', () => {
|
describe('account (email and phone)', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
|
|
@ -14,13 +14,11 @@ import {
|
||||||
signInAndGetUserApi,
|
signInAndGetUserApi,
|
||||||
} from '#src/helpers/profile.js';
|
} from '#src/helpers/profile.js';
|
||||||
import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js';
|
import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js';
|
||||||
import { devFeatureTest, generatePassword, generateUsername } from '#src/utils.js';
|
import { generatePassword, generateUsername } from '#src/utils.js';
|
||||||
|
|
||||||
import WebhookMockServer from '../hook/WebhookMockServer.js';
|
import WebhookMockServer from '../hook/WebhookMockServer.js';
|
||||||
import { assertHookLogResult } from '../hook/utils.js';
|
import { assertHookLogResult } from '../hook/utils.js';
|
||||||
|
|
||||||
const { describe, it } = devFeatureTest;
|
|
||||||
|
|
||||||
describe('account', () => {
|
describe('account', () => {
|
||||||
const webHookMockServer = new WebhookMockServer(9999);
|
const webHookMockServer = new WebhookMockServer(9999);
|
||||||
const webHookApi = new WebHookApiTest();
|
const webHookApi = new WebHookApiTest();
|
||||||
|
|
|
@ -25,9 +25,6 @@ import {
|
||||||
signInAndGetUserApi,
|
signInAndGetUserApi,
|
||||||
} from '#src/helpers/profile.js';
|
} from '#src/helpers/profile.js';
|
||||||
import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js';
|
import { enableAllPasswordSignInMethods } from '#src/helpers/sign-in-experience.js';
|
||||||
import { devFeatureTest } from '#src/utils.js';
|
|
||||||
|
|
||||||
const { describe, it } = devFeatureTest;
|
|
||||||
|
|
||||||
describe('account (social)', () => {
|
describe('account (social)', () => {
|
||||||
const state = 'fake_state';
|
const state = 'fake_state';
|
||||||
|
|
Loading…
Add table
Reference in a new issue