1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

feat: clean api behind a flag (#3288)

This commit is contained in:
Mateusz Kwasniewski 2023-03-09 16:20:12 +01:00 committed by GitHub
parent 785d056a40
commit 898d4f0b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 27 deletions

View File

@ -71,6 +71,7 @@ exports[`should create default config 1`] = `
"anonymiseEventLog": false, "anonymiseEventLog": false,
"bulkOperations": false, "bulkOperations": false,
"caseInsensitiveInOperators": false, "caseInsensitiveInOperators": false,
"cleanClientApi": false,
"crOnVariants": false, "crOnVariants": false,
"embedProxy": true, "embedProxy": true,
"embedProxyFrontend": true, "embedProxyFrontend": true,
@ -95,6 +96,7 @@ exports[`should create default config 1`] = `
"anonymiseEventLog": false, "anonymiseEventLog": false,
"bulkOperations": false, "bulkOperations": false,
"caseInsensitiveInOperators": false, "caseInsensitiveInOperators": false,
"cleanClientApi": false,
"crOnVariants": false, "crOnVariants": false,
"embedProxy": true, "embedProxy": true,
"embedProxyFrontend": true, "embedProxyFrontend": true,

View File

@ -692,33 +692,37 @@ class FeatureToggleService {
query, query,
includeIds, includeIds,
); );
return result.map( if (this.flagResolver.isEnabled('cleanClientApi')) {
({ return result.map(
name, ({
type, name,
enabled, type,
project, enabled,
stale, project,
strategies, stale,
variants, strategies,
description, variants,
createdAt, description,
lastSeenAt, createdAt,
impressionData, lastSeenAt,
}) => ({ impressionData,
name, }) => ({
type, name,
enabled, type,
project, enabled,
stale, project,
strategies, stale,
variants, strategies,
description, variants,
createdAt, description,
lastSeenAt, createdAt,
impressionData, lastSeenAt,
}), impressionData,
); }),
);
} else {
return result;
}
} }
/** /**

View File

@ -72,6 +72,7 @@ const flags = {
process.env.PROJECT_SCOPED_SEGMENTS, process.env.PROJECT_SCOPED_SEGMENTS,
false, false,
), ),
cleanClientApi: parseEnvVarBoolean(process.env.CLEAN_CLIENT_API, false),
}; };
export const defaultExperimentalOptions: IExperimentalOptions = { export const defaultExperimentalOptions: IExperimentalOptions = {