Skip to content

Commit 5d0f121

Browse files
Abhi591rohitesh-wingify
authored andcommitted
feat: support for salting
1 parent 304b839 commit 5d0f121

File tree

12 files changed

+1068
-174
lines changed

12 files changed

+1068
-174
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.4.0] - 2024-11-22
8+
9+
### Added
10+
11+
- added support to use salt for bucketing if provided in the rule.
12+
713
## [1.3.0] - 2024-11-22
814

915
### Added
Lines changed: 327 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,327 @@
1+
{
2+
"features": [{
3+
"key": "feature1",
4+
"name": "Feature1",
5+
"metrics": [{
6+
"id": 1,
7+
"type": "REVENUE_TRACKING",
8+
"identifier": "custom1",
9+
"mca": -1
10+
}],
11+
"rules": [{
12+
"variationId": 1,
13+
"type": "FLAG_ROLLOUT",
14+
"campaignId": 1,
15+
"ruleKey": "rolloutRule1"
16+
},
17+
{
18+
"campaignId": 2,
19+
"type": "FLAG_TESTING",
20+
"ruleKey": "testingRule1"
21+
}
22+
],
23+
"type": "FEATURE_FLAG",
24+
"impactCampaign": {},
25+
"id": 1,
26+
"status": "ON"
27+
},
28+
{
29+
"key": "feature2",
30+
"name": "Feature2",
31+
"metrics": [{
32+
"id": 1,
33+
"type": "REVENUE_TRACKING",
34+
"identifier": "custom1",
35+
"mca": -1
36+
}],
37+
"rules": [{
38+
"variationId": 1,
39+
"type": "FLAG_ROLLOUT",
40+
"campaignId": 3,
41+
"ruleKey": "rolloutRule1"
42+
},
43+
{
44+
"campaignId": 4,
45+
"type": "FLAG_TESTING",
46+
"ruleKey": "testingRule1"
47+
}
48+
],
49+
"type": "FEATURE_FLAG",
50+
"impactCampaign": {},
51+
"id": 2,
52+
"status": "ON"
53+
}
54+
],
55+
"version": 1,
56+
"accountId": 12345,
57+
"sdkKey": "000000000000_MASKED_000000000000",
58+
"campaigns": [{
59+
"key": "feature1_rolloutRule1",
60+
"name": "feature1_rolloutRule1",
61+
"id": 1,
62+
"segments": {},
63+
"isForcedVariationEnabled": false,
64+
"variations": [{
65+
"variables": [{
66+
"key": "int",
67+
"id": 1,
68+
"value": 10,
69+
"type": "integer"
70+
},
71+
{
72+
"key": "float",
73+
"id": 2,
74+
"value": 20.01,
75+
"type": "double"
76+
},
77+
{
78+
"key": "string",
79+
"id": 3,
80+
"value": "test",
81+
"type": "string"
82+
},
83+
{
84+
"key": "boolean",
85+
"id": 4,
86+
"value": false,
87+
"type": "boolean"
88+
},
89+
{
90+
"key": "json",
91+
"id": 5,
92+
"value": "{\"name\": \"varun\"}",
93+
"type": "json"
94+
}
95+
],
96+
"id": 1,
97+
"salt": "rolloutSalt",
98+
"segments": {},
99+
"weight": 100,
100+
"name": "Rollout-rule-1"
101+
}],
102+
"type": "FLAG_ROLLOUT",
103+
"status": "RUNNING"
104+
},
105+
{
106+
"key": "feature1_testingRule1",
107+
"name": "feature1_testingRule1",
108+
"id": 2,
109+
"segments": {},
110+
"salt": "testingSalt1223",
111+
"isForcedVariationEnabled": false,
112+
"variations": [{
113+
"weight": 50,
114+
"id": 1,
115+
"variables": [{
116+
"key": "int",
117+
"id": 1,
118+
"value": 10,
119+
"type": "integer"
120+
},
121+
{
122+
"key": "float",
123+
"id": 2,
124+
"value": 20.01,
125+
"type": "double"
126+
},
127+
{
128+
"key": "string",
129+
"id": 3,
130+
"value": "test",
131+
"type": "string"
132+
},
133+
{
134+
"key": "boolean",
135+
"id": 4,
136+
"value": false,
137+
"type": "boolean"
138+
},
139+
{
140+
"key": "json",
141+
"id": 5,
142+
"value": "{\"name\": \"varun\"}",
143+
"type": "json"
144+
}
145+
],
146+
"name": "Default"
147+
},
148+
{
149+
"weight": 50,
150+
"id": 2,
151+
"variables": [{
152+
"key": "int",
153+
"id": 1,
154+
"value": 11,
155+
"type": "integer"
156+
},
157+
{
158+
"key": "float",
159+
"id": 2,
160+
"value": 20.02,
161+
"type": "double"
162+
},
163+
{
164+
"key": "string",
165+
"id": 3,
166+
"value": "test_variation",
167+
"type": "string"
168+
},
169+
{
170+
"key": "boolean",
171+
"id": 4,
172+
"value": true,
173+
"type": "boolean"
174+
},
175+
{
176+
"key": "json",
177+
"id": 5,
178+
"value": {
179+
"variation": 1,
180+
"name": "VWO"
181+
},
182+
"type": "json"
183+
}
184+
],
185+
"name": "Variation-1"
186+
}
187+
],
188+
"percentTraffic": 100,
189+
"type": "FLAG_TESTING",
190+
"status": "RUNNING"
191+
},
192+
{
193+
"key": "feature2_rolloutRule1",
194+
"name": "feature2_rolloutRule1",
195+
"id": 3,
196+
"segments": {},
197+
"isForcedVariationEnabled": false,
198+
"variations": [{
199+
"variables": [{
200+
"key": "int",
201+
"id": 1,
202+
"value": 10,
203+
"type": "integer"
204+
},
205+
{
206+
"key": "float",
207+
"id": 2,
208+
"value": 20.01,
209+
"type": "double"
210+
},
211+
{
212+
"key": "string",
213+
"id": 3,
214+
"value": "test",
215+
"type": "string"
216+
},
217+
{
218+
"key": "boolean",
219+
"id": 4,
220+
"value": false,
221+
"type": "boolean"
222+
},
223+
{
224+
"key": "json",
225+
"id": 5,
226+
"value": "{\"name\": \"varun\"}",
227+
"type": "json"
228+
}
229+
],
230+
"id": 1,
231+
"salt": "rolloutSalt",
232+
"segments": {},
233+
"weight": 100,
234+
"name": "Rollout-rule-1"
235+
}],
236+
"type": "FLAG_ROLLOUT",
237+
"status": "RUNNING"
238+
},
239+
{
240+
"key": "feature2_testingRule1",
241+
"name": "feature2_testingRule1",
242+
"id": 4,
243+
"segments": {},
244+
"salt": "abcd",
245+
"isForcedVariationEnabled": false,
246+
"variations": [{
247+
"weight": 50,
248+
"id": 1,
249+
"variables": [{
250+
"key": "int",
251+
"id": 1,
252+
"value": 10,
253+
"type": "integer"
254+
},
255+
{
256+
"key": "float",
257+
"id": 2,
258+
"value": 20.01,
259+
"type": "double"
260+
},
261+
{
262+
"key": "string",
263+
"id": 3,
264+
"value": "test",
265+
"type": "string"
266+
},
267+
{
268+
"key": "boolean",
269+
"id": 4,
270+
"value": false,
271+
"type": "boolean"
272+
},
273+
{
274+
"key": "json",
275+
"id": 5,
276+
"value": "{\"name\": \"varun\"}",
277+
"type": "json"
278+
}
279+
],
280+
"name": "Default"
281+
},
282+
{
283+
"weight": 50,
284+
"id": 2,
285+
"variables": [{
286+
"key": "int",
287+
"id": 1,
288+
"value": 11,
289+
"type": "integer"
290+
},
291+
{
292+
"key": "float",
293+
"id": 2,
294+
"value": 20.02,
295+
"type": "double"
296+
},
297+
{
298+
"key": "string",
299+
"id": 3,
300+
"value": "test_variation",
301+
"type": "string"
302+
},
303+
{
304+
"key": "boolean",
305+
"id": 4,
306+
"value": true,
307+
"type": "boolean"
308+
},
309+
{
310+
"key": "json",
311+
"id": 5,
312+
"value": {
313+
"variation": 1,
314+
"name": "VWO"
315+
},
316+
"type": "json"
317+
}
318+
],
319+
"name": "Variation-1"
320+
}
321+
],
322+
"percentTraffic": 100,
323+
"type": "FLAG_TESTING",
324+
"status": "RUNNING"
325+
}
326+
]
327+
}

0 commit comments

Comments
 (0)