diff --git a/ufc/flags-v1-obfuscated.json b/ufc/flags-v1-obfuscated.json index 2d2f119..193722e 100644 --- a/ufc/flags-v1-obfuscated.json +++ b/ufc/flags-v1-obfuscated.json @@ -608,6 +608,70 @@ } ] }, + "aca57f6611d05b7ac7fe76a60220101d": { + "key": "aca57f6611d05b7ac7fe76a60220101d", + "enabled": true, + "variationType": "BOOLEAN", + "totalShards": 10000, + "variations": { + "ZGlzYWJsZWQ=": { + "key": "ZGlzYWJsZWQ=", + "value": "ZmFsc2U=" + }, + "ZW5hYmxlZA==": { + "key": "ZW5hYmxlZA==", + "value": "dHJ1ZQ==" + } + }, + "allocations": [ + { + "key": "ZGlzYWJsZS1mb3ItYW5vbnltb3Vz", + "doLog": true, + "rules": [ + { + "conditions": [ + { + "operator": "27457ce369f2a74203396a35ef537c0b", + "attribute": "d7b5164029f944313b08c6b778b7b178", + "value": [ + "294de3557d9d00b3d2d8a1e6aab028cf" + ] + } + ] + } + ], + "splits": [ + { + "variationKey": "ZGlzYWJsZWQ=", + "shards": [] + } + ] + }, + { + "key": "ZW5hYmxlLWZvci11c2Vycw==", + "doLog": true, + "rules": [ + { + "conditions": [ + { + "operator": "27457ce369f2a74203396a35ef537c0b", + "attribute": "d7b5164029f944313b08c6b778b7b178", + "value": [ + "a2b8ed9c305b8ea86116b603cca78a97" + ] + } + ] + } + ], + "splits": [ + { + "variationKey": "ZW5hYmxlZA==", + "shards": [] + } + ] + } + ] + }, "ea55330f6cbbaf8f57556df645c037e2": { "key": "ea55330f6cbbaf8f57556df645c037e2", "enabled": true, diff --git a/ufc/flags-v1.json b/ufc/flags-v1.json index b882934..1419869 100644 --- a/ufc/flags-v1.json +++ b/ufc/flags-v1.json @@ -609,6 +609,70 @@ ], "totalShards": 10000 }, + "empty-string-subject-key-flag": { + "key": "empty-string-subject-key-flag", + "enabled": true, + "variationType": "BOOLEAN", + "variations": { + "disabled": { + "key": "disabled", + "value": false + }, + "enabled": { + "key": "enabled", + "value": true + } + }, + "allocations": [ + { + "key": "disable-for-anonymous", + "rules": [ + { + "conditions": [ + { + "attribute": "user_type", + "operator": "ONE_OF", + "value": [ + "anonymous" + ] + } + ] + } + ], + "splits": [ + { + "variationKey": "disabled", + "shards": [] + } + ], + "doLog": true + }, + { + "key": "enable-for-users", + "rules": [ + { + "conditions": [ + { + "attribute": "user_type", + "operator": "ONE_OF", + "value": [ + "registered" + ] + } + ] + } + ], + "splits": [ + { + "variationKey": "enabled", + "shards": [] + } + ], + "doLog": true + } + ], + "totalShards": 10000 + }, "kill-switch": { "key": "kill-switch", "enabled": true, diff --git a/ufc/tests/test-case-empty-string-subject-key.json b/ufc/tests/test-case-empty-string-subject-key.json new file mode 100644 index 0000000..7c77834 --- /dev/null +++ b/ufc/tests/test-case-empty-string-subject-key.json @@ -0,0 +1,109 @@ +{ + "flag": "empty-string-subject-key-flag", + "variationType": "BOOLEAN", + "defaultValue": true, + "subjects": [ + { + "subjectKey": "", + "subjectAttributes": { + "user_type": "anonymous" + }, + "assignment": true, + "evaluationDetails": { + "environmentName": "Test", + "flagEvaluationCode": "DEFAULT_ALLOCATION_NULL", + "flagEvaluationDescription": "Empty subject key provided. Falling back to \"Default Allocation\", serving NULL", + "banditKey": null, + "banditAction": null, + "variationKey": null, + "variationValue": null, + "matchedRule": null, + "matchedAllocation": null, + "unmatchedAllocations": [ + { + "key": "disable-for-anonymous", + "allocationEvaluationCode": "UNEVALUATED", + "orderPosition": 1 + }, + { + "key": "enable-for-users", + "allocationEvaluationCode": "UNEVALUATED", + "orderPosition": 2 + } + ], + "unevaluatedAllocations": [] + } + }, + { + "subjectKey": "user123", + "subjectAttributes": { + "user_type": "registered" + }, + "assignment": true, + "evaluationDetails": { + "environmentName": "Test", + "flagEvaluationCode": "MATCH", + "flagEvaluationDescription": "Supplied attributes match rules defined in allocation \"enable-for-users\".", + "banditKey": null, + "banditAction": null, + "variationKey": "enabled", + "variationValue": true, + "matchedRule": { + "conditions": [ + { + "attribute": "user_type", + "operator": "ONE_OF", + "value": [ + "registered" + ] + } + ] + }, + "matchedAllocation": { + "key": "enable-for-users", + "allocationEvaluationCode": "MATCH", + "orderPosition": 2 + }, + "unmatchedAllocations": [ + { + "key": "disable-for-anonymous", + "allocationEvaluationCode": "FAILING_RULE", + "orderPosition": 1 + } + ], + "unevaluatedAllocations": [] + } + }, + { + "subjectKey": "guest_user", + "subjectAttributes": { + "user_type": "unknown" + }, + "assignment": true, + "evaluationDetails": { + "environmentName": "Test", + "flagEvaluationCode": "DEFAULT_ALLOCATION_NULL", + "flagEvaluationDescription": "No allocations matched. Falling back to \"Default Allocation\", serving NULL", + "banditKey": null, + "banditAction": null, + "variationKey": null, + "variationValue": null, + "matchedRule": null, + "matchedAllocation": null, + "unmatchedAllocations": [ + { + "key": "disable-for-anonymous", + "allocationEvaluationCode": "FAILING_RULE", + "orderPosition": 1 + }, + { + "key": "enable-for-users", + "allocationEvaluationCode": "FAILING_RULE", + "orderPosition": 2 + } + ], + "unevaluatedAllocations": [] + } + } + ] +} \ No newline at end of file