forked from TykTechnologies/tyk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jq.json
57 lines (56 loc) · 1.89 KB
/
jq.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
"name": "JQ Transform test API",
"api_id": "4",
"org_id": "default",
"definition": {
"location": "",
"key": ""
},
"use_keyless": true,
"auth": {
"auth_header_name": ""
},
"enable_context_vars": true,
"version_data": {
"not_versioned": true,
"versions": {
"Default": {
"name": "Default",
"expires": "3000-01-02 15:04",
"use_extended_paths": true,
"extended_paths": {
"ignored": [],
"white_list": [],
"black_list": [],
"transform_jq": [{
"path": "/post",
"method": "POST",
"filter": "{\"body\": (.body + {\"TRANSFORMED-REQUEST-BY-JQ\": true, path: ._tyk_context.path, user_agent: ._tyk_context.headers_User_Agent}), \"rewrite_headers\": {\"X-added-rewrite-headers\": \"test\"}, \"tyk_context\": {\"m2m_origin\": \"CSE3219/C9886\", \"deviceid\": .body.DEVICEID}}"
}],
"transform_headers": [
{
"path": "/post",
"method": "POST",
"add_headers": {"X-added-by-transform_headers": "$tyk_context.deviceid",
"X-M2M-Origin": "$tyk_context.m2m_origin"}
}
],
"transform_jq_response": [{
"path": "/post",
"method": "POST",
"filter": "{\"body\": (.body + {\"TRANSFORMED-RESPONSE-BY-JQ\": true, \"HEADERS-OF-RESPONSE\": .response_headers}), \"rewrite_headers\": {\"JQ-Response-header\": .body.origin}}"
}]
}
}
}
},
"proxy": {
"listen_path": "/jq/",
"target_url": "http://httpbin.org/",
"strip_listen_path": true
},
"do_not_track": true,
"response_processors": [
{ "name": "response_body_transform_jq", "options": {}}
]
}