@@ -49,14 +49,14 @@ Imagine to have a feature flag configuration file called `features.json`:
49
49
{
50
50
" stages" : {
51
51
" test" : [
52
- {" whitelist " : [" test.*" , " dev.*" ]}
52
+ {" allowlist " : [" test.*" , " dev.*" ]}
53
53
],
54
54
" canary" : [
55
- {" whitelist " : [" prod-canary" ]}
55
+ {" allowlist " : [" prod-canary" ]}
56
56
],
57
57
" prod" : [
58
- {" whitelist " : [" prod.*" ]},
59
- {" blacklist " : [" prod-canary" ]}
58
+ {" allowlist " : [" prod.*" ]},
59
+ {" denylist " : [" prod-canary" ]}
60
60
]
61
61
},
62
62
" features" : {
@@ -122,13 +122,13 @@ An example lifecycle of a feature flag might be the following:
122
122
123
123
Here is how these example stages could be implemented:
124
124
125
- * Stage 1 can be implemented with a ` blacklist ` condition with value ` .* ` .
126
- * Stages 2 and 3 can be implemented with ` whitelist ` conditions.
125
+ * Stage 1 can be implemented with a ` denylist ` condition with value ` .* ` .
126
+ * Stages 2 and 3 can be implemented with ` allowlist ` conditions.
127
127
* Stages 4 and 5 can be implemented with ` probability ` conditions.
128
128
129
129
## Conditions
130
130
131
- There are two types of conditions: * deterministic* (whitelist and blacklist ,
131
+ There are two types of conditions: * deterministic* (allowlist and denylist ,
132
132
regex-based) and * probabilistic* (probability, expressed as a number between
133
133
0 and 1). Conditions can be repeated if multiple instances are required.
134
134
@@ -138,9 +138,9 @@ in the configuration file, for the feature to be considered enabled.
138
138
If any condition is not met, evaluation of conditions stops and the feature
139
139
is considered disabled.
140
140
141
- ### Whitelist
141
+ ### Allow list
142
142
143
- The ` whitelist ` condition allows to specify a list of regular expressions; if the
143
+ The ` allowlist ` condition allows to specify a list of regular expressions; if the
144
144
predicate matches any of the expressions, then the condition is met and the evaluation
145
145
moves to the next condition, if there is any.
146
146
@@ -150,9 +150,9 @@ unintended matches, it's recommended to always anchor the regex.
150
150
151
151
So, for example, ` "^storage$" ` will only match ` "storage" ` and not ` "storage1" ` .
152
152
153
- ### Blacklist
153
+ ### Deny list
154
154
155
- The ` blacklist ` condition is analogous to the whitelist condition, except that if
155
+ The ` denylist ` condition is analogous to the allowlist condition, except that if
156
156
the predicate matches any of the expressions the condition is considered not met
157
157
and the evaluation stops.
158
158
@@ -172,25 +172,25 @@ the following example:
172
172
``` json
173
173
{
174
174
"stages" : {
175
- "whitelist -first" : [
176
- {"whitelist " : [" storage.*" ]},
175
+ "allowlist -first" : [
176
+ {"allowlist " : [" storage.*" ]},
177
177
{"probability" : 0.1 }
178
178
],
179
179
"probability-first" : [
180
180
{"probability" : 0.1 }
181
- {"whitelist " : [" storage.*" ]},
181
+ {"allowlist " : [" storage.*" ]},
182
182
]
183
183
}
184
184
}
185
185
```
186
186
187
- The first stage definition, ` whitelist -first` , will evaluate the ` probability ` condition
188
- only if the predicate first passes the whitelist .
187
+ The first stage definition, ` allowlist -first` , will evaluate the ` probability ` condition
188
+ only if the predicate first passes the allowlist .
189
189
190
190
The second stage definition, ` probability-first ` , will instead first evaluate
191
- the ` probability ` condition, and then apply the whitelist .
191
+ the ` probability ` condition, and then apply the allowlist .
192
192
193
- Assuming there are predicates that do not match the whitelist , the second stage definition
193
+ Assuming there are predicates that do not match the allowlist , the second stage definition
194
194
is more restrictive than the first one, leading to fewer positive evaluations of the
195
195
feature flag.
196
196
@@ -231,19 +231,19 @@ for comments. Don't add comments to your feature flag configuration file.
231
231
],
232
232
// Examples of deterministic stages.
233
233
" all-storage" : [
234
- {" whitelist " : [" .*Storage.*" ]},
234
+ {" allowlist " : [" .*Storage.*" ]},
235
235
],
236
236
" storage-except-important" : [
237
- {" whitelist " : [" .*Storage.*" ]},
238
- {" blacklist " : [" .*StorageImportant.*" ]},
237
+ {" allowlist " : [" .*Storage.*" ]},
238
+ {" denylist " : [" .*StorageImportant.*" ]},
239
239
],
240
240
// Example of mixed roll-out stage.
241
241
// This stage will match on predicates containing the word "Storage"
242
242
// but not the word "StorageImportant", and then will consider the feature
243
243
// enabled in 50% of the cases.
244
244
" 50-percent-storage-except-StorageImportant" : [
245
- {" whitelist " : [" .*Storage.*" ]},
246
- {" blacklist " : [" StorageImportant" ]},
245
+ {" allowlist " : [" .*Storage.*" ]},
246
+ {" denylist " : [" StorageImportant" ]},
247
247
{" probability" : 0.5 },
248
248
],
249
249
},
0 commit comments