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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// This file is @generated by prost-build.
/// \[#next-free-field: 7\]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProcessingMode {
/// How to handle the request header. Default is "SEND".
#[prost(enumeration = "processing_mode::HeaderSendMode", tag = "1")]
pub request_header_mode: i32,
/// How to handle the response header. Default is "SEND".
#[prost(enumeration = "processing_mode::HeaderSendMode", tag = "2")]
pub response_header_mode: i32,
/// How to handle the request body. Default is "NONE".
#[prost(enumeration = "processing_mode::BodySendMode", tag = "3")]
pub request_body_mode: i32,
/// How do handle the response body. Default is "NONE".
#[prost(enumeration = "processing_mode::BodySendMode", tag = "4")]
pub response_body_mode: i32,
/// How to handle the request trailers. Default is "SKIP".
#[prost(enumeration = "processing_mode::HeaderSendMode", tag = "5")]
pub request_trailer_mode: i32,
/// How to handle the response trailers. Default is "SKIP".
#[prost(enumeration = "processing_mode::HeaderSendMode", tag = "6")]
pub response_trailer_mode: i32,
}
/// Nested message and enum types in `ProcessingMode`.
pub mod processing_mode {
/// Control how headers and trailers are handled
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub 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,
}
impl HeaderSendMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Default => "DEFAULT",
Self::Send => "SEND",
Self::Skip => "SKIP",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEFAULT" => Some(Self::Default),
"SEND" => Some(Self::Send),
"SKIP" => Some(Self::Skip),
_ => None,
}
}
}
/// 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.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub 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.
BufferedPartial = 3,
}
impl BodySendMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "NONE",
Self::Streamed => "STREAMED",
Self::Buffered => "BUFFERED",
Self::BufferedPartial => "BUFFERED_PARTIAL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NONE" => Some(Self::None),
"STREAMED" => Some(Self::Streamed),
"BUFFERED" => Some(Self::Buffered),
"BUFFERED_PARTIAL" => Some(Self::BufferedPartial),
_ => None,
}
}
}
}
impl ::prost::Name for ProcessingMode {
const NAME: &'static str = "ProcessingMode";
const PACKAGE: &'static str = "envoy.extensions.filters.http.ext_proc.v3";
fn full_name() -> ::prost::alloc::string::String {
"envoy.extensions.filters.http.ext_proc.v3.ProcessingMode".into()
}
fn type_url() -> ::prost::alloc::string::String {
"type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ProcessingMode"
.into()
}
}