Skip to content
Open
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
64 changes: 64 additions & 0 deletions ufc/flags-v1-obfuscated.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
64 changes: 64 additions & 0 deletions ufc/flags-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reminds me, if we are not already, we should have these tests check to make sure ONE_OF and NOT_ONE_OF work as expected with empty string values.

]
}
]
}
],
"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,
Expand Down
109 changes: 109 additions & 0 deletions ufc/tests/test-case-empty-string-subject-key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"flag": "empty-string-subject-key-flag",
"variationType": "BOOLEAN",
"defaultValue": true,
"subjects": [
{
"subjectKey": "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

"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": []
}
}
]
}
Loading