/
processing_mode.proto
90 lines (72 loc) · 3.91 KB
/
processing_mode.proto
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
82
83
84
85
86
87
88
89
90
syntax = "proto3";
package envoy.extensions.filters.http.ext_proc.v3;
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.filters.http.ext_proc.v3";
option java_outer_classname = "ProcessingModeProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ext_proc/v3;ext_procv3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: External Processing Filter]
// External Processing Filter Processing Mode
// [#extension: envoy.filters.http.ext_proc]
// This configuration describes which parts of an HTTP request and
// response are sent to a remote server and how they are delivered.
// [#next-free-field: 7]
message ProcessingMode {
// Control how headers and trailers are handled
enum HeaderSendMode {
// The default HeaderSendMode depends on which part of the message is being
// processed. By default, request and response headers are sent,
// while trailers are skipped.
DEFAULT = 0;
// Send the header or trailer.
SEND = 1;
// Do not send the header or trailer.
SKIP = 2;
}
// Control how the request and response bodies are handled
// When body mutation by external processor is enabled, ext_proc filter will always remove
// the content length header in three cases below because content length can not be guaranteed
// to be set correctly:
// 1) STREAMED BodySendMode: header processing completes before body mutation comes back.
// 2) BUFFERED_PARTIAL BodySendMode: body is buffered and could be injected in different phases.
// 3) BUFFERED BodySendMode + SKIP HeaderSendMode: header processing (e.g., update content-length) is skipped.
//
// In Envoy's http1 codec implementation, removing content length will enable chunked transfer
// encoding whenever feasible. The recipient (either client or server) must be able
// to parse and decode the chunked transfer coding.
// (see `details in RFC9112 <https://tools.ietf.org/html/rfc9112#section-7.1>`_).
//
// In BUFFERED BodySendMode + SEND HeaderSendMode, content length header is allowed but it is
// external processor's responsibility to set the content length correctly matched to the length
// of mutated body. If they don't match, the corresponding body mutation will be rejected and
// local reply will be sent with an error message.
enum BodySendMode {
// Do not send the body at all. This is the default.
NONE = 0;
// Stream the body to the server in pieces as they arrive at the
// proxy.
STREAMED = 1;
// Buffer the message body in memory and send the entire body at once.
// If the body exceeds the configured buffer limit, then the
// downstream system will receive an error.
BUFFERED = 2;
// Buffer the message body in memory and send the entire body in one
// chunk. If the body exceeds the configured buffer limit, then the body contents
// up to the buffer limit will be sent.
BUFFERED_PARTIAL = 3;
}
// How to handle the request header. Default is "SEND".
HeaderSendMode request_header_mode = 1 [(validate.rules).enum = {defined_only: true}];
// How to handle the response header. Default is "SEND".
HeaderSendMode response_header_mode = 2 [(validate.rules).enum = {defined_only: true}];
// How to handle the request body. Default is "NONE".
BodySendMode request_body_mode = 3 [(validate.rules).enum = {defined_only: true}];
// How do handle the response body. Default is "NONE".
BodySendMode response_body_mode = 4 [(validate.rules).enum = {defined_only: true}];
// How to handle the request trailers. Default is "SKIP".
HeaderSendMode request_trailer_mode = 5 [(validate.rules).enum = {defined_only: true}];
// How to handle the response trailers. Default is "SKIP".
HeaderSendMode response_trailer_mode = 6 [(validate.rules).enum = {defined_only: true}];
}