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

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