-
Notifications
You must be signed in to change notification settings - Fork 17
Feature Toggle Settings Scenarios
Pratik Bhattacharya edited this page Dec 15, 2021
·
13 revisions
In this section we will discuss the various scenarios that you may encounter while creating/evaluating a feature toggle, and how the feature flag will be configured in those scenarios.
Scenario 1 - Setting up a feature flag with condition that user's email must belong to a list of emails
Feature Flag
{
"name": "Scenario-1",
"description": "Mail must belong to any of the configured value",
"enabled": true,
"environment": "dev",
"conditions": {
"client_filters": [
{
"name": "UserMail",
"parameters": {
"operator": "In",
"value": "tonystark@gmail.com,jarvis@gmail.com,peter.parker@outlook.com",
"isActive": "true",
"stageId": "0",
"stageName": "Ring 1",
"flightContextKey": "UserMail"
}
}
]
}
}
X-FlightContext Samples
| Value | Result | Comments |
|---|---|---|
{ "UserMail": "jarvis@gmail.com" } |
true | Email part of the list |
{ "UserMail": "bruce.wayne@gmail.com" } |
false | Email not part of the list |
Scenario 2 - Setting up a feature flag with condition that user's email must belong to a list of emails or the user must be from USA
Feature Flag
{
"name": "Scenario-1",
"description": "Mail must belong to any of the configured value",
"enabled": true,
"environment": "dev",
"conditions": {
"client_filters": [
{
"name": "UserMail",
"parameters": {
"operator": "In",
"value": "tonystark@gmail.com,jarvis@gmail.com,peter.parker@outlook.com",
"isActive": "true",
"stageId": "0",
"stageName": "Ring 1",
"flightContextKey": "UserMail"
}
},
{
"name": "Country",
"parameters": {
"operator": "Equals",
"value": "USA",
"isActive": "true",
"stageId": "0",
"stageName": "Ring 1",
"flightContextKey": "Country"
}
}
]
}
}
X-FlightContext Samples
| Value | Result | Comments |
|---|---|---|
{ "UserMail": "jarvis@gmail.com", "Country": "USA" } |
true | Both email and country matches |
{ "UserMail": "bruce.wayne@gmail.com", "Country": "USA" } |
true | Email not part of the list but country passes |
{ "UserMail": "bruce.wayne@gmail.com", "Country": "UK" } |
false | Not email nor country passes |