linkerd2_proxy_api/gen/
io.linkerd.proxy.http_route.rs

1/// Describes how to match an `:authority` or `host` header.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct HostMatch {
5    #[prost(oneof = "host_match::Match", tags = "1, 2")]
6    pub r#match: ::core::option::Option<host_match::Match>,
7}
8/// Nested message and enum types in `HostMatch`.
9pub mod host_match {
10    /// A match like `*.example.com` is encoded as \[com, example\].
11    #[allow(clippy::derive_partial_eq_without_eq)]
12    #[derive(Clone, PartialEq, ::prost::Message)]
13    pub struct Suffix {
14        #[prost(string, repeated, tag = "1")]
15        pub reverse_labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
16    }
17    #[allow(clippy::derive_partial_eq_without_eq)]
18    #[derive(Clone, PartialEq, ::prost::Oneof)]
19    pub enum Match {
20        /// Match an exact hostname, e.g. www.example.com.
21        #[prost(string, tag = "1")]
22        Exact(::prost::alloc::string::String),
23        /// Match a hostname as a wildcard suffix, e.g. *.example.com.
24        #[prost(message, tag = "2")]
25        Suffix(Suffix),
26    }
27}
28/// Describes a set of matches, ALL of which must apply.
29#[allow(clippy::derive_partial_eq_without_eq)]
30#[derive(Clone, PartialEq, ::prost::Message)]
31pub struct HttpRouteMatch {
32    /// Matches requests by path.
33    #[prost(message, optional, tag = "1")]
34    pub path: ::core::option::Option<PathMatch>,
35    /// A set of header value matches that must be satisified. This match is not
36    /// comprehensive, so requests may include headers that are not covered by this
37    /// match.
38    #[prost(message, repeated, tag = "2")]
39    pub headers: ::prost::alloc::vec::Vec<HeaderMatch>,
40    /// A set of query parmaeter value matches that must be satisified. This match
41    /// is not comprehensive, so requests may include query parameters that are not
42    /// covered by this match.
43    #[prost(message, repeated, tag = "3")]
44    pub query_params: ::prost::alloc::vec::Vec<QueryParamMatch>,
45    /// If specified, restricts the match to a single HTTP method.
46    #[prost(message, optional, tag = "4")]
47    pub method: ::core::option::Option<super::http_types::HttpMethod>,
48}
49/// Describes how to match a path.
50#[allow(clippy::derive_partial_eq_without_eq)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct PathMatch {
53    #[prost(oneof = "path_match::Kind", tags = "1, 2, 3")]
54    pub kind: ::core::option::Option<path_match::Kind>,
55}
56/// Nested message and enum types in `PathMatch`.
57pub mod path_match {
58    #[allow(clippy::derive_partial_eq_without_eq)]
59    #[derive(Clone, PartialEq, ::prost::Oneof)]
60    pub enum Kind {
61        #[prost(string, tag = "1")]
62        Exact(::prost::alloc::string::String),
63        #[prost(string, tag = "2")]
64        Prefix(::prost::alloc::string::String),
65        #[prost(string, tag = "3")]
66        Regex(::prost::alloc::string::String),
67    }
68}
69/// Describes how to match a header by name and value.
70#[allow(clippy::derive_partial_eq_without_eq)]
71#[derive(Clone, PartialEq, ::prost::Message)]
72pub struct HeaderMatch {
73    #[prost(string, tag = "1")]
74    pub name: ::prost::alloc::string::String,
75    #[prost(oneof = "header_match::Value", tags = "2, 3")]
76    pub value: ::core::option::Option<header_match::Value>,
77}
78/// Nested message and enum types in `HeaderMatch`.
79pub mod header_match {
80    #[allow(clippy::derive_partial_eq_without_eq)]
81    #[derive(Clone, PartialEq, ::prost::Oneof)]
82    pub enum Value {
83        #[prost(bytes, tag = "2")]
84        Exact(::prost::alloc::vec::Vec<u8>),
85        #[prost(string, tag = "3")]
86        Regex(::prost::alloc::string::String),
87    }
88}
89/// Describes how to match a query parameter by name and value.
90#[allow(clippy::derive_partial_eq_without_eq)]
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct QueryParamMatch {
93    #[prost(string, tag = "1")]
94    pub name: ::prost::alloc::string::String,
95    #[prost(oneof = "query_param_match::Value", tags = "2, 3")]
96    pub value: ::core::option::Option<query_param_match::Value>,
97}
98/// Nested message and enum types in `QueryParamMatch`.
99pub mod query_param_match {
100    #[allow(clippy::derive_partial_eq_without_eq)]
101    #[derive(Clone, PartialEq, ::prost::Oneof)]
102    pub enum Value {
103        #[prost(string, tag = "2")]
104        Exact(::prost::alloc::string::String),
105        #[prost(string, tag = "3")]
106        Regex(::prost::alloc::string::String),
107    }
108}
109/// Configures a route to modify a request's headers.
110///
111/// Modifications are to be applied in the order they are described here:
112/// additions apply first, then sets, and then removals.
113#[allow(clippy::derive_partial_eq_without_eq)]
114#[derive(Clone, PartialEq, ::prost::Message)]
115pub struct RequestHeaderModifier {
116    /// A list of headers name-value pairs to set on requests, augmenting any
117    /// existing values for the header.
118    #[prost(message, optional, tag = "1")]
119    pub add: ::core::option::Option<super::http_types::Headers>,
120    /// A list of headers name-value pairs to set on requests, replacing any
121    /// existing values for the header.
122    #[prost(message, optional, tag = "2")]
123    pub set: ::core::option::Option<super::http_types::Headers>,
124    /// A list of headers names to be removed from requests.
125    #[prost(string, repeated, tag = "3")]
126    pub remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
127}
128/// Configures a route to modify a response's headers.
129///
130/// Modifications are to be applied in the order they are described here:
131/// additions apply first, then sets, and then removals.
132#[allow(clippy::derive_partial_eq_without_eq)]
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct ResponseHeaderModifier {
135    /// A list of headers name-value pairs to set on responses, augmenting any
136    /// existing values for the header.
137    #[prost(message, optional, tag = "1")]
138    pub add: ::core::option::Option<super::http_types::Headers>,
139    /// A list of headers name-value pairs to set on responses, replacing any
140    /// existing values for the header.
141    #[prost(message, optional, tag = "2")]
142    pub set: ::core::option::Option<super::http_types::Headers>,
143    /// A list of headers names to be removed from responses.
144    #[prost(string, repeated, tag = "3")]
145    pub remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
146}
147/// Configures a route to respond with a redirect response. The `location` header
148/// is set with the given URL parameters.
149#[allow(clippy::derive_partial_eq_without_eq)]
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct RequestRedirect {
152    /// The scheme value to be used in the `location` header. If not specified,
153    /// the original request's scheme is used.
154    #[prost(message, optional, tag = "1")]
155    pub scheme: ::core::option::Option<super::http_types::Scheme>,
156    /// The host value to be used in the `location` header. If not specified, the
157    /// original request's host is used.
158    #[prost(string, tag = "2")]
159    pub host: ::prost::alloc::string::String,
160    /// If set, configures how the request's path should be modified for use in
161    /// the `location` header. If not specified, the original request's path is
162    /// used.
163    #[prost(message, optional, tag = "3")]
164    pub path: ::core::option::Option<PathModifier>,
165    /// If set, specifies the port to use in the `location` header.
166    #[prost(uint32, tag = "4")]
167    pub port: u32,
168    /// The status code to use in the HTTP response. If not specified, 301 is
169    /// used.
170    #[prost(uint32, tag = "5")]
171    pub status: u32,
172}
173/// Describes how a path value may be rewritten in a route.
174#[allow(clippy::derive_partial_eq_without_eq)]
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct PathModifier {
177    #[prost(oneof = "path_modifier::Replace", tags = "1, 2")]
178    pub replace: ::core::option::Option<path_modifier::Replace>,
179}
180/// Nested message and enum types in `PathModifier`.
181pub mod path_modifier {
182    #[allow(clippy::derive_partial_eq_without_eq)]
183    #[derive(Clone, PartialEq, ::prost::Oneof)]
184    pub enum Replace {
185        /// Indicates that the path should be replaced with the given value.
186        #[prost(string, tag = "1")]
187        Full(::prost::alloc::string::String),
188        /// Indicates that the path prefix should be replaced with the given
189        /// value. When used, the route MUST match the request with PathMatch
190        /// prefix match. Server implementations SHOULD prevent the useof prefix
191        /// modifiers on routes that do use a PathMatch prefix match. Proxyies
192        /// MUST not process requests for routes where this condition is not
193        /// satisfied.
194        #[prost(string, tag = "2")]
195        Prefix(::prost::alloc::string::String),
196    }
197}
198/// Configures a route to respond with a fixed response.
199#[allow(clippy::derive_partial_eq_without_eq)]
200#[derive(Clone, PartialEq, ::prost::Message)]
201pub struct HttpFailureInjector {
202    /// The status code to use in the HTTP response. Must be specified.
203    #[prost(uint32, tag = "1")]
204    pub status: u32,
205    /// An error message to log and include in the `l5d-proxy-err` header.
206    #[prost(string, tag = "2")]
207    pub message: ::prost::alloc::string::String,
208    /// If specified, the rate of requests that should be failed. If not specified,
209    /// ALL requests are failed.
210    #[prost(message, optional, tag = "3")]
211    pub ratio: ::core::option::Option<Ratio>,
212}
213/// A ratio (i.e., of requests) to which an filter should be applied.
214///
215/// Represents fractional values on \[0, 1\].
216#[allow(clippy::derive_partial_eq_without_eq)]
217#[derive(Clone, PartialEq, ::prost::Message)]
218pub struct Ratio {
219    #[prost(uint32, tag = "1")]
220    pub numerator: u32,
221    /// MUST not be zero.
222    #[prost(uint32, tag = "2")]
223    pub denominator: u32,
224}
225#[allow(clippy::derive_partial_eq_without_eq)]
226#[derive(Clone, PartialEq, ::prost::Message)]
227pub struct Timeouts {
228    /// Limits the the time a stream may be active after all request frames have
229    /// been processed.
230    #[prost(message, optional, tag = "1")]
231    pub response: ::core::option::Option<::prost_types::Duration>,
232    /// Limits the total duration of the stream from the request being initiated
233    /// until all frames have been processed.
234    #[prost(message, optional, tag = "2")]
235    pub request: ::core::option::Option<::prost_types::Duration>,
236    /// Limits the amount of time a stream may be idle (i.e. with no frames being
237    /// processed).
238    #[prost(message, optional, tag = "3")]
239    pub idle: ::core::option::Option<::prost_types::Duration>,
240}