diff --git a/envoy/COMMIT b/envoy/COMMIT index 305a1eb8c8..47df12a9ac 100644 --- a/envoy/COMMIT +++ b/envoy/COMMIT @@ -1 +1 @@ -85d8cc745589ac8be9e85a2983740f22e80c85c5 +87514d50f8eee63e84127dbd46217a86fa31df25 diff --git a/envoy/data/core/v3/tlv_metadata.pb.go b/envoy/data/core/v3/tlv_metadata.pb.go new file mode 100755 index 0000000000..585c89c622 --- /dev/null +++ b/envoy/data/core/v3/tlv_metadata.pb.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.25.3 +// source: envoy/data/core/v3/tlv_metadata.proto + +package corev3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + 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) +) + +type TlvsMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Typed metadata for :ref:`Proxy protocol filter `, that represents a map of TLVs. + // Each entry in the map consists of a key which corresponds to a configured + // :ref:`rule key ` and a value (TLV value in bytes). + // When runtime flag “envoy.reloadable_features.use_typed_metadata_in_proxy_protocol_listener“ is enabled, + // :ref:`Proxy protocol filter ` + // will populate typed metadata and regular metadata. By default filter will populate typed and untyped metadata. + TypedMetadata map[string][]byte `protobuf:"bytes,1,rep,name=typed_metadata,json=typedMetadata,proto3" json:"typed_metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *TlvsMetadata) Reset() { + *x = TlvsMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_data_core_v3_tlv_metadata_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TlvsMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TlvsMetadata) ProtoMessage() {} + +func (x *TlvsMetadata) ProtoReflect() protoreflect.Message { + mi := &file_envoy_data_core_v3_tlv_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 TlvsMetadata.ProtoReflect.Descriptor instead. +func (*TlvsMetadata) Descriptor() ([]byte, []int) { + return file_envoy_data_core_v3_tlv_metadata_proto_rawDescGZIP(), []int{0} +} + +func (x *TlvsMetadata) GetTypedMetadata() map[string][]byte { + if x != nil { + return x.TypedMetadata + } + return nil +} + +var File_envoy_data_core_v3_tlv_metadata_proto protoreflect.FileDescriptor + +var file_envoy_data_core_v3_tlv_metadata_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x72, + 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x74, 0x6c, 0x76, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 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, 0x22, 0xac, 0x01, 0x0a, 0x0c, 0x54, + 0x6c, 0x76, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5a, 0x0a, 0x0e, 0x74, + 0x79, 0x70, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x6c, 0x76, 0x73, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x74, 0x79, 0x70, 0x65, 0x64, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x40, 0x0a, 0x12, 0x54, 0x79, 0x70, 0x65, 0x64, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x80, 0x01, 0xba, 0x80, 0xc8, 0xd1, + 0x06, 0x02, 0x10, 0x02, 0x0a, 0x20, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x10, 0x54, 0x6c, 0x76, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 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, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x6f, 0x72, 0x65, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoy_data_core_v3_tlv_metadata_proto_rawDescOnce sync.Once + file_envoy_data_core_v3_tlv_metadata_proto_rawDescData = file_envoy_data_core_v3_tlv_metadata_proto_rawDesc +) + +func file_envoy_data_core_v3_tlv_metadata_proto_rawDescGZIP() []byte { + file_envoy_data_core_v3_tlv_metadata_proto_rawDescOnce.Do(func() { + file_envoy_data_core_v3_tlv_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_data_core_v3_tlv_metadata_proto_rawDescData) + }) + return file_envoy_data_core_v3_tlv_metadata_proto_rawDescData +} + +var file_envoy_data_core_v3_tlv_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_envoy_data_core_v3_tlv_metadata_proto_goTypes = []interface{}{ + (*TlvsMetadata)(nil), // 0: envoy.data.core.v3.TlvsMetadata + nil, // 1: envoy.data.core.v3.TlvsMetadata.TypedMetadataEntry +} +var file_envoy_data_core_v3_tlv_metadata_proto_depIdxs = []int32{ + 1, // 0: envoy.data.core.v3.TlvsMetadata.typed_metadata:type_name -> envoy.data.core.v3.TlvsMetadata.TypedMetadataEntry + 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 +} + +func init() { file_envoy_data_core_v3_tlv_metadata_proto_init() } +func file_envoy_data_core_v3_tlv_metadata_proto_init() { + if File_envoy_data_core_v3_tlv_metadata_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_envoy_data_core_v3_tlv_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TlvsMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoy_data_core_v3_tlv_metadata_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_data_core_v3_tlv_metadata_proto_goTypes, + DependencyIndexes: file_envoy_data_core_v3_tlv_metadata_proto_depIdxs, + MessageInfos: file_envoy_data_core_v3_tlv_metadata_proto_msgTypes, + }.Build() + File_envoy_data_core_v3_tlv_metadata_proto = out.File + file_envoy_data_core_v3_tlv_metadata_proto_rawDesc = nil + file_envoy_data_core_v3_tlv_metadata_proto_goTypes = nil + file_envoy_data_core_v3_tlv_metadata_proto_depIdxs = nil +} diff --git a/envoy/data/core/v3/tlv_metadata.pb.validate.go b/envoy/data/core/v3/tlv_metadata.pb.validate.go new file mode 100755 index 0000000000..81d7612b8d --- /dev/null +++ b/envoy/data/core/v3/tlv_metadata.pb.validate.go @@ -0,0 +1,138 @@ +//go:build !disable_pgv +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/data/core/v3/tlv_metadata.proto + +package corev3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on TlvsMetadata 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 *TlvsMetadata) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on TlvsMetadata 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 TlvsMetadataMultiError, or +// nil if none found. +func (m *TlvsMetadata) ValidateAll() error { + return m.validate(true) +} + +func (m *TlvsMetadata) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for TypedMetadata + + if len(errors) > 0 { + return TlvsMetadataMultiError(errors) + } + + return nil +} + +// TlvsMetadataMultiError is an error wrapping multiple validation errors +// returned by TlvsMetadata.ValidateAll() if the designated constraints aren't met. +type TlvsMetadataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m TlvsMetadataMultiError) 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 TlvsMetadataMultiError) AllErrors() []error { return m } + +// TlvsMetadataValidationError is the validation error returned by +// TlvsMetadata.Validate if the designated constraints aren't met. +type TlvsMetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e TlvsMetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e TlvsMetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e TlvsMetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e TlvsMetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e TlvsMetadataValidationError) ErrorName() string { return "TlvsMetadataValidationError" } + +// Error satisfies the builtin error interface +func (e TlvsMetadataValidationError) 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 %sTlvsMetadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = TlvsMetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = TlvsMetadataValidationError{} diff --git a/envoy/data/core/v3/tlv_metadata_vtproto.pb.go b/envoy/data/core/v3/tlv_metadata_vtproto.pb.go new file mode 100755 index 0000000000..137e754f7e --- /dev/null +++ b/envoy/data/core/v3/tlv_metadata_vtproto.pb.go @@ -0,0 +1,90 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/data/core/v3/tlv_metadata.proto + +package corev3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +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) +) + +func (m *TlvsMetadata) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TlvsMetadata) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *TlvsMetadata) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.TypedMetadata) > 0 { + for k := range m.TypedMetadata { + v := m.TypedMetadata[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *TlvsMetadata) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.TypedMetadata) > 0 { + for k, v := range m.TypedMetadata { + _ = k + _ = v + l = 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +}