forked from grpc/grpc-node
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRoute.ts
More file actions
268 lines (265 loc) · 13.2 KB
/
Copy pathRoute.ts
File metadata and controls
268 lines (265 loc) · 13.2 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
// Original file: deps/envoy-api/envoy/config/route/v3/route_components.proto
import type { RouteMatch as _envoy_config_route_v3_RouteMatch, RouteMatch__Output as _envoy_config_route_v3_RouteMatch__Output } from '../../../../envoy/config/route/v3/RouteMatch';
import type { RouteAction as _envoy_config_route_v3_RouteAction, RouteAction__Output as _envoy_config_route_v3_RouteAction__Output } from '../../../../envoy/config/route/v3/RouteAction';
import type { RedirectAction as _envoy_config_route_v3_RedirectAction, RedirectAction__Output as _envoy_config_route_v3_RedirectAction__Output } from '../../../../envoy/config/route/v3/RedirectAction';
import type { Metadata as _envoy_config_core_v3_Metadata, Metadata__Output as _envoy_config_core_v3_Metadata__Output } from '../../../../envoy/config/core/v3/Metadata';
import type { Decorator as _envoy_config_route_v3_Decorator, Decorator__Output as _envoy_config_route_v3_Decorator__Output } from '../../../../envoy/config/route/v3/Decorator';
import type { DirectResponseAction as _envoy_config_route_v3_DirectResponseAction, DirectResponseAction__Output as _envoy_config_route_v3_DirectResponseAction__Output } from '../../../../envoy/config/route/v3/DirectResponseAction';
import type { HeaderValueOption as _envoy_config_core_v3_HeaderValueOption, HeaderValueOption__Output as _envoy_config_core_v3_HeaderValueOption__Output } from '../../../../envoy/config/core/v3/HeaderValueOption';
import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any';
import type { Tracing as _envoy_config_route_v3_Tracing, Tracing__Output as _envoy_config_route_v3_Tracing__Output } from '../../../../envoy/config/route/v3/Tracing';
import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value';
import type { FilterAction as _envoy_config_route_v3_FilterAction, FilterAction__Output as _envoy_config_route_v3_FilterAction__Output } from '../../../../envoy/config/route/v3/FilterAction';
import type { NonForwardingAction as _envoy_config_route_v3_NonForwardingAction, NonForwardingAction__Output as _envoy_config_route_v3_NonForwardingAction__Output } from '../../../../envoy/config/route/v3/NonForwardingAction';
/**
* A route is both a specification of how to match a request as well as an indication of what to do
* next (e.g., redirect, forward, rewrite, etc.).
*
* .. attention::
*
* Envoy supports routing on HTTP method via :ref:`header matching
* <envoy_v3_api_msg_config.route.v3.HeaderMatcher>`.
* [#next-free-field: 20]
*/
export interface Route {
/**
* Route matching parameters.
*/
'match'?: (_envoy_config_route_v3_RouteMatch | null);
/**
* Route request to some upstream cluster.
*/
'route'?: (_envoy_config_route_v3_RouteAction | null);
/**
* Return a redirect.
*/
'redirect'?: (_envoy_config_route_v3_RedirectAction | null);
/**
* The Metadata field can be used to provide additional information
* about the route. It can be used for configuration, stats, and logging.
* The metadata should go under the filter namespace that will need it.
* For instance, if the metadata is intended for the Router filter,
* the filter name should be specified as ``envoy.filters.http.router``.
*/
'metadata'?: (_envoy_config_core_v3_Metadata | null);
/**
* Decorator for the matched route.
*/
'decorator'?: (_envoy_config_route_v3_Decorator | null);
/**
* Return an arbitrary HTTP response directly, without proxying.
*/
'direct_response'?: (_envoy_config_route_v3_DirectResponseAction | null);
/**
* Specifies a set of headers that will be added to requests matching this
* route. Headers specified at this level are applied before headers from the
* enclosing :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` and
* :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including details on
* header value syntax, see the documentation on :ref:`custom request headers
* <config_http_conn_man_headers_custom_request_headers>`.
*/
'request_headers_to_add'?: (_envoy_config_core_v3_HeaderValueOption)[];
/**
* Specifies a set of headers that will be added to responses to requests
* matching this route. Headers specified at this level are applied before
* headers from the enclosing :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` and
* :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including
* details on header value syntax, see the documentation on
* :ref:`custom request headers <config_http_conn_man_headers_custom_request_headers>`.
*/
'response_headers_to_add'?: (_envoy_config_core_v3_HeaderValueOption)[];
/**
* Specifies a list of HTTP headers that should be removed from each response
* to requests matching this route.
*/
'response_headers_to_remove'?: (string)[];
/**
* Specifies a list of HTTP headers that should be removed from each request
* matching this route.
*/
'request_headers_to_remove'?: (string)[];
/**
* This field can be used to provide route specific per filter config. The key should match the
* :ref:`filter config name
* <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.name>`.
* See :ref:`Http filter route specific config <arch_overview_http_filters_per_filter_config>`
* for details.
* [#comment: An entry's value may be wrapped in a
* :ref:`FilterConfig<envoy_v3_api_msg_config.route.v3.FilterConfig>`
* message to specify additional options.]
*/
'typed_per_filter_config'?: ({[key: string]: _google_protobuf_Any});
/**
* Name for the route.
*/
'name'?: (string);
/**
* Presence of the object defines whether the connection manager's tracing configuration
* is overridden by this route specific instance.
*/
'tracing'?: (_envoy_config_route_v3_Tracing | null);
/**
* The maximum bytes which will be buffered for retries and shadowing.
* If set, the bytes actually buffered will be the minimum value of this and the
* listener per_connection_buffer_limit_bytes.
*/
'per_request_buffer_limit_bytes'?: (_google_protobuf_UInt32Value | null);
/**
* [#not-implemented-hide:]
* A filter-defined action (e.g., it could dynamically generate the RouteAction).
* [#comment: TODO(samflattery): Remove cleanup in route_fuzz_test.cc when
* implemented]
*/
'filter_action'?: (_envoy_config_route_v3_FilterAction | null);
/**
* [#not-implemented-hide:]
* An action used when the route will generate a response directly,
* without forwarding to an upstream host. This will be used in non-proxy
* xDS clients like the gRPC server. It could also be used in the future
* in Envoy for a filter that directly generates responses for requests.
*/
'non_forwarding_action'?: (_envoy_config_route_v3_NonForwardingAction | null);
/**
* The human readable prefix to use when emitting statistics for this endpoint.
* The statistics are rooted at vhost.<virtual host name>.route.<stat_prefix>.
* This should be set for highly critical
* endpoints that one wishes to get “per-route” statistics on.
* If not set, endpoint statistics are not generated.
*
* The emitted statistics are the same as those documented for :ref:`virtual clusters <config_http_filters_router_vcluster_stats>`.
*
* .. warning::
*
* We do not recommend setting up a stat prefix for
* every application endpoint. This is both not easily maintainable and
* statistics use a non-trivial amount of memory(approximately 1KiB per route).
*/
'stat_prefix'?: (string);
'action'?: "route"|"redirect"|"direct_response"|"filter_action"|"non_forwarding_action";
}
/**
* A route is both a specification of how to match a request as well as an indication of what to do
* next (e.g., redirect, forward, rewrite, etc.).
*
* .. attention::
*
* Envoy supports routing on HTTP method via :ref:`header matching
* <envoy_v3_api_msg_config.route.v3.HeaderMatcher>`.
* [#next-free-field: 20]
*/
export interface Route__Output {
/**
* Route matching parameters.
*/
'match': (_envoy_config_route_v3_RouteMatch__Output | null);
/**
* Route request to some upstream cluster.
*/
'route'?: (_envoy_config_route_v3_RouteAction__Output | null);
/**
* Return a redirect.
*/
'redirect'?: (_envoy_config_route_v3_RedirectAction__Output | null);
/**
* The Metadata field can be used to provide additional information
* about the route. It can be used for configuration, stats, and logging.
* The metadata should go under the filter namespace that will need it.
* For instance, if the metadata is intended for the Router filter,
* the filter name should be specified as ``envoy.filters.http.router``.
*/
'metadata': (_envoy_config_core_v3_Metadata__Output | null);
/**
* Decorator for the matched route.
*/
'decorator': (_envoy_config_route_v3_Decorator__Output | null);
/**
* Return an arbitrary HTTP response directly, without proxying.
*/
'direct_response'?: (_envoy_config_route_v3_DirectResponseAction__Output | null);
/**
* Specifies a set of headers that will be added to requests matching this
* route. Headers specified at this level are applied before headers from the
* enclosing :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` and
* :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including details on
* header value syntax, see the documentation on :ref:`custom request headers
* <config_http_conn_man_headers_custom_request_headers>`.
*/
'request_headers_to_add': (_envoy_config_core_v3_HeaderValueOption__Output)[];
/**
* Specifies a set of headers that will be added to responses to requests
* matching this route. Headers specified at this level are applied before
* headers from the enclosing :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost` and
* :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`. For more information, including
* details on header value syntax, see the documentation on
* :ref:`custom request headers <config_http_conn_man_headers_custom_request_headers>`.
*/
'response_headers_to_add': (_envoy_config_core_v3_HeaderValueOption__Output)[];
/**
* Specifies a list of HTTP headers that should be removed from each response
* to requests matching this route.
*/
'response_headers_to_remove': (string)[];
/**
* Specifies a list of HTTP headers that should be removed from each request
* matching this route.
*/
'request_headers_to_remove': (string)[];
/**
* This field can be used to provide route specific per filter config. The key should match the
* :ref:`filter config name
* <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.name>`.
* See :ref:`Http filter route specific config <arch_overview_http_filters_per_filter_config>`
* for details.
* [#comment: An entry's value may be wrapped in a
* :ref:`FilterConfig<envoy_v3_api_msg_config.route.v3.FilterConfig>`
* message to specify additional options.]
*/
'typed_per_filter_config': ({[key: string]: _google_protobuf_Any__Output});
/**
* Name for the route.
*/
'name': (string);
/**
* Presence of the object defines whether the connection manager's tracing configuration
* is overridden by this route specific instance.
*/
'tracing': (_envoy_config_route_v3_Tracing__Output | null);
/**
* The maximum bytes which will be buffered for retries and shadowing.
* If set, the bytes actually buffered will be the minimum value of this and the
* listener per_connection_buffer_limit_bytes.
*/
'per_request_buffer_limit_bytes': (_google_protobuf_UInt32Value__Output | null);
/**
* [#not-implemented-hide:]
* A filter-defined action (e.g., it could dynamically generate the RouteAction).
* [#comment: TODO(samflattery): Remove cleanup in route_fuzz_test.cc when
* implemented]
*/
'filter_action'?: (_envoy_config_route_v3_FilterAction__Output | null);
/**
* [#not-implemented-hide:]
* An action used when the route will generate a response directly,
* without forwarding to an upstream host. This will be used in non-proxy
* xDS clients like the gRPC server. It could also be used in the future
* in Envoy for a filter that directly generates responses for requests.
*/
'non_forwarding_action'?: (_envoy_config_route_v3_NonForwardingAction__Output | null);
/**
* The human readable prefix to use when emitting statistics for this endpoint.
* The statistics are rooted at vhost.<virtual host name>.route.<stat_prefix>.
* This should be set for highly critical
* endpoints that one wishes to get “per-route” statistics on.
* If not set, endpoint statistics are not generated.
*
* The emitted statistics are the same as those documented for :ref:`virtual clusters <config_http_filters_router_vcluster_stats>`.
*
* .. warning::
*
* We do not recommend setting up a stat prefix for
* every application endpoint. This is both not easily maintainable and
* statistics use a non-trivial amount of memory(approximately 1KiB per route).
*/
'stat_prefix': (string);
'action'?: "route"|"redirect"|"direct_response"|"filter_action"|"non_forwarding_action";
}