From e56aae455035e405a77e64923e77d73dfa20a8e1 Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 15:16:36 +0000 Subject: [PATCH 1/2] Mirrored from envoyproxy/envoy @ f27ed961a8c023c046599a090d7c549ddf65a86d Signed-off-by: update-envoy[bot] <135279899+update-envoy[bot]@users.noreply.github.com> --- envoy/COMMIT | 2 +- envoy/config/route/v3/route_components.pb.go | 2 ++ .../v3/http_connection_manager.pb.go | 10 ++-------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/envoy/COMMIT b/envoy/COMMIT index 1d34a4a077..66610eb2c9 100644 --- a/envoy/COMMIT +++ b/envoy/COMMIT @@ -1 +1 @@ -f7ef1eeca94f714f0d48af3dd8a43757dc63d770 +f27ed961a8c023c046599a090d7c549ddf65a86d diff --git a/envoy/config/route/v3/route_components.pb.go b/envoy/config/route/v3/route_components.pb.go index e33e6813a3..3b0e41c354 100755 --- a/envoy/config/route/v3/route_components.pb.go +++ b/envoy/config/route/v3/route_components.pb.go @@ -3860,6 +3860,8 @@ type FilterConfig struct { // than rejecting the config. IsOptional bool `protobuf:"varint,2,opt,name=is_optional,json=isOptional,proto3" json:"is_optional,omitempty"` // If true, the filter is disabled in the route or virtual host and the “config“ field is ignored. + // See :ref:`route based filter chain ` + // for more details. // // .. note:: // diff --git a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.go b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.go index 6b573a68bb..91e76c5f08 100755 --- a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.go +++ b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.go @@ -1721,14 +1721,8 @@ type HttpFilter struct { IsOptional bool `protobuf:"varint,6,opt,name=is_optional,json=isOptional,proto3" json:"is_optional,omitempty"` // If true, the filter is disabled by default and must be explicitly enabled by setting // per filter configuration in the route configuration. - // - // A disabled filter will be treated as enabled in the following cases: - // - // 1. Valid per filter configuration is configured in the “typed_per_filter_config“ of route config. - // 2. :ref:`FilterConfig ` is configured in the - // “typed_per_filter_config“ of route config and the - // :ref:`disabled of FilterConfig ` - // is set to false. + // See :ref:`route based filter chain ` + // for more details. // // Terminal filters (e.g. “envoy.filters.http.router“) cannot be marked as disabled. Disabled bool `protobuf:"varint,7,opt,name=disabled,proto3" json:"disabled,omitempty"` From 093c581bd046b54bc59d4bd34a3c3339ca774fda Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 23:33:48 +0000 Subject: [PATCH 2/2] Mirrored from envoyproxy/envoy @ 483ecb2d4055b42a806f0a1003243ba62c86cf3a Signed-off-by: update-envoy[bot] <135279899+update-envoy[bot]@users.noreply.github.com> --- envoy/COMMIT | 2 +- .../http/set_metadata/v3/set_metadata.pb.go | 211 +++++++++++++++--- .../v3/set_metadata.pb.validate.go | 211 +++++++++++++++++- 3 files changed, 380 insertions(+), 44 deletions(-) diff --git a/envoy/COMMIT b/envoy/COMMIT index 66610eb2c9..35c4259bf1 100644 --- a/envoy/COMMIT +++ b/envoy/COMMIT @@ -1 +1 @@ -f27ed961a8c023c046599a090d7c549ddf65a86d +483ecb2d4055b42a806f0a1003243ba62c86cf3a diff --git a/envoy/extensions/filters/http/set_metadata/v3/set_metadata.pb.go b/envoy/extensions/filters/http/set_metadata/v3/set_metadata.pb.go index 947a21c2c8..e5450c00f7 100755 --- a/envoy/extensions/filters/http/set_metadata/v3/set_metadata.pb.go +++ b/envoy/extensions/filters/http/set_metadata/v3/set_metadata.pb.go @@ -8,7 +8,9 @@ package set_metadatav3 import ( _ "github.com/cncf/xds/go/udpa/annotations" + _ "github.com/envoyproxy/go-control-plane/envoy/annotations" _ "github.com/envoyproxy/protoc-gen-validate/validate" + any1 "github.com/golang/protobuf/ptypes/any" _struct "github.com/golang/protobuf/ptypes/struct" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -23,24 +25,114 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type Metadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The metadata namespace. + MetadataNamespace string `protobuf:"bytes,1,opt,name=metadata_namespace,json=metadataNamespace,proto3" json:"metadata_namespace,omitempty"` + // Allow the filter to overwrite or merge with an existing value in the namespace. + AllowOverwrite bool `protobuf:"varint,2,opt,name=allow_overwrite,json=allowOverwrite,proto3" json:"allow_overwrite,omitempty"` + // The value to place at the namespace. If “allow_overwrite“, this will + // overwrite or merge with any existing values in that namespace. See + // :ref:`the filter documentation ` for + // more information on how this value is merged with potentially existing + // ones if “allow_overwrite“ is configured. Only one of “value“ and + // “typed_value“ may be set. + Value *_struct.Struct `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + // The value to place at the namespace. If “allow_overwrite“, this will + // overwrite any existing values in that namespace. Only one of “value“ and + // “typed_value“ may be set. + TypedValue *any1.Any `protobuf:"bytes,4,opt,name=typed_value,json=typedValue,proto3" json:"typed_value,omitempty"` +} + +func (x *Metadata) Reset() { + *x = Metadata{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metadata) ProtoMessage() {} + +func (x *Metadata) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_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 Metadata.ProtoReflect.Descriptor instead. +func (*Metadata) Descriptor() ([]byte, []int) { + return file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_rawDescGZIP(), []int{0} +} + +func (x *Metadata) GetMetadataNamespace() string { + if x != nil { + return x.MetadataNamespace + } + return "" +} + +func (x *Metadata) GetAllowOverwrite() bool { + if x != nil { + return x.AllowOverwrite + } + return false +} + +func (x *Metadata) GetValue() *_struct.Struct { + if x != nil { + return x.Value + } + return nil +} + +func (x *Metadata) GetTypedValue() *any1.Any { + if x != nil { + return x.TypedValue + } + return nil +} + type Config struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The metadata namespace. + // This field is deprecated; please use “metadata“ as replacement. + // + // Deprecated: Marked as deprecated in envoy/extensions/filters/http/set_metadata/v3/set_metadata.proto. MetadataNamespace string `protobuf:"bytes,1,opt,name=metadata_namespace,json=metadataNamespace,proto3" json:"metadata_namespace,omitempty"` - // The value to update the namespace with. See + // The untyped value to update the dynamic metadata namespace with. See // :ref:`the filter documentation ` for // more information on how this value is merged with potentially existing // ones. + // This field is deprecated; please use “metadata“ as replacement. + // + // Deprecated: Marked as deprecated in envoy/extensions/filters/http/set_metadata/v3/set_metadata.proto. Value *_struct.Struct `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + // Defines changes to be made to dynamic metadata. + Metadata []*Metadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty"` } func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_msgTypes[0] + mi := &file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -53,7 +145,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_msgTypes[0] + mi := &file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -66,9 +158,10 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_rawDescGZIP(), []int{0} + return file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_rawDescGZIP(), []int{1} } +// Deprecated: Marked as deprecated in envoy/extensions/filters/http/set_metadata/v3/set_metadata.proto. func (x *Config) GetMetadataNamespace() string { if x != nil { return x.MetadataNamespace @@ -76,6 +169,7 @@ func (x *Config) GetMetadataNamespace() string { return "" } +// Deprecated: Marked as deprecated in envoy/extensions/filters/http/set_metadata/v3/set_metadata.proto. func (x *Config) GetValue() *_struct.Struct { if x != nil { return x.Value @@ -83,6 +177,13 @@ func (x *Config) GetValue() *_struct.Struct { return nil } +func (x *Config) GetMetadata() []*Metadata { + if x != nil { + return x.Metadata + } + return nil +} + var File_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto protoreflect.FileDescriptor var file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_rawDesc = []byte{ @@ -93,32 +194,55 @@ var file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_rawDes 0x74, 0x6f, 0x12, 0x2d, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x73, 0x65, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x76, - 0x33, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x33, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x64, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6f, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x36, 0x0a, 0x12, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x11, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xbe, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, - 0x02, 0x10, 0x02, 0x0a, 0x3b, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd1, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x12, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x11, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x0f, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4f, 0x76, 0x65, 0x72, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x0a, 0x74, 0x79, 0x70, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xd5, 0x01, 0x0a, 0x06, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x12, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0b, 0x92, 0xc7, 0x86, 0xd8, 0x04, 0x03, 0x33, 0x2e, 0x30, 0x18, 0x01, 0x52, + 0x11, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x0b, 0x92, 0xc7, 0x86, 0xd8, + 0x04, 0x03, 0x33, 0x2e, 0x30, 0x18, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x53, + 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x37, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x73, 0x65, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x76, 0x33, - 0x42, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x63, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, - 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x73, 0x65, 0x74, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x76, 0x33, 0x3b, 0x73, 0x65, 0x74, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x42, 0xbe, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x3b, + 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x73, 0x65, 0x74, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x76, 0x33, 0x42, 0x10, 0x53, 0x65, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x63, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, + 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x73, 0x65, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x2f, 0x76, 0x33, 0x3b, 0x73, 0x65, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -133,18 +257,23 @@ func file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_rawDe return file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_rawDescData } -var file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: envoy.extensions.filters.http.set_metadata.v3.Config - (*_struct.Struct)(nil), // 1: google.protobuf.Struct + (*Metadata)(nil), // 0: envoy.extensions.filters.http.set_metadata.v3.Metadata + (*Config)(nil), // 1: envoy.extensions.filters.http.set_metadata.v3.Config + (*_struct.Struct)(nil), // 2: google.protobuf.Struct + (*any1.Any)(nil), // 3: google.protobuf.Any } var file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_depIdxs = []int32{ - 1, // 0: envoy.extensions.filters.http.set_metadata.v3.Config.value:type_name -> google.protobuf.Struct - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 2, // 0: envoy.extensions.filters.http.set_metadata.v3.Metadata.value:type_name -> google.protobuf.Struct + 3, // 1: envoy.extensions.filters.http.set_metadata.v3.Metadata.typed_value:type_name -> google.protobuf.Any + 2, // 2: envoy.extensions.filters.http.set_metadata.v3.Config.value:type_name -> google.protobuf.Struct + 0, // 3: envoy.extensions.filters.http.set_metadata.v3.Config.metadata:type_name -> envoy.extensions.filters.http.set_metadata.v3.Metadata + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_init() } @@ -154,6 +283,18 @@ func file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_init( } if !protoimpl.UnsafeEnabled { file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -172,7 +313,7 @@ func file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_init( GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_envoy_extensions_filters_http_set_metadata_v3_set_metadata_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/envoy/extensions/filters/http/set_metadata/v3/set_metadata.pb.validate.go b/envoy/extensions/filters/http/set_metadata/v3/set_metadata.pb.validate.go index 2384bfaa7b..c2c7be2e46 100755 --- a/envoy/extensions/filters/http/set_metadata/v3/set_metadata.pb.validate.go +++ b/envoy/extensions/filters/http/set_metadata/v3/set_metadata.pb.validate.go @@ -35,21 +35,22 @@ var ( _ = sort.Sort ) -// Validate checks the field values on Config with the rules defined in the +// Validate checks the field values on Metadata with the rules defined in the // proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. -func (m *Config) Validate() error { +func (m *Metadata) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Config with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in ConfigMultiError, or nil if none found. -func (m *Config) ValidateAll() error { +// ValidateAll checks the field values on Metadata with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in MetadataMultiError, or nil +// if none found. +func (m *Metadata) ValidateAll() error { return m.validate(true) } -func (m *Config) validate(all bool) error { +func (m *Metadata) validate(all bool) error { if m == nil { return nil } @@ -57,7 +58,7 @@ func (m *Config) validate(all bool) error { var errors []error if utf8.RuneCountInString(m.GetMetadataNamespace()) < 1 { - err := ConfigValidationError{ + err := MetadataValidationError{ field: "MetadataNamespace", reason: "value length must be at least 1 runes", } @@ -67,6 +68,166 @@ func (m *Config) validate(all bool) error { errors = append(errors, err) } + // no validation rules for AllowOverwrite + + if all { + switch v := interface{}(m.GetValue()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MetadataValidationError{ + field: "Value", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MetadataValidationError{ + field: "Value", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MetadataValidationError{ + field: "Value", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetTypedValue()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, MetadataValidationError{ + field: "TypedValue", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, MetadataValidationError{ + field: "TypedValue", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTypedValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MetadataValidationError{ + field: "TypedValue", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return MetadataMultiError(errors) + } + + return nil +} + +// MetadataMultiError is an error wrapping multiple validation errors returned +// by Metadata.ValidateAll() if the designated constraints aren't met. +type MetadataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m MetadataMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m MetadataMultiError) AllErrors() []error { return m } + +// MetadataValidationError is the validation error returned by +// Metadata.Validate if the designated constraints aren't met. +type MetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e MetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e MetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e MetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e MetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e MetadataValidationError) ErrorName() string { return "MetadataValidationError" } + +// Error satisfies the builtin error interface +func (e MetadataValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sMetadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = MetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = MetadataValidationError{} + +// Validate checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Config) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Config with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in ConfigMultiError, or nil if none found. +func (m *Config) ValidateAll() error { + return m.validate(true) +} + +func (m *Config) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for MetadataNamespace + if all { switch v := interface{}(m.GetValue()).(type) { case interface{ ValidateAll() error }: @@ -96,6 +257,40 @@ func (m *Config) validate(all bool) error { } } + for idx, item := range m.GetMetadata() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ConfigValidationError{ + field: fmt.Sprintf("Metadata[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ConfigValidationError{ + field: fmt.Sprintf("Metadata[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigValidationError{ + field: fmt.Sprintf("Metadata[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + if len(errors) > 0 { return ConfigMultiError(errors) }