-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Copy pathroute_components.proto
2563 lines (2209 loc) · 125 KB
/
route_components.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
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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto3";
package envoy.config.route.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/proxy_protocol.proto";
import "envoy/type/matcher/v3/metadata.proto";
import "envoy/type/matcher/v3/regex.proto";
import "envoy/type/matcher/v3/string.proto";
import "envoy/type/metadata/v3/metadata.proto";
import "envoy/type/tracing/v3/custom_tag.proto";
import "envoy/type/v3/percent.proto";
import "envoy/type/v3/range.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "xds/type/matcher/v3/matcher.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.config.route.v3";
option java_outer_classname = "RouteComponentsProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/route/v3;routev3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: HTTP route components]
// * Routing :ref:`architecture overview <arch_overview_http_routing>`
// * HTTP :ref:`router filter <config_http_filters_router>`
// The top level element in the routing configuration is a virtual host. Each virtual host has
// a logical name as well as a set of domains that get routed to it based on the incoming request's
// host header. This allows a single listener to service multiple top level domain path trees. Once
// a virtual host is selected based on the domain, the routes are processed in order to see which
// upstream cluster to route to or whether to perform a redirect.
// [#next-free-field: 25]
message VirtualHost {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.VirtualHost";
enum TlsRequirementType {
// No TLS requirement for the virtual host.
NONE = 0;
// External requests must use TLS. If a request is external and it is not
// using TLS, a 301 redirect will be sent telling the client to use HTTPS.
EXTERNAL_ONLY = 1;
// All requests must use TLS. If a request is not using TLS, a 301 redirect
// will be sent telling the client to use HTTPS.
ALL = 2;
}
reserved 9, 12;
reserved "per_filter_config";
// The logical name of the virtual host. This is used when emitting certain
// statistics but is not relevant for routing.
string name = 1 [(validate.rules).string = {min_len: 1}];
// A list of domains (host/authority header) that will be matched to this
// virtual host. Wildcard hosts are supported in the suffix or prefix form.
//
// Domain search order:
// 1. Exact domain names: ``www.foo.com``.
// 2. Suffix domain wildcards: ``*.foo.com`` or ``*-bar.foo.com``.
// 3. Prefix domain wildcards: ``foo.*`` or ``foo-*``.
// 4. Special wildcard ``*`` matching any domain.
//
// .. note::
//
// The wildcard will not match the empty string.
// e.g. ``*-bar.foo.com`` will match ``baz-bar.foo.com`` but not ``-bar.foo.com``.
// The longest wildcards match first.
// Only a single virtual host in the entire route configuration can match on ``*``. A domain
// must be unique across all virtual hosts or the config will fail to load.
//
// Domains cannot contain control characters. This is validated by the well_known_regex HTTP_HEADER_VALUE.
repeated string domains = 2 [(validate.rules).repeated = {
min_items: 1
items {string {well_known_regex: HTTP_HEADER_VALUE strict: false}}
}];
// The list of routes that will be matched, in order, for incoming requests.
// The first route that matches will be used.
// Only one of this and ``matcher`` can be specified.
repeated Route routes = 3 [(udpa.annotations.field_migrate).oneof_promotion = "route_selection"];
// The match tree to use when resolving route actions for incoming requests. Only one of this and ``routes``
// can be specified.
xds.type.matcher.v3.Matcher matcher = 21
[(udpa.annotations.field_migrate).oneof_promotion = "route_selection"];
// Specifies the type of TLS enforcement the virtual host expects. If this option is not
// specified, there is no TLS requirement for the virtual host.
TlsRequirementType require_tls = 4 [(validate.rules).enum = {defined_only: true}];
// A list of virtual clusters defined for this virtual host. Virtual clusters
// are used for additional statistics gathering.
repeated VirtualCluster virtual_clusters = 5;
// Specifies a set of rate limit configurations that will be applied to the
// virtual host.
repeated RateLimit rate_limits = 6;
// Specifies a list of HTTP headers that should be added to each request
// handled by this virtual host. Headers specified at this level are applied
// after headers from enclosed :ref:`envoy_v3_api_msg_config.route.v3.Route` and before headers from the
// enclosing :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>`.
repeated core.v3.HeaderValueOption request_headers_to_add = 7
[(validate.rules).repeated = {max_items: 1000}];
// Specifies a list of HTTP headers that should be removed from each request
// handled by this virtual host.
repeated string request_headers_to_remove = 13 [(validate.rules).repeated = {
items {string {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}}
}];
// Specifies a list of HTTP headers that should be added to each response
// handled by this virtual host. Headers specified at this level are applied
// after headers from enclosed :ref:`envoy_v3_api_msg_config.route.v3.Route` and before headers from the
// enclosing :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>`.
repeated core.v3.HeaderValueOption response_headers_to_add = 10
[(validate.rules).repeated = {max_items: 1000}];
// Specifies a list of HTTP headers that should be removed from each response
// handled by this virtual host.
repeated string response_headers_to_remove = 11 [(validate.rules).repeated = {
items {string {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}}
}];
// Indicates that the virtual host has a CORS policy. This field is ignored if related cors policy is
// found in the
// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>`.
//
// .. attention::
//
// This option has been deprecated. Please use
// :ref:`VirtualHost.typed_per_filter_config<envoy_v3_api_field_config.route.v3.VirtualHost.typed_per_filter_config>`
// to configure the CORS HTTP filter.
CorsPolicy cors = 8 [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
// This field can be used to provide virtual host level 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.]
map<string, google.protobuf.Any> typed_per_filter_config = 15;
// Decides whether the :ref:`x-envoy-attempt-count
// <config_http_filters_router_x-envoy-attempt-count>` header should be included
// in the upstream request. Setting this option will cause it to override any existing header
// value, so in the case of two Envoys on the request path with this option enabled, the upstream
// will see the attempt count as perceived by the second Envoy. Defaults to false.
// This header is unaffected by the
// :ref:`suppress_envoy_headers
// <envoy_v3_api_field_extensions.filters.http.router.v3.Router.suppress_envoy_headers>` flag.
//
// [#next-major-version: rename to include_attempt_count_in_request.]
bool include_request_attempt_count = 14;
// Decides whether the :ref:`x-envoy-attempt-count
// <config_http_filters_router_x-envoy-attempt-count>` header should be included
// in the downstream response. Setting this option will cause the router to override any existing header
// value, so in the case of two Envoys on the request path with this option enabled, the downstream
// will see the attempt count as perceived by the Envoy closest upstream from itself. Defaults to false.
// This header is unaffected by the
// :ref:`suppress_envoy_headers
// <envoy_v3_api_field_extensions.filters.http.router.v3.Router.suppress_envoy_headers>` flag.
bool include_attempt_count_in_response = 19;
// Indicates the retry policy for all routes in this virtual host. Note that setting a
// route level entry will take precedence over this config and it'll be treated
// independently (e.g.: values are not inherited).
RetryPolicy retry_policy = 16;
// [#not-implemented-hide:]
// Specifies the configuration for retry policy extension. Note that setting a route level entry
// will take precedence over this config and it'll be treated independently (e.g.: values are not
// inherited). :ref:`Retry policy <envoy_v3_api_field_config.route.v3.VirtualHost.retry_policy>` should not be
// set if this field is used.
google.protobuf.Any retry_policy_typed_config = 20;
// Indicates the hedge policy for all routes in this virtual host. Note that setting a
// route level entry will take precedence over this config and it'll be treated
// independently (e.g.: values are not inherited).
HedgePolicy hedge_policy = 17;
// Decides whether to include the :ref:`x-envoy-is-timeout-retry <config_http_filters_router_x-envoy-is-timeout-retry>`
// request header in retries initiated by per try timeouts.
bool include_is_timeout_retry_header = 23;
// The maximum bytes which will be buffered for retries and shadowing.
// If set and a route-specific limit is not set, the bytes actually buffered will be the minimum
// value of this and the listener per_connection_buffer_limit_bytes.
google.protobuf.UInt32Value per_request_buffer_limit_bytes = 18;
// Specify a set of default request mirroring policies for every route under this virtual host.
// It takes precedence over the route config mirror policy entirely.
// That is, policies are not merged, the most specific non-empty one becomes the mirror policies.
repeated RouteAction.RequestMirrorPolicy request_mirror_policies = 22;
// The metadata field can be used to provide additional information
// about the virtual host. 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``.
core.v3.Metadata metadata = 24;
}
// A filter-defined action type.
message FilterAction {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.FilterAction";
google.protobuf.Any action = 1;
}
// This can be used in route matcher :ref:`VirtualHost.matcher <envoy_v3_api_field_config.route.v3.VirtualHost.matcher>`.
// When the matcher matches, routes will be matched and run.
message RouteList {
// The list of routes that will be matched and run, in order. The first route that matches will be used.
repeated Route routes = 1;
}
// 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]
message Route {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.Route";
reserved 6, 8;
reserved "per_filter_config";
// Name for the route.
string name = 14;
// Route matching parameters.
RouteMatch match = 1 [(validate.rules).message = {required: true}];
oneof action {
option (validate.required) = true;
// Route request to some upstream cluster.
RouteAction route = 2;
// Return a redirect.
RedirectAction redirect = 3;
// Return an arbitrary HTTP response directly, without proxying.
DirectResponseAction direct_response = 7;
// [#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]
FilterAction filter_action = 17;
// [#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.
NonForwardingAction non_forwarding_action = 18;
}
// 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``.
core.v3.Metadata metadata = 4;
// Decorator for the matched route.
Decorator decorator = 5;
// 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.]
map<string, google.protobuf.Any> typed_per_filter_config = 13;
// 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>`.
repeated core.v3.HeaderValueOption request_headers_to_add = 9
[(validate.rules).repeated = {max_items: 1000}];
// Specifies a list of HTTP headers that should be removed from each request
// matching this route.
repeated string request_headers_to_remove = 12 [(validate.rules).repeated = {
items {string {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}}
}];
// 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>`.
repeated core.v3.HeaderValueOption response_headers_to_add = 10
[(validate.rules).repeated = {max_items: 1000}];
// Specifies a list of HTTP headers that should be removed from each response
// to requests matching this route.
repeated string response_headers_to_remove = 11 [(validate.rules).repeated = {
items {string {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}}
}];
// Presence of the object defines whether the connection manager's tracing configuration
// is overridden by this route specific instance.
Tracing tracing = 15;
// 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.
google.protobuf.UInt32Value per_request_buffer_limit_bytes = 16;
// 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).
string stat_prefix = 19;
}
// Compared to the :ref:`cluster <envoy_v3_api_field_config.route.v3.RouteAction.cluster>` field that specifies a
// single upstream cluster as the target of a request, the :ref:`weighted_clusters
// <envoy_v3_api_field_config.route.v3.RouteAction.weighted_clusters>` option allows for specification of
// multiple upstream clusters along with weights that indicate the percentage of
// traffic to be forwarded to each cluster. The router selects an upstream cluster based on the
// weights.
message WeightedCluster {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.WeightedCluster";
// [#next-free-field: 13]
message ClusterWeight {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.WeightedCluster.ClusterWeight";
reserved 7, 8;
reserved "per_filter_config";
// Only one of ``name`` and ``cluster_header`` may be specified.
// [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}]
// Name of the upstream cluster. The cluster must exist in the
// :ref:`cluster manager configuration <config_cluster_manager>`.
string name = 1 [(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"];
// Only one of ``name`` and ``cluster_header`` may be specified.
// [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1 }]
// Envoy will determine the cluster to route to by reading the value of the
// HTTP header named by cluster_header from the request headers. If the
// header is not found or the referenced cluster does not exist, Envoy will
// return a 404 response.
//
// .. attention::
//
// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1
// ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string cluster_header = 12 [
(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false},
(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"
];
// The weight of the cluster. This value is relative to the other clusters'
// weights. When a request matches the route, the choice of an upstream cluster
// is determined by its weight. The sum of weights across all
// entries in the clusters array must be greater than 0, and must not exceed
// uint32_t maximal value (4294967295).
google.protobuf.UInt32Value weight = 2;
// Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in
// the upstream cluster with metadata matching what is set in this field will be considered for
// load balancing. Note that this will be merged with what's provided in
// :ref:`RouteAction.metadata_match <envoy_v3_api_field_config.route.v3.RouteAction.metadata_match>`, with
// values here taking precedence. The filter name should be specified as ``envoy.lb``.
core.v3.Metadata metadata_match = 3;
// Specifies a list of headers to be added to requests when this cluster is selected
// through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
// Headers specified at this level are applied before headers from the enclosing
// :ref:`envoy_v3_api_msg_config.route.v3.Route`, :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>`.
repeated core.v3.HeaderValueOption request_headers_to_add = 4
[(validate.rules).repeated = {max_items: 1000}];
// Specifies a list of HTTP headers that should be removed from each request when
// this cluster is selected through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
repeated string request_headers_to_remove = 9 [(validate.rules).repeated = {
items {string {well_known_regex: HTTP_HEADER_NAME strict: false}}
}];
// Specifies a list of headers to be added to responses when this cluster is selected
// through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
// Headers specified at this level are applied before headers from the enclosing
// :ref:`envoy_v3_api_msg_config.route.v3.Route`, :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>`.
repeated core.v3.HeaderValueOption response_headers_to_add = 5
[(validate.rules).repeated = {max_items: 1000}];
// Specifies a list of headers to be removed from responses when this cluster is selected
// through the enclosing :ref:`envoy_v3_api_msg_config.route.v3.RouteAction`.
repeated string response_headers_to_remove = 6 [(validate.rules).repeated = {
items {string {well_known_regex: HTTP_HEADER_NAME strict: false}}
}];
// This field can be used to provide weighted cluster 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.]
map<string, google.protobuf.Any> typed_per_filter_config = 10;
oneof host_rewrite_specifier {
// Indicates that during forwarding, the host header will be swapped with
// this value.
string host_rewrite_literal = 11
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
}
}
// Specifies one or more upstream clusters associated with the route.
repeated ClusterWeight clusters = 1 [(validate.rules).repeated = {min_items: 1}];
// Specifies the total weight across all clusters. The sum of all cluster weights must equal this
// value, if this is greater than 0.
// This field is now deprecated, and the client will use the sum of all
// cluster weights. It is up to the management server to supply the correct weights.
google.protobuf.UInt32Value total_weight = 3
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
// Specifies the runtime key prefix that should be used to construct the
// runtime keys associated with each cluster. When the ``runtime_key_prefix`` is
// specified, the router will look for weights associated with each upstream
// cluster under the key ``runtime_key_prefix`` + ``.`` + ``cluster[i].name`` where
// ``cluster[i]`` denotes an entry in the clusters array field. If the runtime
// key for the cluster does not exist, the value specified in the
// configuration file will be used as the default weight. See the :ref:`runtime documentation
// <operations_runtime>` for how key names map to the underlying implementation.
string runtime_key_prefix = 2;
oneof random_value_specifier {
// Specifies the header name that is used to look up the random value passed in the request header.
// This is used to ensure consistent cluster picking across multiple proxy levels for weighted traffic.
// If header is not present or invalid, Envoy will fall back to use the internally generated random value.
// This header is expected to be single-valued header as we only want to have one selected value throughout
// the process for the consistency. And the value is a unsigned number between 0 and UINT64_MAX.
string header_name = 4
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
}
}
// Configuration for a cluster specifier plugin.
message ClusterSpecifierPlugin {
// The name of the plugin and its opaque configuration.
core.v3.TypedExtensionConfig extension = 1 [(validate.rules).message = {required: true}];
// If is_optional is not set or is set to false and the plugin defined by this message is not a
// supported type, the containing resource is NACKed. If is_optional is set to true, the resource
// would not be NACKed for this reason. In this case, routes referencing this plugin's name would
// not be treated as an illegal configuration, but would result in a failure if the route is
// selected.
bool is_optional = 2;
}
// [#next-free-field: 16]
message RouteMatch {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RouteMatch";
message GrpcRouteMatchOptions {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteMatch.GrpcRouteMatchOptions";
}
message TlsContextMatchOptions {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteMatch.TlsContextMatchOptions";
// If specified, the route will match against whether or not a certificate is presented.
// If not specified, certificate presentation status (true or false) will not be considered when route matching.
google.protobuf.BoolValue presented = 1;
// If specified, the route will match against whether or not a certificate is validated.
// If not specified, certificate validation status (true or false) will not be considered when route matching.
//
// .. warning::
//
// Client certificate validation is not currently performed upon TLS session resumption. For
// a resumed TLS session the route will match only when ``validated`` is false, regardless of
// whether the client TLS certificate is valid.
//
// The only known workaround for this issue is to disable TLS session resumption entirely, by
// setting both :ref:`disable_stateless_session_resumption <envoy_v3_api_field_extensions.transport_sockets.tls.v3.DownstreamTlsContext.disable_stateless_session_resumption>`
// and :ref:`disable_stateful_session_resumption <envoy_v3_api_field_extensions.transport_sockets.tls.v3.DownstreamTlsContext.disable_stateful_session_resumption>` on the DownstreamTlsContext.
google.protobuf.BoolValue validated = 2;
}
// An extensible message for matching CONNECT or CONNECT-UDP requests.
message ConnectMatcher {
}
reserved 5, 3;
reserved "regex";
oneof path_specifier {
option (validate.required) = true;
// If specified, the route is a prefix rule meaning that the prefix must
// match the beginning of the ``:path`` header.
string prefix = 1;
// If specified, the route is an exact path rule meaning that the path must
// exactly match the ``:path`` header once the query string is removed.
string path = 2;
// If specified, the route is a regular expression rule meaning that the
// regex must match the ``:path`` header once the query string is removed. The entire path
// (without the query string) must match the regex. The rule will not match if only a
// subsequence of the ``:path`` header matches the regex.
//
// [#next-major-version: In the v3 API we should redo how path specification works such
// that we utilize StringMatcher, and additionally have consistent options around whether we
// strip query strings, do a case sensitive match, etc. In the interim it will be too disruptive
// to deprecate the existing options. We should even consider whether we want to do away with
// path_specifier entirely and just rely on a set of header matchers which can already match
// on :path, etc. The issue with that is it is unclear how to generically deal with query string
// stripping. This needs more thought.]
type.matcher.v3.RegexMatcher safe_regex = 10 [(validate.rules).message = {required: true}];
// If this is used as the matcher, the matcher will only match CONNECT or CONNECT-UDP requests.
// Note that this will not match other Extended CONNECT requests (WebSocket and the like) as
// they are normalized in Envoy as HTTP/1.1 style upgrades.
// This is the only way to match CONNECT requests for HTTP/1.1. For HTTP/2 and HTTP/3,
// where Extended CONNECT requests may have a path, the path matchers will work if
// there is a path present.
// Note that CONNECT support is currently considered alpha in Envoy.
// [#comment: TODO(htuch): Replace the above comment with an alpha tag.]
ConnectMatcher connect_matcher = 12;
// If specified, the route is a path-separated prefix rule meaning that the
// ``:path`` header (without the query string) must either exactly match the
// ``path_separated_prefix`` or have it as a prefix, followed by ``/``
//
// For example, ``/api/dev`` would match
// ``/api/dev``, ``/api/dev/``, ``/api/dev/v1``, and ``/api/dev?param=true``
// but would not match ``/api/developer``
//
// Expect the value to not contain ``?`` or ``#`` and not to end in ``/``
string path_separated_prefix = 14 [(validate.rules).string = {pattern: "^[^?#]+[^?#/]$"}];
// [#extension-category: envoy.path.match]
core.v3.TypedExtensionConfig path_match_policy = 15;
}
// Indicates that prefix/path matching should be case sensitive. The default
// is true. Ignored for safe_regex matching.
google.protobuf.BoolValue case_sensitive = 4;
// Indicates that the route should additionally match on a runtime key. Every time the route
// is considered for a match, it must also fall under the percentage of matches indicated by
// this field. For some fraction N/D, a random number in the range [0,D) is selected. If the
// number is <= the value of the numerator N, or if the key is not present, the default
// value, the router continues to evaluate the remaining match criteria. A runtime_fraction
// route configuration can be used to roll out route changes in a gradual manner without full
// code/config deploys. Refer to the :ref:`traffic shifting
// <config_http_conn_man_route_table_traffic_splitting_shift>` docs for additional documentation.
//
// .. note::
//
// Parsing this field is implemented such that the runtime key's data may be represented
// as a FractionalPercent proto represented as JSON/YAML and may also be represented as an
// integer with the assumption that the value is an integral percentage out of 100. For
// instance, a runtime key lookup returning the value "42" would parse as a FractionalPercent
// whose numerator is 42 and denominator is HUNDRED. This preserves legacy semantics.
core.v3.RuntimeFractionalPercent runtime_fraction = 9;
// Specifies a set of headers that the route should match on. The router will
// check the request’s headers against all the specified headers in the route
// config. A match will happen if all the headers in the route are present in
// the request with the same values (or based on presence if the value field
// is not in the config).
repeated HeaderMatcher headers = 6;
// Specifies a set of URL query parameters on which the route should
// match. The router will check the query string from the ``path`` header
// against all the specified query parameters. If the number of specified
// query parameters is nonzero, they all must match the ``path`` header's
// query string for a match to occur. In the event query parameters are
// repeated, only the first value for each key will be considered.
//
// .. note::
//
// If query parameters are used to pass request message fields when
// `grpc_json_transcoder <https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_json_transcoder_filter>`_
// is used, the transcoded message fields maybe different. The query parameters are
// url encoded, but the message fields are not. For example, if a query
// parameter is "foo%20bar", the message field will be "foo bar".
repeated QueryParameterMatcher query_parameters = 7;
// If specified, only gRPC requests will be matched. The router will check
// that the content-type header has a application/grpc or one of the various
// application/grpc+ values.
GrpcRouteMatchOptions grpc = 8;
// If specified, the client tls context will be matched against the defined
// match options.
//
// [#next-major-version: unify with RBAC]
TlsContextMatchOptions tls_context = 11;
// Specifies a set of dynamic metadata matchers on which the route should match.
// The router will check the dynamic metadata against all the specified dynamic metadata matchers.
// If the number of specified dynamic metadata matchers is nonzero, they all must match the
// dynamic metadata for a match to occur.
repeated type.matcher.v3.MetadataMatcher dynamic_metadata = 13;
}
// Cors policy configuration.
//
// .. attention::
//
// This message has been deprecated. Please use
// :ref:`CorsPolicy in filter extension <envoy_v3_api_msg_extensions.filters.http.cors.v3.CorsPolicy>`
// as as alternative.
//
// [#next-free-field: 14]
message CorsPolicy {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.CorsPolicy";
reserved 1, 8, 7;
reserved "allow_origin", "allow_origin_regex", "enabled";
// Specifies string patterns that match allowed origins. An origin is allowed if any of the
// string matchers match.
repeated type.matcher.v3.StringMatcher allow_origin_string_match = 11;
// Specifies the content for the ``access-control-allow-methods`` header.
string allow_methods = 2;
// Specifies the content for the ``access-control-allow-headers`` header.
string allow_headers = 3;
// Specifies the content for the ``access-control-expose-headers`` header.
string expose_headers = 4;
// Specifies the content for the ``access-control-max-age`` header.
string max_age = 5;
// Specifies whether the resource allows credentials.
google.protobuf.BoolValue allow_credentials = 6;
oneof enabled_specifier {
// Specifies the % of requests for which the CORS filter is enabled.
//
// If neither ``enabled``, ``filter_enabled``, nor ``shadow_enabled`` are specified, the CORS
// filter will be enabled for 100% of the requests.
//
// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is
// specified, Envoy will lookup the runtime key to get the percentage of requests to filter.
core.v3.RuntimeFractionalPercent filter_enabled = 9;
}
// Specifies the % of requests for which the CORS policies will be evaluated and tracked, but not
// enforced.
//
// This field is intended to be used when ``filter_enabled`` and ``enabled`` are off. One of those
// fields have to explicitly disable the filter in order for this setting to take effect.
//
// If :ref:`runtime_key <envoy_v3_api_field_config.core.v3.RuntimeFractionalPercent.runtime_key>` is specified,
// Envoy will lookup the runtime key to get the percentage of requests for which it will evaluate
// and track the request's ``Origin`` to determine if it's valid but will not enforce any policies.
core.v3.RuntimeFractionalPercent shadow_enabled = 10;
// Specify whether allow requests whose target server's IP address is more private than that from
// which the request initiator was fetched.
//
// More details refer to https://developer.chrome.com/blog/private-network-access-preflight.
google.protobuf.BoolValue allow_private_network_access = 12;
// Specifies if preflight requests not matching the configured allowed origin should be forwarded
// to the upstream. Default is true.
google.protobuf.BoolValue forward_not_matching_preflights = 13;
}
// [#next-free-field: 42]
message RouteAction {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RouteAction";
enum ClusterNotFoundResponseCode {
// HTTP status code - 503 Service Unavailable.
SERVICE_UNAVAILABLE = 0;
// HTTP status code - 404 Not Found.
NOT_FOUND = 1;
// HTTP status code - 500 Internal Server Error.
INTERNAL_SERVER_ERROR = 2;
}
// Configures :ref:`internal redirect <arch_overview_internal_redirects>` behavior.
// [#next-major-version: remove this definition - it's defined in the InternalRedirectPolicy message.]
enum InternalRedirectAction {
option deprecated = true;
PASS_THROUGH_INTERNAL_REDIRECT = 0;
HANDLE_INTERNAL_REDIRECT = 1;
}
// The router is capable of shadowing traffic from one cluster to another. The current
// implementation is "fire and forget," meaning Envoy will not wait for the shadow cluster to
// respond before returning the response from the primary cluster. All normal statistics are
// collected for the shadow cluster making this feature useful for testing.
//
// During shadowing, the host/authority header is altered such that ``-shadow`` is appended. This is
// useful for logging. For example, ``cluster1`` becomes ``cluster1-shadow``. This behavior can be
// disabled by setting ``disable_shadow_host_suffix_append`` to ``true``.
//
// .. note::
//
// Shadowing will not be triggered if the primary cluster does not exist.
//
// .. note::
//
// Shadowing doesn't support Http CONNECT and upgrades.
// [#next-free-field: 7]
message RequestMirrorPolicy {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.RequestMirrorPolicy";
reserved 2;
reserved "runtime_key";
// Only one of ``cluster`` and ``cluster_header`` can be specified.
// [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}]
// Specifies the cluster that requests will be mirrored to. The cluster must
// exist in the cluster manager configuration.
string cluster = 1 [(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"];
// Only one of ``cluster`` and ``cluster_header`` can be specified.
// Envoy will determine the cluster to route to by reading the value of the
// HTTP header named by cluster_header from the request headers. Only the first value in header is used,
// and no shadow request will happen if the value is not found in headers. Envoy will not wait for
// the shadow cluster to respond before returning the response from the primary cluster.
//
// .. attention::
//
// Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1
// ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead.
//
// .. note::
//
// If the header appears multiple times only the first value is used.
string cluster_header = 5 [
(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false},
(udpa.annotations.field_migrate).oneof_promotion = "cluster_specifier"
];
// If not specified, all requests to the target cluster will be mirrored.
//
// If specified, this field takes precedence over the ``runtime_key`` field and requests must also
// fall under the percentage of matches indicated by this field.
//
// For some fraction N/D, a random number in the range [0,D) is selected. If the
// number is <= the value of the numerator N, or if the key is not present, the default
// value, the request will be mirrored.
core.v3.RuntimeFractionalPercent runtime_fraction = 3;
// Specifies whether the trace span for the shadow request should be sampled. If this field is not explicitly set,
// the shadow request will inherit the sampling decision of its parent span. This ensures consistency with the trace
// sampling policy of the original request and prevents oversampling, especially in scenarios where runtime sampling
// is disabled.
google.protobuf.BoolValue trace_sampled = 4;
// Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header. Defaults to ``false``.
bool disable_shadow_host_suffix_append = 6;
}
// Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer
// <arch_overview_load_balancing_types>`.
// [#next-free-field: 7]
message HashPolicy {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.HashPolicy";
message Header {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.HashPolicy.Header";
// The name of the request header that will be used to obtain the hash
// key. If the request header is not present, no hash will be produced.
string header_name = 1
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];
// If specified, the request header value will be rewritten and used
// to produce the hash key.
type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 2;
}
// CookieAttribute defines an API for adding additional attributes for a HTTP cookie.
message CookieAttribute {
// The name of the cookie attribute.
string name = 1
[(validate.rules).string =
{min_len: 1 max_bytes: 16384 well_known_regex: HTTP_HEADER_NAME strict: false}];
// The optional value of the cookie attribute.
string value = 2 [(validate.rules).string =
{max_bytes: 16384 well_known_regex: HTTP_HEADER_VALUE strict: false}];
}
// Envoy supports two types of cookie affinity:
//
// 1. Passive. Envoy takes a cookie that's present in the cookies header and
// hashes on its value.
//
// 2. Generated. Envoy generates and sets a cookie with an expiration (TTL)
// on the first request from the client in its response to the client,
// based on the endpoint the request gets sent to. The client then
// presents this on the next and all subsequent requests. The hash of
// this is sufficient to ensure these requests get sent to the same
// endpoint. The cookie is generated by hashing the source and
// destination ports and addresses so that multiple independent HTTP2
// streams on the same connection will independently receive the same
// cookie, even if they arrive at the Envoy simultaneously.
message Cookie {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.HashPolicy.Cookie";
// The name of the cookie that will be used to obtain the hash key. If the
// cookie is not present and ttl below is not set, no hash will be
// produced.
string name = 1 [(validate.rules).string = {min_len: 1}];
// If specified, a cookie with the TTL will be generated if the cookie is
// not present. If the TTL is present and zero, the generated cookie will
// be a session cookie.
google.protobuf.Duration ttl = 2;
// The name of the path for the cookie. If no path is specified here, no path
// will be set for the cookie.
string path = 3;
// Additional attributes for the cookie. They will be used when generating a new cookie.
repeated CookieAttribute attributes = 4;
}
message ConnectionProperties {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.HashPolicy.ConnectionProperties";
// Hash on source IP address.
bool source_ip = 1;
}
message QueryParameter {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.HashPolicy.QueryParameter";
// The name of the URL query parameter that will be used to obtain the hash
// key. If the parameter is not present, no hash will be produced. Query
// parameter names are case-sensitive. If query parameters are repeated, only
// the first value will be considered.
string name = 1 [(validate.rules).string = {min_len: 1}];
}
message FilterState {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.HashPolicy.FilterState";
// The name of the Object in the per-request filterState, which is an
// Envoy::Hashable object. If there is no data associated with the key,
// or the stored object is not Envoy::Hashable, no hash will be produced.
string key = 1 [(validate.rules).string = {min_len: 1}];
}
oneof policy_specifier {
option (validate.required) = true;
// Header hash policy.
Header header = 1;
// Cookie hash policy.
Cookie cookie = 2;
// Connection properties hash policy.
ConnectionProperties connection_properties = 3;
// Query parameter hash policy.
QueryParameter query_parameter = 5;
// Filter state hash policy.
FilterState filter_state = 6;
}
// The flag that short-circuits the hash computing. This field provides a
// 'fallback' style of configuration: "if a terminal policy doesn't work,
// fallback to rest of the policy list", it saves time when the terminal
// policy works.
//
// If true, and there is already a hash computed, ignore rest of the
// list of hash polices.
// For example, if the following hash methods are configured:
//
// ========= ========
// specifier terminal
// ========= ========
// Header A true
// Header B false
// Header C false
// ========= ========
//
// The generateHash process ends if policy "header A" generates a hash, as
// it's a terminal policy.
bool terminal = 4;
}
// Allows enabling and disabling upgrades on a per-route basis.
// This overrides any enabled/disabled upgrade filter chain specified in the
// HttpConnectionManager
// :ref:`upgrade_configs
// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.upgrade_configs>`
// but does not affect any custom filter chain specified there.
message UpgradeConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.route.RouteAction.UpgradeConfig";
// Configuration for sending data upstream as a raw data payload. This is used for
// CONNECT or POST requests, when forwarding request payload as raw TCP.
message ConnectConfig {
// If present, the proxy protocol header will be prepended to the CONNECT payload sent upstream.
core.v3.ProxyProtocolConfig proxy_protocol_config = 1;
// If set, the route will also allow forwarding POST payload as raw TCP.
bool allow_post = 2;
}
// The case-insensitive name of this upgrade, e.g. "websocket".
// For each upgrade type present in upgrade_configs, requests with
// Upgrade: [upgrade_type] will be proxied upstream.
string upgrade_type = 1
[(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_VALUE strict: false}];
// Determines if upgrades are available on this route. Defaults to true.
google.protobuf.BoolValue enabled = 2;
// Configuration for sending data upstream as a raw data payload. This is used for
// CONNECT requests, when forwarding CONNECT payload as raw TCP.
// Note that CONNECT support is currently considered alpha in Envoy.
// [#comment: TODO(htuch): Replace the above comment with an alpha tag.]
ConnectConfig connect_config = 3;