From 2c5d663029e061862c1d28429361dc4f1ae58e04 Mon Sep 17 00:00:00 2001 From: soloio-bot Date: Tue, 13 Feb 2024 20:23:43 +0000 Subject: [PATCH] Sync Gloo APIs. Destination Branch: gloo-v1.14.x --- .../options/ratelimit/ratelimit.proto | 10 + .../options/ratelimit/ratelimit.pb.clone.go | 29 ++ .../options/ratelimit/ratelimit.pb.equal.go | 52 ++++ .../options/ratelimit/ratelimit.pb.go | 286 ++++++++++++------ .../options/ratelimit/ratelimit.pb.hash.go | 46 +++ 5 files changed, 331 insertions(+), 92 deletions(-) diff --git a/api/gloo/gloo/v1/enterprise/options/ratelimit/ratelimit.proto b/api/gloo/gloo/v1/enterprise/options/ratelimit/ratelimit.proto index 58259fcd8..76b87b8cb 100644 --- a/api/gloo/gloo/v1/enterprise/options/ratelimit/ratelimit.proto +++ b/api/gloo/gloo/v1/enterprise/options/ratelimit/ratelimit.proto @@ -32,6 +32,16 @@ message Settings { // Set this is set to true if you would like to rate limit traffic before applying external auth to it. // *Note*: When this is true, you will lose some features like being able to rate limit a request based on its auth state bool rate_limit_before_auth = 9; + + oneof service_type { + // Optional gRPC settings used when calling the ratelimit server. + GrpcService grpc_service = 10; + } +} + +message GrpcService { + // Set the authority header when calling the gRPC service. + string authority = 1; } // API based on Envoy's rate-limit service API. (reference here: https://github.com/lyft/ratelimit#configuration) diff --git a/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.clone.go b/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.clone.go index bd5dd313b..7f0c45a4c 100644 --- a/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.clone.go +++ b/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.clone.go @@ -80,6 +80,35 @@ func (m *Settings) Clone() proto.Message { target.RateLimitBeforeAuth = m.GetRateLimitBeforeAuth() + switch m.ServiceType.(type) { + + case *Settings_GrpcService: + + if h, ok := interface{}(m.GetGrpcService()).(clone.Cloner); ok { + target.ServiceType = &Settings_GrpcService{ + GrpcService: h.Clone().(*GrpcService), + } + } else { + target.ServiceType = &Settings_GrpcService{ + GrpcService: proto.Clone(m.GetGrpcService()).(*GrpcService), + } + } + + } + + return target +} + +// Clone function +func (m *GrpcService) Clone() proto.Message { + var target *GrpcService + if m == nil { + return target + } + target = &GrpcService{} + + target.Authority = m.GetAuthority() + return target } diff --git a/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.equal.go b/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.equal.go index 39dfd3f93..e4e62b2fe 100644 --- a/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.equal.go +++ b/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.equal.go @@ -122,6 +122,58 @@ func (m *Settings) Equal(that interface{}) bool { return false } + switch m.ServiceType.(type) { + + case *Settings_GrpcService: + if _, ok := target.ServiceType.(*Settings_GrpcService); !ok { + return false + } + + if h, ok := interface{}(m.GetGrpcService()).(equality.Equalizer); ok { + if !h.Equal(target.GetGrpcService()) { + return false + } + } else { + if !proto.Equal(m.GetGrpcService(), target.GetGrpcService()) { + return false + } + } + + default: + // m is nil but target is not nil + if m.ServiceType != target.ServiceType { + return false + } + } + + return true +} + +// Equal function +func (m *GrpcService) Equal(that interface{}) bool { + if that == nil { + return m == nil + } + + target, ok := that.(*GrpcService) + if !ok { + that2, ok := that.(GrpcService) + if ok { + target = &that2 + } else { + return false + } + } + if target == nil { + return m == nil + } else if m == nil { + return false + } + + if strings.Compare(m.GetAuthority(), target.GetAuthority()) != 0 { + return false + } + return true } diff --git a/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.go b/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.go index 3bb26820d..60f9caf92 100644 --- a/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.go +++ b/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.go @@ -96,6 +96,10 @@ type Settings struct { // Set this is set to true if you would like to rate limit traffic before applying external auth to it. // *Note*: When this is true, you will lose some features like being able to rate limit a request based on its auth state RateLimitBeforeAuth bool `protobuf:"varint,9,opt,name=rate_limit_before_auth,json=rateLimitBeforeAuth,proto3" json:"rate_limit_before_auth,omitempty"` + // Types that are assignable to ServiceType: + // + // *Settings_GrpcService + ServiceType isSettings_ServiceType `protobuf_oneof:"service_type"` } func (x *Settings) Reset() { @@ -165,6 +169,79 @@ func (x *Settings) GetRateLimitBeforeAuth() bool { return false } +func (m *Settings) GetServiceType() isSettings_ServiceType { + if m != nil { + return m.ServiceType + } + return nil +} + +func (x *Settings) GetGrpcService() *GrpcService { + if x, ok := x.GetServiceType().(*Settings_GrpcService); ok { + return x.GrpcService + } + return nil +} + +type isSettings_ServiceType interface { + isSettings_ServiceType() +} + +type Settings_GrpcService struct { + // Optional gRPC settings used when calling the ratelimit server. + GrpcService *GrpcService `protobuf:"bytes,10,opt,name=grpc_service,json=grpcService,proto3,oneof"` +} + +func (*Settings_GrpcService) isSettings_ServiceType() {} + +type GrpcService struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Set the authority header when calling the gRPC service. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *GrpcService) Reset() { + *x = GrpcService{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrpcService) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrpcService) ProtoMessage() {} + +func (x *GrpcService) ProtoReflect() protoreflect.Message { + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_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 GrpcService.ProtoReflect.Descriptor instead. +func (*GrpcService) Descriptor() ([]byte, []int) { + return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{2} +} + +func (x *GrpcService) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + // API based on Envoy's rate-limit service API. (reference here: https://github.com/lyft/ratelimit#configuration) // Sample configuration below: // @@ -193,7 +270,7 @@ type ServiceSettings struct { func (x *ServiceSettings) Reset() { *x = ServiceSettings{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[2] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -206,7 +283,7 @@ func (x *ServiceSettings) String() string { func (*ServiceSettings) ProtoMessage() {} func (x *ServiceSettings) ProtoReflect() protoreflect.Message { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[2] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -219,7 +296,7 @@ func (x *ServiceSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use ServiceSettings.ProtoReflect.Descriptor instead. func (*ServiceSettings) Descriptor() ([]byte, []int) { - return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{2} + return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{3} } func (x *ServiceSettings) GetDescriptors() []*v1alpha1.Descriptor { @@ -249,7 +326,7 @@ type RateLimitConfigRefs struct { func (x *RateLimitConfigRefs) Reset() { *x = RateLimitConfigRefs{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[3] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -262,7 +339,7 @@ func (x *RateLimitConfigRefs) String() string { func (*RateLimitConfigRefs) ProtoMessage() {} func (x *RateLimitConfigRefs) ProtoReflect() protoreflect.Message { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[3] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -275,7 +352,7 @@ func (x *RateLimitConfigRefs) ProtoReflect() protoreflect.Message { // Deprecated: Use RateLimitConfigRefs.ProtoReflect.Descriptor instead. func (*RateLimitConfigRefs) Descriptor() ([]byte, []int) { - return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{3} + return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{4} } func (x *RateLimitConfigRefs) GetRefs() []*RateLimitConfigRef { @@ -298,7 +375,7 @@ type RateLimitConfigRef struct { func (x *RateLimitConfigRef) Reset() { *x = RateLimitConfigRef{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[4] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -311,7 +388,7 @@ func (x *RateLimitConfigRef) String() string { func (*RateLimitConfigRef) ProtoMessage() {} func (x *RateLimitConfigRef) ProtoReflect() protoreflect.Message { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[4] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -324,7 +401,7 @@ func (x *RateLimitConfigRef) ProtoReflect() protoreflect.Message { // Deprecated: Use RateLimitConfigRef.ProtoReflect.Descriptor instead. func (*RateLimitConfigRef) Descriptor() ([]byte, []int) { - return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{4} + return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{5} } func (x *RateLimitConfigRef) GetName() string { @@ -358,7 +435,7 @@ type RateLimitVhostExtension struct { func (x *RateLimitVhostExtension) Reset() { *x = RateLimitVhostExtension{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[5] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -371,7 +448,7 @@ func (x *RateLimitVhostExtension) String() string { func (*RateLimitVhostExtension) ProtoMessage() {} func (x *RateLimitVhostExtension) ProtoReflect() protoreflect.Message { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[5] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -384,7 +461,7 @@ func (x *RateLimitVhostExtension) ProtoReflect() protoreflect.Message { // Deprecated: Use RateLimitVhostExtension.ProtoReflect.Descriptor instead. func (*RateLimitVhostExtension) Descriptor() ([]byte, []int) { - return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{5} + return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{6} } func (x *RateLimitVhostExtension) GetRateLimits() []*v1alpha1.RateLimitActions { @@ -413,7 +490,7 @@ type RateLimitRouteExtension struct { func (x *RateLimitRouteExtension) Reset() { *x = RateLimitRouteExtension{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[6] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -426,7 +503,7 @@ func (x *RateLimitRouteExtension) String() string { func (*RateLimitRouteExtension) ProtoMessage() {} func (x *RateLimitRouteExtension) ProtoReflect() protoreflect.Message { - mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[6] + mi := &file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -439,7 +516,7 @@ func (x *RateLimitRouteExtension) ProtoReflect() protoreflect.Message { // Deprecated: Use RateLimitRouteExtension.ProtoReflect.Descriptor instead. func (*RateLimitRouteExtension) Descriptor() ([]byte, []int) { - return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{6} + return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescGZIP(), []int{7} } func (x *RateLimitRouteExtension) GetIncludeVhRateLimits() bool { @@ -490,7 +567,7 @@ var file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_rateli 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x0f, 0x61, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x6f, 0x75, - 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0xaf, 0x02, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x74, + 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x91, 0x03, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4b, 0x0a, 0x14, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, @@ -509,51 +586,59 @@ var file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_rateli 0x64, 0x65, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x16, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x42, - 0x65, 0x66, 0x6f, 0x72, 0x65, 0x41, 0x75, 0x74, 0x68, 0x22, 0xa5, 0x01, 0x0a, 0x0f, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x43, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x72, 0x61, - 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, - 0x2e, 0x69, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x0e, 0x73, 0x65, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x73, 0x22, 0x5d, 0x0a, 0x13, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x66, 0x73, 0x12, 0x46, 0x0a, 0x04, 0x72, 0x65, 0x66, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6c, 0x6f, 0x6f, 0x2e, - 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x66, 0x52, 0x04, 0x72, 0x65, 0x66, 0x73, - 0x22, 0x46, 0x0a, 0x12, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x63, 0x0a, 0x17, 0x52, 0x61, 0x74, 0x65, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x56, 0x68, 0x6f, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x0b, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, - 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x98, 0x01, - 0x0a, 0x17, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x16, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x76, 0x68, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x64, 0x65, 0x56, 0x68, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x48, - 0x0a, 0x0b, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x52, 0x61, 0x74, 0x65, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0a, 0x72, 0x61, - 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x5f, 0xb8, 0xf5, 0x04, 0x01, 0xc0, 0xf5, - 0x04, 0x01, 0xd0, 0xf5, 0x04, 0x01, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, - 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6c, 0x6f, - 0x6f, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x66, 0x6f, 0x72, 0x65, 0x41, 0x75, 0x74, 0x68, 0x12, 0x50, 0x0a, 0x0c, 0x67, 0x72, 0x70, + 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6c, 0x6f, 0x6f, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, + 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0b, + 0x67, 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2b, 0x0a, 0x0b, 0x47, + 0x72, 0x70, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xa5, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x43, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x72, 0x61, 0x74, + 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, + 0x69, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x52, 0x0e, 0x73, 0x65, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, + 0x22, 0x5d, 0x0a, 0x13, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x66, 0x73, 0x12, 0x46, 0x0a, 0x04, 0x72, 0x65, 0x66, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6c, 0x6f, 0x6f, 0x2e, 0x73, + 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x66, 0x52, 0x04, 0x72, 0x65, 0x66, 0x73, 0x22, + 0x46, 0x0a, 0x12, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x63, 0x0a, 0x17, 0x52, 0x61, 0x74, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x56, 0x68, 0x6f, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x0b, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, + 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x98, 0x01, 0x0a, + 0x17, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x16, 0x69, 0x6e, 0x63, 0x6c, + 0x75, 0x64, 0x65, 0x5f, 0x76, 0x68, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, + 0x65, 0x56, 0x68, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x48, 0x0a, + 0x0b, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0a, 0x72, 0x61, 0x74, + 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x5f, 0xb8, 0xf5, 0x04, 0x01, 0xc0, 0xf5, 0x04, + 0x01, 0xd0, 0xf5, 0x04, 0x01, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x61, + 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6c, 0x6f, 0x6f, + 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, + 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -568,37 +653,39 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratel return file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDescData } -var file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_goTypes = []interface{}{ (*IngressRateLimit)(nil), // 0: ratelimit.options.gloo.solo.io.IngressRateLimit (*Settings)(nil), // 1: ratelimit.options.gloo.solo.io.Settings - (*ServiceSettings)(nil), // 2: ratelimit.options.gloo.solo.io.ServiceSettings - (*RateLimitConfigRefs)(nil), // 3: ratelimit.options.gloo.solo.io.RateLimitConfigRefs - (*RateLimitConfigRef)(nil), // 4: ratelimit.options.gloo.solo.io.RateLimitConfigRef - (*RateLimitVhostExtension)(nil), // 5: ratelimit.options.gloo.solo.io.RateLimitVhostExtension - (*RateLimitRouteExtension)(nil), // 6: ratelimit.options.gloo.solo.io.RateLimitRouteExtension - (*v1alpha1.RateLimit)(nil), // 7: ratelimit.api.solo.io.RateLimit - (*core.ResourceRef)(nil), // 8: core.solo.io.ResourceRef - (*duration.Duration)(nil), // 9: google.protobuf.Duration - (*v1alpha1.Descriptor)(nil), // 10: ratelimit.api.solo.io.Descriptor - (*v1alpha1.SetDescriptor)(nil), // 11: ratelimit.api.solo.io.SetDescriptor - (*v1alpha1.RateLimitActions)(nil), // 12: ratelimit.api.solo.io.RateLimitActions + (*GrpcService)(nil), // 2: ratelimit.options.gloo.solo.io.GrpcService + (*ServiceSettings)(nil), // 3: ratelimit.options.gloo.solo.io.ServiceSettings + (*RateLimitConfigRefs)(nil), // 4: ratelimit.options.gloo.solo.io.RateLimitConfigRefs + (*RateLimitConfigRef)(nil), // 5: ratelimit.options.gloo.solo.io.RateLimitConfigRef + (*RateLimitVhostExtension)(nil), // 6: ratelimit.options.gloo.solo.io.RateLimitVhostExtension + (*RateLimitRouteExtension)(nil), // 7: ratelimit.options.gloo.solo.io.RateLimitRouteExtension + (*v1alpha1.RateLimit)(nil), // 8: ratelimit.api.solo.io.RateLimit + (*core.ResourceRef)(nil), // 9: core.solo.io.ResourceRef + (*duration.Duration)(nil), // 10: google.protobuf.Duration + (*v1alpha1.Descriptor)(nil), // 11: ratelimit.api.solo.io.Descriptor + (*v1alpha1.SetDescriptor)(nil), // 12: ratelimit.api.solo.io.SetDescriptor + (*v1alpha1.RateLimitActions)(nil), // 13: ratelimit.api.solo.io.RateLimitActions } var file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_depIdxs = []int32{ - 7, // 0: ratelimit.options.gloo.solo.io.IngressRateLimit.authorized_limits:type_name -> ratelimit.api.solo.io.RateLimit - 7, // 1: ratelimit.options.gloo.solo.io.IngressRateLimit.anonymous_limits:type_name -> ratelimit.api.solo.io.RateLimit - 8, // 2: ratelimit.options.gloo.solo.io.Settings.ratelimit_server_ref:type_name -> core.solo.io.ResourceRef - 9, // 3: ratelimit.options.gloo.solo.io.Settings.request_timeout:type_name -> google.protobuf.Duration - 10, // 4: ratelimit.options.gloo.solo.io.ServiceSettings.descriptors:type_name -> ratelimit.api.solo.io.Descriptor - 11, // 5: ratelimit.options.gloo.solo.io.ServiceSettings.set_descriptors:type_name -> ratelimit.api.solo.io.SetDescriptor - 4, // 6: ratelimit.options.gloo.solo.io.RateLimitConfigRefs.refs:type_name -> ratelimit.options.gloo.solo.io.RateLimitConfigRef - 12, // 7: ratelimit.options.gloo.solo.io.RateLimitVhostExtension.rate_limits:type_name -> ratelimit.api.solo.io.RateLimitActions - 12, // 8: ratelimit.options.gloo.solo.io.RateLimitRouteExtension.rate_limits:type_name -> ratelimit.api.solo.io.RateLimitActions - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 8, // 0: ratelimit.options.gloo.solo.io.IngressRateLimit.authorized_limits:type_name -> ratelimit.api.solo.io.RateLimit + 8, // 1: ratelimit.options.gloo.solo.io.IngressRateLimit.anonymous_limits:type_name -> ratelimit.api.solo.io.RateLimit + 9, // 2: ratelimit.options.gloo.solo.io.Settings.ratelimit_server_ref:type_name -> core.solo.io.ResourceRef + 10, // 3: ratelimit.options.gloo.solo.io.Settings.request_timeout:type_name -> google.protobuf.Duration + 2, // 4: ratelimit.options.gloo.solo.io.Settings.grpc_service:type_name -> ratelimit.options.gloo.solo.io.GrpcService + 11, // 5: ratelimit.options.gloo.solo.io.ServiceSettings.descriptors:type_name -> ratelimit.api.solo.io.Descriptor + 12, // 6: ratelimit.options.gloo.solo.io.ServiceSettings.set_descriptors:type_name -> ratelimit.api.solo.io.SetDescriptor + 5, // 7: ratelimit.options.gloo.solo.io.RateLimitConfigRefs.refs:type_name -> ratelimit.options.gloo.solo.io.RateLimitConfigRef + 13, // 8: ratelimit.options.gloo.solo.io.RateLimitVhostExtension.rate_limits:type_name -> ratelimit.api.solo.io.RateLimitActions + 13, // 9: ratelimit.options.gloo.solo.io.RateLimitRouteExtension.rate_limits:type_name -> ratelimit.api.solo.io.RateLimitActions + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { @@ -634,7 +721,7 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratel } } file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceSettings); i { + switch v := v.(*GrpcService); i { case 0: return &v.state case 1: @@ -646,7 +733,7 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratel } } file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RateLimitConfigRefs); i { + switch v := v.(*ServiceSettings); i { case 0: return &v.state case 1: @@ -658,7 +745,7 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratel } } file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RateLimitConfigRef); i { + switch v := v.(*RateLimitConfigRefs); i { case 0: return &v.state case 1: @@ -670,7 +757,7 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratel } } file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RateLimitVhostExtension); i { + switch v := v.(*RateLimitConfigRef); i { case 0: return &v.state case 1: @@ -682,6 +769,18 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratel } } file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RateLimitVhostExtension); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RateLimitRouteExtension); i { case 0: return &v.state @@ -694,13 +793,16 @@ func file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratel } } } + file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Settings_GrpcService)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_github_com_solo_io_solo_apis_api_gloo_gloo_v1_enterprise_options_ratelimit_ratelimit_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.hash.go b/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.hash.go index 03feef0e3..7a8de52e0 100644 --- a/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.hash.go +++ b/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit/ratelimit.pb.hash.go @@ -149,6 +149,52 @@ func (m *Settings) Hash(hasher hash.Hash64) (uint64, error) { return 0, err } + switch m.ServiceType.(type) { + + case *Settings_GrpcService: + + if h, ok := interface{}(m.GetGrpcService()).(safe_hasher.SafeHasher); ok { + if _, err = hasher.Write([]byte("GrpcService")); err != nil { + return 0, err + } + if _, err = h.Hash(hasher); err != nil { + return 0, err + } + } else { + if fieldValue, err := hashstructure.Hash(m.GetGrpcService(), nil); err != nil { + return 0, err + } else { + if _, err = hasher.Write([]byte("GrpcService")); err != nil { + return 0, err + } + if err := binary.Write(hasher, binary.LittleEndian, fieldValue); err != nil { + return 0, err + } + } + } + + } + + return hasher.Sum64(), nil +} + +// Hash function +func (m *GrpcService) Hash(hasher hash.Hash64) (uint64, error) { + if m == nil { + return 0, nil + } + if hasher == nil { + hasher = fnv.New64() + } + var err error + if _, err = hasher.Write([]byte("ratelimit.options.gloo.solo.io.github.com/solo-io/solo-apis/pkg/api/gloo.solo.io/v1/enterprise/options/ratelimit.GrpcService")); err != nil { + return 0, err + } + + if _, err = hasher.Write([]byte(m.GetAuthority())); err != nil { + return 0, err + } + return hasher.Sum64(), nil }