From dd651588b90bd848332adc7bef11926ed17547f5 Mon Sep 17 00:00:00 2001 From: Eric Petzel Date: Fri, 7 Mar 2025 14:53:33 +0800 Subject: [PATCH] add entity_id to flags in UFC --- obfuscation/obfuscation.helper.ts | 1 + obfuscation/ufc.dto.ts | 1 + ufc/flags-v1-obfuscated.json | 19 +++++++++++++++++++ ufc/flags-v1.json | 19 +++++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/obfuscation/obfuscation.helper.ts b/obfuscation/obfuscation.helper.ts index 24b3dd9..19d7602 100644 --- a/obfuscation/obfuscation.helper.ts +++ b/obfuscation/obfuscation.helper.ts @@ -75,6 +75,7 @@ function obfuscateFlag(flagDto: FlagDto): FlagDto { obfuscatedFlagDto.enabled = flagDto.enabled; obfuscatedFlagDto.variationType = flagDto.variationType; obfuscatedFlagDto.totalShards = flagDto.totalShards; + obfuscatedFlagDto.entityId = flagDto.entityId; // Obfuscate variations obfuscatedFlagDto.variations = {}; diff --git a/obfuscation/ufc.dto.ts b/obfuscation/ufc.dto.ts index eb5ab74..ce8d0e0 100644 --- a/obfuscation/ufc.dto.ts +++ b/obfuscation/ufc.dto.ts @@ -47,6 +47,7 @@ export class FlagDto { variations!: Record; allocations!: AllocationDto[]; totalShards!: number; + entityId!: number | null; } export class VariationDto { diff --git a/ufc/flags-v1-obfuscated.json b/ufc/flags-v1-obfuscated.json index f17cfdd..55d7a5f 100644 --- a/ufc/flags-v1-obfuscated.json +++ b/ufc/flags-v1-obfuscated.json @@ -10,6 +10,7 @@ "enabled": true, "variationType": "STRING", "totalShards": 10000, + "entityId": null, "variations": {}, "allocations": [] }, @@ -18,6 +19,7 @@ "enabled": false, "variationType": "INTEGER", "totalShards": 10000, + "entityId": null, "variations": {}, "allocations": [] }, @@ -26,6 +28,7 @@ "enabled": true, "variationType": "JSON", "totalShards": 10000, + "entityId": null, "variations": { "Y29udHJvbA==": { "key": "Y29udHJvbA==", @@ -43,6 +46,7 @@ "enabled": true, "variationType": "NUMERIC", "totalShards": 10000, + "entityId": null, "variations": { "ZQ==": { "key": "ZQ==", @@ -71,6 +75,7 @@ "enabled": true, "variationType": "INTEGER", "totalShards": 10000, + "entityId": null, "variations": { "b25l": { "key": "b25l", @@ -123,6 +128,7 @@ "enabled": true, "variationType": "STRING", "totalShards": 10000, + "entityId": null, "variations": { "cGFydGlhbC1leGFtcGxl": { "key": "cGFydGlhbC1leGFtcGxl", @@ -183,6 +189,7 @@ "enabled": true, "variationType": "INTEGER", "totalShards": 10000, + "entityId": null, "variations": { "MQ==": { "key": "MQ==", @@ -274,6 +281,7 @@ "enabled": true, "variationType": "INTEGER", "totalShards": 10000, + "entityId": null, "variations": { "MQ==": { "key": "MQ==", @@ -415,6 +423,7 @@ "enabled": true, "variationType": "STRING", "totalShards": 10000, + "entityId": null, "variations": { "ZW1wdHlfc3RyaW5n": { "key": "ZW1wdHlfc3RyaW5n", @@ -485,6 +494,7 @@ "enabled": true, "variationType": "BOOLEAN", "totalShards": 10000, + "entityId": null, "variations": { "b24=": { "key": "b24=", @@ -580,6 +590,7 @@ "enabled": true, "variationType": "STRING", "totalShards": 10000, + "entityId": null, "variations": { "b2xk": { "key": "b2xk", @@ -670,6 +681,7 @@ "enabled": true, "variationType": "STRING", "totalShards": 10000, + "entityId": null, "variations": { "c21hbGw=": { "key": "c21hbGw=", @@ -760,6 +772,7 @@ "enabled": true, "variationType": "STRING", "totalShards": 10000, + "entityId": null, "variations": { "b2xk": { "key": "b2xk", @@ -816,6 +829,7 @@ "enabled": true, "variationType": "STRING", "totalShards": 10000, + "entityId": null, "variations": { "b2xk": { "key": "b2xk", @@ -885,6 +899,7 @@ "enabled": true, "variationType": "STRING", "totalShards": 10000, + "entityId": null, "variations": { "Y29udHJvbA==": { "key": "Y29udHJvbA==", @@ -1090,6 +1105,7 @@ "enabled": true, "variationType": "INTEGER", "totalShards": 10000, + "entityId": null, "variations": { "b25l": { "key": "b25l", @@ -1191,6 +1207,7 @@ "enabled": true, "variationType": "JSON", "totalShards": 10000, + "entityId": 1111, "variations": { "b25l": { "key": "b25l", @@ -1262,6 +1279,7 @@ "enabled": true, "variationType": "JSON", "totalShards": 10000, + "entityId": 2222, "variations": { "ZGU=": { "key": "ZGU=", @@ -1360,6 +1378,7 @@ "enabled": true, "variationType": "STRING", "totalShards": 10000, + "entityId": 3333, "variations": { "c3RyaW5nX3dpdGhfc3BhY2Vz": { "key": "c3RyaW5nX3dpdGhfc3BhY2Vz", diff --git a/ufc/flags-v1.json b/ufc/flags-v1.json index 130527b..9ca8036 100644 --- a/ufc/flags-v1.json +++ b/ufc/flags-v1.json @@ -8,6 +8,7 @@ "empty_flag": { "key": "empty_flag", "enabled": true, + "entityId": null, "variationType": "STRING", "variations": {}, "allocations": [], @@ -16,6 +17,7 @@ "disabled_flag": { "key": "disabled_flag", "enabled": false, + "entityId": null, "variationType": "INTEGER", "variations": {}, "allocations": [], @@ -24,6 +26,7 @@ "no_allocations_flag": { "key": "no_allocations_flag", "enabled": true, + "entityId": null, "variationType": "JSON", "variations": { "control": { @@ -41,6 +44,7 @@ "numeric_flag": { "key": "numeric_flag", "enabled": true, + "entityId": null, "variationType": "NUMERIC", "variations": { "e": { @@ -69,6 +73,7 @@ "invalid-value-flag": { "key": "invalid-value-flag", "enabled": true, + "entityId": null, "variationType": "INTEGER", "variations": { "one": { @@ -121,6 +126,7 @@ "regex-flag": { "key": "regex-flag", "enabled": true, + "entityId": null, "variationType": "STRING", "variations": { "partial-example": { @@ -181,6 +187,7 @@ "numeric-one-of": { "key": "numeric-one-of", "enabled": true, + "entityId": null, "variationType": "INTEGER", "variations": { "1": { @@ -272,6 +279,7 @@ "boolean-one-of-matches": { "key": "boolean-one-of-matches", "enabled": true, + "entityId": null, "variationType": "INTEGER", "variations": { "1": { @@ -413,6 +421,7 @@ "empty_string_flag": { "key": "empty_string_flag", "enabled": true, + "entityId": null, "comment": "Testing the empty string as a variation value", "variationType": "STRING", "variations": { @@ -484,6 +493,7 @@ "kill-switch": { "key": "kill-switch", "enabled": true, + "entityId": null, "variationType": "BOOLEAN", "variations": { "on": { @@ -579,6 +589,7 @@ "semver-test": { "key": "semver-test", "enabled": true, + "entityId": null, "variationType": "STRING", "variations": { "old": { @@ -669,6 +680,7 @@ "comparator-operator-test": { "key": "comparator-operator-test", "enabled": true, + "entityId": null, "variationType": "STRING", "variations": { "small": { @@ -759,6 +771,7 @@ "start-and-end-date-test": { "key": "start-and-end-date-test", "enabled": true, + "entityId": null, "variationType": "STRING", "variations": { "old": { @@ -815,6 +828,7 @@ "null-operator-test": { "key": "null-operator-test", "enabled": true, + "entityId": null, "variationType": "STRING", "variations": { "old": { @@ -884,6 +898,7 @@ "new-user-onboarding": { "key": "new-user-onboarding", "enabled": true, + "entityId": null, "variationType": "STRING", "variations": { "control": { @@ -1089,6 +1104,7 @@ "integer-flag": { "key": "integer-flag", "enabled": true, + "entityId": null, "variationType": "INTEGER", "variations": { "one": { @@ -1190,6 +1206,7 @@ "json-config-flag": { "key": "json-config-flag", "enabled": true, + "entityId": 1111, "variationType": "JSON", "variations": { "one": { @@ -1261,6 +1278,7 @@ "special-characters": { "key": "special-characters", "enabled": true, + "entityId": 2222, "variationType": "JSON", "variations": { "de": { @@ -1359,6 +1377,7 @@ "string_flag_with_special_characters": { "key": "string_flag_with_special_characters", "enabled": true, + "entityId": 3333, "comment": "Testing the string with special characters and spaces", "variationType": "STRING", "variations": {