-
Notifications
You must be signed in to change notification settings - Fork 683
/
rate_limit.pb.go
1857 lines (1663 loc) · 87.3 KB
/
rate_limit.pb.go
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
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.19.4
// source: envoy/extensions/filters/http/ratelimit/v3/rate_limit.proto
package ratelimitv3
import (
_ "github.com/cncf/xds/go/udpa/annotations"
v32 "github.com/emissary-ingress/emissary/v3/pkg/api/envoy/config/core/v3"
v3 "github.com/emissary-ingress/emissary/v3/pkg/api/envoy/config/ratelimit/v3"
v33 "github.com/emissary-ingress/emissary/v3/pkg/api/envoy/config/route/v3"
v34 "github.com/emissary-ingress/emissary/v3/pkg/api/envoy/type/metadata/v3"
v31 "github.com/emissary-ingress/emissary/v3/pkg/api/envoy/type/v3"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
duration "github.com/golang/protobuf/ptypes/duration"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Defines the version of the standard to use for X-RateLimit headers.
//
// [#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.XRateLimitHeadersRFCVersion instead.]
type RateLimit_XRateLimitHeadersRFCVersion int32
const (
// X-RateLimit headers disabled.
RateLimit_OFF RateLimit_XRateLimitHeadersRFCVersion = 0
// Use `draft RFC Version 03 <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
RateLimit_DRAFT_VERSION_03 RateLimit_XRateLimitHeadersRFCVersion = 1
)
// Enum value maps for RateLimit_XRateLimitHeadersRFCVersion.
var (
RateLimit_XRateLimitHeadersRFCVersion_name = map[int32]string{
0: "OFF",
1: "DRAFT_VERSION_03",
}
RateLimit_XRateLimitHeadersRFCVersion_value = map[string]int32{
"OFF": 0,
"DRAFT_VERSION_03": 1,
}
)
func (x RateLimit_XRateLimitHeadersRFCVersion) Enum() *RateLimit_XRateLimitHeadersRFCVersion {
p := new(RateLimit_XRateLimitHeadersRFCVersion)
*p = x
return p
}
func (x RateLimit_XRateLimitHeadersRFCVersion) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (RateLimit_XRateLimitHeadersRFCVersion) Descriptor() protoreflect.EnumDescriptor {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_enumTypes[0].Descriptor()
}
func (RateLimit_XRateLimitHeadersRFCVersion) Type() protoreflect.EnumType {
return &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_enumTypes[0]
}
func (x RateLimit_XRateLimitHeadersRFCVersion) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use RateLimit_XRateLimitHeadersRFCVersion.Descriptor instead.
func (RateLimit_XRateLimitHeadersRFCVersion) EnumDescriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{0, 0}
}
type RateLimitConfig_Action_MetaData_Source int32
const (
// Query :ref:`dynamic metadata <well_known_dynamic_metadata>`
RateLimitConfig_Action_MetaData_DYNAMIC RateLimitConfig_Action_MetaData_Source = 0
// Query :ref:`route entry metadata <envoy_v3_api_field_config.route.v3.Route.metadata>`
RateLimitConfig_Action_MetaData_ROUTE_ENTRY RateLimitConfig_Action_MetaData_Source = 1
)
// Enum value maps for RateLimitConfig_Action_MetaData_Source.
var (
RateLimitConfig_Action_MetaData_Source_name = map[int32]string{
0: "DYNAMIC",
1: "ROUTE_ENTRY",
}
RateLimitConfig_Action_MetaData_Source_value = map[string]int32{
"DYNAMIC": 0,
"ROUTE_ENTRY": 1,
}
)
func (x RateLimitConfig_Action_MetaData_Source) Enum() *RateLimitConfig_Action_MetaData_Source {
p := new(RateLimitConfig_Action_MetaData_Source)
*p = x
return p
}
func (x RateLimitConfig_Action_MetaData_Source) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (RateLimitConfig_Action_MetaData_Source) Descriptor() protoreflect.EnumDescriptor {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_enumTypes[1].Descriptor()
}
func (RateLimitConfig_Action_MetaData_Source) Type() protoreflect.EnumType {
return &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_enumTypes[1]
}
func (x RateLimitConfig_Action_MetaData_Source) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use RateLimitConfig_Action_MetaData_Source.Descriptor instead.
func (RateLimitConfig_Action_MetaData_Source) EnumDescriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{1, 0, 6, 0}
}
type RateLimitPerRoute_VhRateLimitsOptions int32
const (
// Use the virtual host rate limits unless the route has a rate limit policy.
RateLimitPerRoute_OVERRIDE RateLimitPerRoute_VhRateLimitsOptions = 0
// Use the virtual host rate limits even if the route has a rate limit policy.
RateLimitPerRoute_INCLUDE RateLimitPerRoute_VhRateLimitsOptions = 1
// Ignore the virtual host rate limits even if the route does not have a rate limit policy.
RateLimitPerRoute_IGNORE RateLimitPerRoute_VhRateLimitsOptions = 2
)
// Enum value maps for RateLimitPerRoute_VhRateLimitsOptions.
var (
RateLimitPerRoute_VhRateLimitsOptions_name = map[int32]string{
0: "OVERRIDE",
1: "INCLUDE",
2: "IGNORE",
}
RateLimitPerRoute_VhRateLimitsOptions_value = map[string]int32{
"OVERRIDE": 0,
"INCLUDE": 1,
"IGNORE": 2,
}
)
func (x RateLimitPerRoute_VhRateLimitsOptions) Enum() *RateLimitPerRoute_VhRateLimitsOptions {
p := new(RateLimitPerRoute_VhRateLimitsOptions)
*p = x
return p
}
func (x RateLimitPerRoute_VhRateLimitsOptions) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (RateLimitPerRoute_VhRateLimitsOptions) Descriptor() protoreflect.EnumDescriptor {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_enumTypes[2].Descriptor()
}
func (RateLimitPerRoute_VhRateLimitsOptions) Type() protoreflect.EnumType {
return &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_enumTypes[2]
}
func (x RateLimitPerRoute_VhRateLimitsOptions) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use RateLimitPerRoute_VhRateLimitsOptions.Descriptor instead.
func (RateLimitPerRoute_VhRateLimitsOptions) EnumDescriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{2, 0}
}
// The override option determines how the filter handles the cases where there is an override config at a more specific level than this one (from least to most specific: virtual host, route, cluster weight).
// [#not-implemented-hide:]
type RateLimitPerRoute_OverrideOptions int32
const (
// Client-defined default, typically OVERRIDE_POLICY. If VhRateLimitsOptions is set, that will be used instead.
RateLimitPerRoute_DEFAULT RateLimitPerRoute_OverrideOptions = 0
// If there is an override config at a more specific level, use that instead of this one.
RateLimitPerRoute_OVERRIDE_POLICY RateLimitPerRoute_OverrideOptions = 1
// If there is an override config at a more specific level, use data from both.
RateLimitPerRoute_INCLUDE_POLICY RateLimitPerRoute_OverrideOptions = 2
// If there is an override config at a more specific level, ignore it and use only this one.
RateLimitPerRoute_IGNORE_POLICY RateLimitPerRoute_OverrideOptions = 3
)
// Enum value maps for RateLimitPerRoute_OverrideOptions.
var (
RateLimitPerRoute_OverrideOptions_name = map[int32]string{
0: "DEFAULT",
1: "OVERRIDE_POLICY",
2: "INCLUDE_POLICY",
3: "IGNORE_POLICY",
}
RateLimitPerRoute_OverrideOptions_value = map[string]int32{
"DEFAULT": 0,
"OVERRIDE_POLICY": 1,
"INCLUDE_POLICY": 2,
"IGNORE_POLICY": 3,
}
)
func (x RateLimitPerRoute_OverrideOptions) Enum() *RateLimitPerRoute_OverrideOptions {
p := new(RateLimitPerRoute_OverrideOptions)
*p = x
return p
}
func (x RateLimitPerRoute_OverrideOptions) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (RateLimitPerRoute_OverrideOptions) Descriptor() protoreflect.EnumDescriptor {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_enumTypes[3].Descriptor()
}
func (RateLimitPerRoute_OverrideOptions) Type() protoreflect.EnumType {
return &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_enumTypes[3]
}
func (x RateLimitPerRoute_OverrideOptions) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use RateLimitPerRoute_OverrideOptions.Descriptor instead.
func (RateLimitPerRoute_OverrideOptions) EnumDescriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{2, 1}
}
// [#next-free-field: 11]
type RateLimit struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The rate limit domain to use when calling the rate limit service.
Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
// Specifies the rate limit configurations to be applied with the same
// stage number. If not set, the default stage number is 0.
//
// .. note::
//
// The filter supports a range of 0 - 10 inclusively for stage numbers.
Stage uint32 `protobuf:"varint,2,opt,name=stage,proto3" json:"stage,omitempty"`
// The type of requests the filter should apply to. The supported
// types are ``internal``, ``external`` or ``both``. A request is considered internal if
// :ref:`x-envoy-internal<config_http_conn_man_headers_x-envoy-internal>` is set to true. If
// :ref:`x-envoy-internal<config_http_conn_man_headers_x-envoy-internal>` is not set or false, a
// request is considered external. The filter defaults to ``both``, and it will apply to all request
// types.
RequestType string `protobuf:"bytes,3,opt,name=request_type,json=requestType,proto3" json:"request_type,omitempty"`
// The timeout in milliseconds for the rate limit service RPC. If not
// set, this defaults to 20ms.
Timeout *duration.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"`
// The filter's behaviour in case the rate limiting service does
// not respond back. When it is set to true, Envoy will not allow traffic in case of
// communication failure between rate limiting service and the proxy.
FailureModeDeny bool `protobuf:"varint,5,opt,name=failure_mode_deny,json=failureModeDeny,proto3" json:"failure_mode_deny,omitempty"`
// Specifies whether a ``RESOURCE_EXHAUSTED`` gRPC code must be returned instead
// of the default ``UNAVAILABLE`` gRPC code for a rate limited gRPC call. The
// HTTP code will be 200 for a gRPC response.
RateLimitedAsResourceExhausted bool `protobuf:"varint,6,opt,name=rate_limited_as_resource_exhausted,json=rateLimitedAsResourceExhausted,proto3" json:"rate_limited_as_resource_exhausted,omitempty"`
// Configuration for an external rate limit service provider. If not
// specified, any calls to the rate limit service will immediately return
// success.
RateLimitService *v3.RateLimitServiceConfig `protobuf:"bytes,7,opt,name=rate_limit_service,json=rateLimitService,proto3" json:"rate_limit_service,omitempty"`
// Defines the standard version to use for X-RateLimit headers emitted by the filter:
//
// * ``X-RateLimit-Limit`` - indicates the request-quota associated to the
// client in the current time-window followed by the description of the
// quota policy. The values are returned by the rate limiting service in
// :ref:`current_limit<envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.DescriptorStatus.current_limit>`
// field. Example: ``10, 10;w=1;name="per-ip", 1000;w=3600``.
// * ``X-RateLimit-Remaining`` - indicates the remaining requests in the
// current time-window. The values are returned by the rate limiting service
// in :ref:`limit_remaining<envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.DescriptorStatus.limit_remaining>`
// field.
// * ``X-RateLimit-Reset`` - indicates the number of seconds until reset of
// the current time-window. The values are returned by the rate limiting service
// in :ref:`duration_until_reset<envoy_v3_api_field_service.ratelimit.v3.RateLimitResponse.DescriptorStatus.duration_until_reset>`
// field.
//
// In case rate limiting policy specifies more then one time window, the values
// above represent the window that is closest to reaching its limit.
//
// For more information about the headers specification see selected version of
// the `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
//
// Disabled by default.
//
// [#next-major-version: unify with local ratelimit, should use common.ratelimit.v3.XRateLimitHeadersRFCVersion instead.]
EnableXRatelimitHeaders RateLimit_XRateLimitHeadersRFCVersion `protobuf:"varint,8,opt,name=enable_x_ratelimit_headers,json=enableXRatelimitHeaders,proto3,enum=envoy.extensions.filters.http.ratelimit.v3.RateLimit_XRateLimitHeadersRFCVersion" json:"enable_x_ratelimit_headers,omitempty"`
// Disables emitting the :ref:`x-envoy-ratelimited<config_http_filters_router_x-envoy-ratelimited>` header
// in case of rate limiting (i.e. 429 responses).
// Having this header not present potentially makes the request retriable.
DisableXEnvoyRatelimitedHeader bool `protobuf:"varint,9,opt,name=disable_x_envoy_ratelimited_header,json=disableXEnvoyRatelimitedHeader,proto3" json:"disable_x_envoy_ratelimited_header,omitempty"`
// This field allows for a custom HTTP response status code to the downstream client when
// the request has been rate limited.
// Defaults to 429 (TooManyRequests).
//
// .. note::
// If this is set to < 400, 429 will be used instead.
RateLimitedStatus *v31.HttpStatus `protobuf:"bytes,10,opt,name=rate_limited_status,json=rateLimitedStatus,proto3" json:"rate_limited_status,omitempty"`
}
func (x *RateLimit) Reset() {
*x = RateLimit{}
if protoimpl.UnsafeEnabled {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RateLimit) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RateLimit) ProtoMessage() {}
func (x *RateLimit) ProtoReflect() protoreflect.Message {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RateLimit.ProtoReflect.Descriptor instead.
func (*RateLimit) Descriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{0}
}
func (x *RateLimit) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
func (x *RateLimit) GetStage() uint32 {
if x != nil {
return x.Stage
}
return 0
}
func (x *RateLimit) GetRequestType() string {
if x != nil {
return x.RequestType
}
return ""
}
func (x *RateLimit) GetTimeout() *duration.Duration {
if x != nil {
return x.Timeout
}
return nil
}
func (x *RateLimit) GetFailureModeDeny() bool {
if x != nil {
return x.FailureModeDeny
}
return false
}
func (x *RateLimit) GetRateLimitedAsResourceExhausted() bool {
if x != nil {
return x.RateLimitedAsResourceExhausted
}
return false
}
func (x *RateLimit) GetRateLimitService() *v3.RateLimitServiceConfig {
if x != nil {
return x.RateLimitService
}
return nil
}
func (x *RateLimit) GetEnableXRatelimitHeaders() RateLimit_XRateLimitHeadersRFCVersion {
if x != nil {
return x.EnableXRatelimitHeaders
}
return RateLimit_OFF
}
func (x *RateLimit) GetDisableXEnvoyRatelimitedHeader() bool {
if x != nil {
return x.DisableXEnvoyRatelimitedHeader
}
return false
}
func (x *RateLimit) GetRateLimitedStatus() *v31.HttpStatus {
if x != nil {
return x.RateLimitedStatus
}
return nil
}
// Global rate limiting :ref:`architecture overview <arch_overview_global_rate_limit>`.
// Also applies to Local rate limiting :ref:`using descriptors <config_http_filters_local_rate_limit_descriptors>`.
// [#not-implemented-hide:]
type RateLimitConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Refers to the stage set in the filter. The rate limit configuration only
// applies to filters with the same stage number. The default stage number is
// 0.
//
// .. note::
//
// The filter supports a range of 0 - 10 inclusively for stage numbers.
Stage uint32 `protobuf:"varint,1,opt,name=stage,proto3" json:"stage,omitempty"`
// The key to be set in runtime to disable this rate limit configuration.
DisableKey string `protobuf:"bytes,2,opt,name=disable_key,json=disableKey,proto3" json:"disable_key,omitempty"`
// A list of actions that are to be applied for this rate limit configuration.
// Order matters as the actions are processed sequentially and the descriptor
// is composed by appending descriptor entries in that sequence. If an action
// cannot append a descriptor entry, no descriptor is generated for the
// configuration. See :ref:`composing actions
// <config_http_filters_rate_limit_composing_actions>` for additional documentation.
Actions []*RateLimitConfig_Action `protobuf:"bytes,3,rep,name=actions,proto3" json:"actions,omitempty"`
// An optional limit override to be appended to the descriptor produced by this
// rate limit configuration. If the override value is invalid or cannot be resolved
// from metadata, no override is provided. See :ref:`rate limit override
// <config_http_filters_rate_limit_rate_limit_override>` for more information.
Limit *RateLimitConfig_Override `protobuf:"bytes,4,opt,name=limit,proto3" json:"limit,omitempty"`
}
func (x *RateLimitConfig) Reset() {
*x = RateLimitConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RateLimitConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RateLimitConfig) ProtoMessage() {}
func (x *RateLimitConfig) ProtoReflect() protoreflect.Message {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RateLimitConfig.ProtoReflect.Descriptor instead.
func (*RateLimitConfig) Descriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{1}
}
func (x *RateLimitConfig) GetStage() uint32 {
if x != nil {
return x.Stage
}
return 0
}
func (x *RateLimitConfig) GetDisableKey() string {
if x != nil {
return x.DisableKey
}
return ""
}
func (x *RateLimitConfig) GetActions() []*RateLimitConfig_Action {
if x != nil {
return x.Actions
}
return nil
}
func (x *RateLimitConfig) GetLimit() *RateLimitConfig_Override {
if x != nil {
return x.Limit
}
return nil
}
type RateLimitPerRoute struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Specifies if the rate limit filter should include the virtual host rate limits.
VhRateLimits RateLimitPerRoute_VhRateLimitsOptions `protobuf:"varint,1,opt,name=vh_rate_limits,json=vhRateLimits,proto3,enum=envoy.extensions.filters.http.ratelimit.v3.RateLimitPerRoute_VhRateLimitsOptions" json:"vh_rate_limits,omitempty"`
// Specifies if the rate limit filter should include the lower levels (route level, virtual host level or cluster weight level) rate limits override options.
// [#not-implemented-hide:]
OverrideOption RateLimitPerRoute_OverrideOptions `protobuf:"varint,2,opt,name=override_option,json=overrideOption,proto3,enum=envoy.extensions.filters.http.ratelimit.v3.RateLimitPerRoute_OverrideOptions" json:"override_option,omitempty"`
// Rate limit configuration. If not set, uses the
// :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
// :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields instead.
// [#not-implemented-hide:]
RateLimits []*RateLimitConfig `protobuf:"bytes,3,rep,name=rate_limits,json=rateLimits,proto3" json:"rate_limits,omitempty"`
}
func (x *RateLimitPerRoute) Reset() {
*x = RateLimitPerRoute{}
if protoimpl.UnsafeEnabled {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RateLimitPerRoute) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RateLimitPerRoute) ProtoMessage() {}
func (x *RateLimitPerRoute) ProtoReflect() protoreflect.Message {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RateLimitPerRoute.ProtoReflect.Descriptor instead.
func (*RateLimitPerRoute) Descriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{2}
}
func (x *RateLimitPerRoute) GetVhRateLimits() RateLimitPerRoute_VhRateLimitsOptions {
if x != nil {
return x.VhRateLimits
}
return RateLimitPerRoute_OVERRIDE
}
func (x *RateLimitPerRoute) GetOverrideOption() RateLimitPerRoute_OverrideOptions {
if x != nil {
return x.OverrideOption
}
return RateLimitPerRoute_DEFAULT
}
func (x *RateLimitPerRoute) GetRateLimits() []*RateLimitConfig {
if x != nil {
return x.RateLimits
}
return nil
}
// [#next-free-field: 10]
type RateLimitConfig_Action struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to ActionSpecifier:
// *RateLimitConfig_Action_SourceCluster_
// *RateLimitConfig_Action_DestinationCluster_
// *RateLimitConfig_Action_RequestHeaders_
// *RateLimitConfig_Action_RemoteAddress_
// *RateLimitConfig_Action_GenericKey_
// *RateLimitConfig_Action_HeaderValueMatch_
// *RateLimitConfig_Action_Metadata
// *RateLimitConfig_Action_Extension
ActionSpecifier isRateLimitConfig_Action_ActionSpecifier `protobuf_oneof:"action_specifier"`
}
func (x *RateLimitConfig_Action) Reset() {
*x = RateLimitConfig_Action{}
if protoimpl.UnsafeEnabled {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RateLimitConfig_Action) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RateLimitConfig_Action) ProtoMessage() {}
func (x *RateLimitConfig_Action) ProtoReflect() protoreflect.Message {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RateLimitConfig_Action.ProtoReflect.Descriptor instead.
func (*RateLimitConfig_Action) Descriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{1, 0}
}
func (m *RateLimitConfig_Action) GetActionSpecifier() isRateLimitConfig_Action_ActionSpecifier {
if m != nil {
return m.ActionSpecifier
}
return nil
}
func (x *RateLimitConfig_Action) GetSourceCluster() *RateLimitConfig_Action_SourceCluster {
if x, ok := x.GetActionSpecifier().(*RateLimitConfig_Action_SourceCluster_); ok {
return x.SourceCluster
}
return nil
}
func (x *RateLimitConfig_Action) GetDestinationCluster() *RateLimitConfig_Action_DestinationCluster {
if x, ok := x.GetActionSpecifier().(*RateLimitConfig_Action_DestinationCluster_); ok {
return x.DestinationCluster
}
return nil
}
func (x *RateLimitConfig_Action) GetRequestHeaders() *RateLimitConfig_Action_RequestHeaders {
if x, ok := x.GetActionSpecifier().(*RateLimitConfig_Action_RequestHeaders_); ok {
return x.RequestHeaders
}
return nil
}
func (x *RateLimitConfig_Action) GetRemoteAddress() *RateLimitConfig_Action_RemoteAddress {
if x, ok := x.GetActionSpecifier().(*RateLimitConfig_Action_RemoteAddress_); ok {
return x.RemoteAddress
}
return nil
}
func (x *RateLimitConfig_Action) GetGenericKey() *RateLimitConfig_Action_GenericKey {
if x, ok := x.GetActionSpecifier().(*RateLimitConfig_Action_GenericKey_); ok {
return x.GenericKey
}
return nil
}
func (x *RateLimitConfig_Action) GetHeaderValueMatch() *RateLimitConfig_Action_HeaderValueMatch {
if x, ok := x.GetActionSpecifier().(*RateLimitConfig_Action_HeaderValueMatch_); ok {
return x.HeaderValueMatch
}
return nil
}
func (x *RateLimitConfig_Action) GetMetadata() *RateLimitConfig_Action_MetaData {
if x, ok := x.GetActionSpecifier().(*RateLimitConfig_Action_Metadata); ok {
return x.Metadata
}
return nil
}
func (x *RateLimitConfig_Action) GetExtension() *v32.TypedExtensionConfig {
if x, ok := x.GetActionSpecifier().(*RateLimitConfig_Action_Extension); ok {
return x.Extension
}
return nil
}
type isRateLimitConfig_Action_ActionSpecifier interface {
isRateLimitConfig_Action_ActionSpecifier()
}
type RateLimitConfig_Action_SourceCluster_ struct {
// Rate limit on source cluster.
SourceCluster *RateLimitConfig_Action_SourceCluster `protobuf:"bytes,1,opt,name=source_cluster,json=sourceCluster,proto3,oneof"`
}
type RateLimitConfig_Action_DestinationCluster_ struct {
// Rate limit on destination cluster.
DestinationCluster *RateLimitConfig_Action_DestinationCluster `protobuf:"bytes,2,opt,name=destination_cluster,json=destinationCluster,proto3,oneof"`
}
type RateLimitConfig_Action_RequestHeaders_ struct {
// Rate limit on request headers.
RequestHeaders *RateLimitConfig_Action_RequestHeaders `protobuf:"bytes,3,opt,name=request_headers,json=requestHeaders,proto3,oneof"`
}
type RateLimitConfig_Action_RemoteAddress_ struct {
// Rate limit on remote address.
RemoteAddress *RateLimitConfig_Action_RemoteAddress `protobuf:"bytes,4,opt,name=remote_address,json=remoteAddress,proto3,oneof"`
}
type RateLimitConfig_Action_GenericKey_ struct {
// Rate limit on a generic key.
GenericKey *RateLimitConfig_Action_GenericKey `protobuf:"bytes,5,opt,name=generic_key,json=genericKey,proto3,oneof"`
}
type RateLimitConfig_Action_HeaderValueMatch_ struct {
// Rate limit on the existence of request headers.
HeaderValueMatch *RateLimitConfig_Action_HeaderValueMatch `protobuf:"bytes,6,opt,name=header_value_match,json=headerValueMatch,proto3,oneof"`
}
type RateLimitConfig_Action_Metadata struct {
// Rate limit on metadata.
Metadata *RateLimitConfig_Action_MetaData `protobuf:"bytes,8,opt,name=metadata,proto3,oneof"`
}
type RateLimitConfig_Action_Extension struct {
// Rate limit descriptor extension. See the rate limit descriptor extensions documentation.
// [#extension-category: envoy.rate_limit_descriptors]
Extension *v32.TypedExtensionConfig `protobuf:"bytes,9,opt,name=extension,proto3,oneof"`
}
func (*RateLimitConfig_Action_SourceCluster_) isRateLimitConfig_Action_ActionSpecifier() {}
func (*RateLimitConfig_Action_DestinationCluster_) isRateLimitConfig_Action_ActionSpecifier() {}
func (*RateLimitConfig_Action_RequestHeaders_) isRateLimitConfig_Action_ActionSpecifier() {}
func (*RateLimitConfig_Action_RemoteAddress_) isRateLimitConfig_Action_ActionSpecifier() {}
func (*RateLimitConfig_Action_GenericKey_) isRateLimitConfig_Action_ActionSpecifier() {}
func (*RateLimitConfig_Action_HeaderValueMatch_) isRateLimitConfig_Action_ActionSpecifier() {}
func (*RateLimitConfig_Action_Metadata) isRateLimitConfig_Action_ActionSpecifier() {}
func (*RateLimitConfig_Action_Extension) isRateLimitConfig_Action_ActionSpecifier() {}
type RateLimitConfig_Override struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to OverrideSpecifier:
// *RateLimitConfig_Override_DynamicMetadata_
OverrideSpecifier isRateLimitConfig_Override_OverrideSpecifier `protobuf_oneof:"override_specifier"`
}
func (x *RateLimitConfig_Override) Reset() {
*x = RateLimitConfig_Override{}
if protoimpl.UnsafeEnabled {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RateLimitConfig_Override) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RateLimitConfig_Override) ProtoMessage() {}
func (x *RateLimitConfig_Override) ProtoReflect() protoreflect.Message {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RateLimitConfig_Override.ProtoReflect.Descriptor instead.
func (*RateLimitConfig_Override) Descriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{1, 1}
}
func (m *RateLimitConfig_Override) GetOverrideSpecifier() isRateLimitConfig_Override_OverrideSpecifier {
if m != nil {
return m.OverrideSpecifier
}
return nil
}
func (x *RateLimitConfig_Override) GetDynamicMetadata() *RateLimitConfig_Override_DynamicMetadata {
if x, ok := x.GetOverrideSpecifier().(*RateLimitConfig_Override_DynamicMetadata_); ok {
return x.DynamicMetadata
}
return nil
}
type isRateLimitConfig_Override_OverrideSpecifier interface {
isRateLimitConfig_Override_OverrideSpecifier()
}
type RateLimitConfig_Override_DynamicMetadata_ struct {
// Limit override from dynamic metadata.
DynamicMetadata *RateLimitConfig_Override_DynamicMetadata `protobuf:"bytes,1,opt,name=dynamic_metadata,json=dynamicMetadata,proto3,oneof"`
}
func (*RateLimitConfig_Override_DynamicMetadata_) isRateLimitConfig_Override_OverrideSpecifier() {}
// The following descriptor entry is appended to the descriptor:
//
// .. code-block:: cpp
//
// ("source_cluster", "<local service cluster>")
//
// <local service cluster> is derived from the :option:`--service-cluster` option.
type RateLimitConfig_Action_SourceCluster struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *RateLimitConfig_Action_SourceCluster) Reset() {
*x = RateLimitConfig_Action_SourceCluster{}
if protoimpl.UnsafeEnabled {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RateLimitConfig_Action_SourceCluster) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RateLimitConfig_Action_SourceCluster) ProtoMessage() {}
func (x *RateLimitConfig_Action_SourceCluster) ProtoReflect() protoreflect.Message {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RateLimitConfig_Action_SourceCluster.ProtoReflect.Descriptor instead.
func (*RateLimitConfig_Action_SourceCluster) Descriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{1, 0, 0}
}
// The following descriptor entry is appended to the descriptor:
//
// .. code-block:: cpp
//
// ("destination_cluster", "<routed target cluster>")
//
// Once a request matches against a route table rule, a routed cluster is determined by one of
// the following :ref:`route table configuration <envoy_v3_api_msg_config.route.v3.RouteConfiguration>`
// settings:
//
// - :ref:`cluster <envoy_v3_api_field_config.route.v3.RouteAction.cluster>` indicates the upstream cluster
// to route to.
// - :ref:`weighted_clusters <envoy_v3_api_field_config.route.v3.RouteAction.weighted_clusters>`
// chooses a cluster randomly from a set of clusters with attributed weight.
// - :ref:`cluster_header <envoy_v3_api_field_config.route.v3.RouteAction.cluster_header>` indicates which
// header in the request contains the target cluster.
type RateLimitConfig_Action_DestinationCluster struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *RateLimitConfig_Action_DestinationCluster) Reset() {
*x = RateLimitConfig_Action_DestinationCluster{}
if protoimpl.UnsafeEnabled {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RateLimitConfig_Action_DestinationCluster) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RateLimitConfig_Action_DestinationCluster) ProtoMessage() {}
func (x *RateLimitConfig_Action_DestinationCluster) ProtoReflect() protoreflect.Message {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RateLimitConfig_Action_DestinationCluster.ProtoReflect.Descriptor instead.
func (*RateLimitConfig_Action_DestinationCluster) Descriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{1, 0, 1}
}
// The following descriptor entry is appended when a header contains a key that matches the
// “header_name“:
//
// .. code-block:: cpp
//
// ("<descriptor_key>", "<header_value_queried_from_header>")
type RateLimitConfig_Action_RequestHeaders struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The header name to be queried from the request headers. The header’s
// value is used to populate the value of the descriptor entry for the
// descriptor_key.
HeaderName string `protobuf:"bytes,1,opt,name=header_name,json=headerName,proto3" json:"header_name,omitempty"`
// The key to use in the descriptor entry.
DescriptorKey string `protobuf:"bytes,2,opt,name=descriptor_key,json=descriptorKey,proto3" json:"descriptor_key,omitempty"`
// If set to true, Envoy skips the descriptor while calling rate limiting service
// when header is not present in the request. By default it skips calling the
// rate limiting service if this header is not present in the request.
SkipIfAbsent bool `protobuf:"varint,3,opt,name=skip_if_absent,json=skipIfAbsent,proto3" json:"skip_if_absent,omitempty"`
}
func (x *RateLimitConfig_Action_RequestHeaders) Reset() {
*x = RateLimitConfig_Action_RequestHeaders{}
if protoimpl.UnsafeEnabled {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RateLimitConfig_Action_RequestHeaders) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RateLimitConfig_Action_RequestHeaders) ProtoMessage() {}
func (x *RateLimitConfig_Action_RequestHeaders) ProtoReflect() protoreflect.Message {
mi := &file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RateLimitConfig_Action_RequestHeaders.ProtoReflect.Descriptor instead.
func (*RateLimitConfig_Action_RequestHeaders) Descriptor() ([]byte, []int) {
return file_envoy_extensions_filters_http_ratelimit_v3_rate_limit_proto_rawDescGZIP(), []int{1, 0, 2}
}
func (x *RateLimitConfig_Action_RequestHeaders) GetHeaderName() string {
if x != nil {
return x.HeaderName
}
return ""
}
func (x *RateLimitConfig_Action_RequestHeaders) GetDescriptorKey() string {
if x != nil {
return x.DescriptorKey
}
return ""
}
func (x *RateLimitConfig_Action_RequestHeaders) GetSkipIfAbsent() bool {
if x != nil {
return x.SkipIfAbsent
}
return false
}
// The following descriptor entry is appended to the descriptor and is populated using the
// trusted address from :ref:`x-forwarded-for <config_http_conn_man_headers_x-forwarded-for>`:
//
// .. code-block:: cpp
//