-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbody_processing.textproto
More file actions
82 lines (72 loc) · 1.58 KB
/
body_processing.textproto
File metadata and controls
82 lines (72 loc) · 1.58 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Body processing test manifest
#
# Tests ExtProc body processing scenarios including:
# - Body modification
# - Body inspection without modification
name: "body-processing"
description: "Test request body processing in ExtProc"
test_cases: {
name: "body-inspection"
description: "Body should be inspected and a header added"
tags: ["body"]
request: {
method: "POST"
path: "/api/v1/data"
scheme: "https"
authority: "api.example.com"
headers: {
key: "content-type"
value: "application/json"
}
body: '{"name": "test", "value": 123}'
process_request_body: true
}
expectations: {
phase: REQUEST_HEADERS
headers_response: {}
}
expectations: {
phase: REQUEST_BODY
body_response: {
common_response: {
status: CONTINUE
header_mutation: {
set_headers: {
key: "x-body-size"
value: "30"
}
}
}
}
}
}
test_cases: {
name: "body-transformation"
description: "Body should be transformed by ExtProc"
tags: ["body", "transform"]
request: {
method: "POST"
path: "/api/v1/transform"
scheme: "https"
authority: "api.example.com"
headers: {
key: "content-type"
value: "application/json"
}
body: '{"input": "data"}'
process_request_body: true
}
expectations: {
phase: REQUEST_HEADERS
headers_response: {}
}
expectations: {
phase: REQUEST_BODY
body_response: {
body: '{"input": "data", "processed": true}'
common_response: {
status: CONTINUE_AND_REPLACE
}
}
}
}