Skip to content

Commit a91093b

Browse files
committed
refactor: add region handler rule and region var
Add "Region Handler" rule that extracts the `region` query parameter into `PMUSER_FP_REGION` variable. Related-Task: INTER-1986
1 parent eccb572 commit a91093b

3 files changed

Lines changed: 60 additions & 15 deletions

File tree

.changeset/olive-donuts-appear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fingerprint-pro-akamai-proxy-integration': patch
3+
---
4+
5+
Improved internal request routing logic for region.

assets/rulesTemplate.json

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,72 @@
22
"name": "Fingerprint",
33
"children": [
44
{
5-
"name": "Ingress Endpoint Parser",
5+
"name": "Region Handler",
66
"children": [],
77
"behaviors": [
88
{
99
"name": "setVariable",
1010
"options": {
1111
"valueSource": "EXTRACT",
12-
"transform": "SUBSTITUTE",
13-
"variableName": "PMUSER_FPJS_INGRESS_ENDPOINT",
12+
"transform": "NONE",
13+
"variableName": "PMUSER_FP_REGION",
1414
"extractLocation": "QUERY_STRING",
15-
"queryParameterName": "region",
16-
"regex": "^(\\w+)$",
17-
"replacement": "$0.__ingress_url__",
18-
"caseSensitive": false,
19-
"globalSubstitution": true
15+
"queryParameterName": "region"
2016
}
2117
}
2218
],
2319
"criteria": [
2420
{
2521
"name": "queryStringParameter",
2622
"options": {
27-
"matchOperator": "IS_ONE_OF",
23+
"matchOperator": "EXISTS",
24+
"matchWildcardName": false,
25+
"matchCaseSensitiveName": true,
26+
"parameterName": "region"
27+
}
28+
},
29+
{
30+
"name": "queryStringParameter",
31+
"options": {
32+
"matchOperator": "IS_NOT_ONE_OF",
2833
"matchWildcardName": false,
2934
"matchCaseSensitiveName": true,
30-
"parameterName": "region",
31-
"values": [
32-
"eu",
33-
"ap"
34-
],
3535
"matchWildcardValue": false,
3636
"matchCaseSensitiveValue": true,
37-
"escapeValue": false
37+
"escapeValue": false,
38+
"parameterName": "region",
39+
"values": [
40+
"us"
41+
]
42+
}
43+
}
44+
],
45+
"criteriaMustSatisfy": "all",
46+
"comments": ""
47+
},
48+
{
49+
"name": "Ingress Endpoint Parser",
50+
"children": [],
51+
"behaviors": [
52+
{
53+
"name": "setVariable",
54+
"options": {
55+
"valueSource": "EXPRESSION",
56+
"transform": "NONE",
57+
"variableName": "PMUSER_FPJS_INGRESS_ENDPOINT",
58+
"variableValue": "{{user.PMUSER_FP_REGION}}.__ingress_url__"
59+
}
60+
}
61+
],
62+
"criteria": [
63+
{
64+
"name": "matchVariable",
65+
"options": {
66+
"matchOperator": "IS_NOT",
67+
"matchWildcardName": false,
68+
"matchCaseSensitiveName": true,
69+
"variableName": "PMUSER_FP_REGION",
70+
"variableExpression": "us"
3871
}
3972
}
4073
],

assets/variables.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,12 @@
5454
"description": "Generated via Fingerprint Dashboard",
5555
"hidden": false,
5656
"sensitive": true
57+
},
58+
{
59+
"name": "PMUSER_FP_REGION",
60+
"value": "us",
61+
"description": "Points to region used for request routing",
62+
"hidden": false,
63+
"sensitive": false
5764
}
5865
]

0 commit comments

Comments
 (0)