From 653930f1a57318b749f2523616a2d491d4b91c7b Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 28 Mar 2018 11:33:59 -0700 Subject: [PATCH] update gcp and api Signed-off-by: Kuat Yessenov --- Gopkg.lock | 6 +- .../envoyproxy/go-control-plane/Makefile | 6 +- .../go-control-plane/build/generate_protos.sh | 3 +- .../envoy/admin/v2/config_dump.pb.go | 650 +++++ .../envoy/admin/v2/config_dump.pb.validate.go | 150 ++ .../envoy/api/v2/auth/auth.pb.validate.go | 341 +++ .../envoy/api/v2/auth/cert.pb.validate.go | 768 ++++++ .../go-control-plane/envoy/api/v2/cds.pb.go | 683 +++++- .../envoy/api/v2/cds.pb.validate.go | 877 +++++++ .../v2/cluster/circuit_breaker.pb.validate.go | 176 ++ .../cluster/outlier_detection.pb.validate.go | 213 ++ .../envoy/api/v2/core/address.pb.go | 148 +- .../envoy/api/v2/core/address.pb.validate.go | 354 +++ .../envoy/api/v2/core/base.pb.validate.go | 488 ++++ .../api/v2/core/config_source.pb.validate.go | 230 ++ .../api/v2/core/grpc_service.pb.validate.go | 404 ++++ .../envoy/api/v2/core/health_check.pb.go | 190 +- .../api/v2/core/health_check.pb.validate.go | 504 ++++ .../envoy/api/v2/core/http_uri.pb.validate.go | 102 + .../envoy/api/v2/core/protocol.pb.go | 3 - .../envoy/api/v2/core/protocol.pb.validate.go | 322 +++ .../envoy/api/v2/discovery.pb.validate.go | 168 ++ .../envoy/api/v2/eds.pb.validate.go | 159 ++ .../envoy/api/v2/endpoint/endpoint.pb.go | 10 +- .../api/v2/endpoint/endpoint.pb.validate.go | 240 ++ .../v2/endpoint/load_report.pb.validate.go | 231 ++ .../go-control-plane/envoy/api/v2/lds.pb.go | 220 +- .../envoy/api/v2/lds.pb.validate.go | 239 ++ .../api/v2/listener/listener.pb.validate.go | 422 ++++ .../api/v2/ratelimit/ratelimit.pb.validate.go | 155 ++ .../envoy/api/v2/rds.pb.validate.go | 134 + .../envoy/api/v2/route/route.pb.go | 1 - .../envoy/api/v2/route/route.pb.validate.go | 2152 +++++++++++++++++ .../config/accesslog/v2/als.pb.validate.go | 219 ++ .../bootstrap/v2/bootstrap.pb.validate.go | 737 ++++++ .../accesslog/v2/accesslog.pb.validate.go | 1370 +++++++++++ .../envoy/config/filter/fault/v2/fault.pb.go | 84 +- .../filter/fault/v2/fault.pb.validate.go | 116 + .../http/buffer/v2/buffer.pb.validate.go | 108 + .../ext_authz/v2/ext_authz.pb.validate.go | 88 + .../filter/http/fault/v2/fault.pb.validate.go | 180 ++ .../filter/http/gzip/v2/gzip.pb.validate.go | 176 ++ .../v2/health_check.pb.validate.go | 113 + .../ip_tagging/v2/ip_tagging.pb.validate.go | 164 ++ .../http/jwt_authn/v2alpha/config.pb.go | 1578 ++++++++++++ .../jwt_authn/v2alpha/config.pb.validate.go | 321 +++ .../filter/http/lua/v2/lua.pb.validate.go | 83 + .../rate_limit/v2/rate_limit.pb.validate.go | 102 + .../http/router/v2/router.pb.validate.go | 103 + .../http/squash/v2/squash.pb.validate.go | 123 + .../transcoder/v2/transcoder.pb.validate.go | 161 ++ .../v2/client_ssl_auth.pb.validate.go | 116 + .../ext_authz/v2/ext_authz.pb.validate.go | 95 + .../v2/http_connection_manager.pb.validate.go | 577 +++++ .../mongo_proxy/v2/mongo_proxy.pb.validate.go | 95 + .../rate_limit/v2/rate_limit.pb.validate.go | 122 + .../redis_proxy/v2/redis_proxy.pb.validate.go | 157 ++ .../tcp_proxy/v2/tcp_proxy.pb.validate.go | 313 +++ .../metrics/v2/metrics_service.pb.validate.go | 94 + .../envoy/config/metrics/v2/stats.pb.go | 5 +- .../config/metrics/v2/stats.pb.validate.go | 339 +++ .../config/ratelimit/v2/rls.pb.validate.go | 108 + .../config/trace/v2/trace.pb.validate.go | 375 +++ .../service/accesslog/v2/als.pb.validate.go | 361 +++ .../auth/v2/attribute_context.pb.validate.go | 292 +++ .../auth/v2/external_auth.pb.validate.go | 139 ++ .../service/discovery/v2/ads.pb.validate.go | 76 + .../service/discovery/v2/hds.pb.validate.go | 528 ++++ .../service/discovery/v2/sds.pb.validate.go | 76 + .../service/load_stats/v2/lrs.pb.validate.go | 161 ++ .../metrics/v2/metrics_service.pb.validate.go | 204 ++ .../service/ratelimit/v2/rls.pb.validate.go | 259 ++ .../trace/v2/trace_service.pb.validate.go | 204 ++ .../envoy/type/percent.pb.validate.go | 134 + .../envoy/type/range.pb.validate.go | 80 + .../envoyproxy/go-control-plane/glide.lock | 10 +- .../envoyproxy/go-control-plane/glide.yaml | 3 +- .../pkg/test/resource/resource.go | 5 +- .../go-control-plane/pkg/util/wellknown.go | 43 +- .../filter/http/authn/v2alpha1/config.pb.go | 482 ++++ .../filter/http/authn/v2alpha1/config.proto | 36 + .../api/networking/v1alpha3/gateway.pb.go | 30 +- .../api/networking/v1alpha3/gateway.proto | 30 +- .../istio.networking.v1alpha3.pb.html | 30 +- 84 files changed, 21710 insertions(+), 444 deletions(-) create mode 100644 github.com/envoyproxy/go-control-plane/envoy/admin/v2/config_dump.pb.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/admin/v2/config_dump.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/auth/auth.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/auth/cert.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/cds.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/cluster/circuit_breaker.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/cluster/outlier_detection.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/core/address.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/core/base.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/core/config_source.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/core/grpc_service.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/core/health_check.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/core/http_uri.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/core/protocol.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/discovery.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/eds.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/endpoint.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/load_report.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/lds.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/listener/listener.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/ratelimit/ratelimit.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/rds.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/api/v2/route/route.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v2/als.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v2/bootstrap.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/accesslog/v2/accesslog.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/fault/v2/fault.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/buffer/v2/buffer.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/fault/v2/fault.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/gzip/v2/gzip.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/health_check/v2/health_check.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/ip_tagging/v2/ip_tagging.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/lua/v2/lua.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/rate_limit/v2/rate_limit.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/router/v2/router.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/squash/v2/squash.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/http/transcoder/v2/transcoder.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/network/client_ssl_auth/v2/client_ssl_auth.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/network/ext_authz/v2/ext_authz.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/network/mongo_proxy/v2/mongo_proxy.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/network/rate_limit/v2/rate_limit.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/network/redis_proxy/v2/redis_proxy.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/metrics_service.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/stats.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/ratelimit/v2/rls.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/config/trace/v2/trace.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/accesslog/v2/als.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/auth/v2/attribute_context.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/auth/v2/external_auth.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/ads.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/hds.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/sds.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/load_stats/v2/lrs.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/metrics/v2/metrics_service.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2/rls.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/service/trace/v2/trace_service.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/type/percent.pb.validate.go create mode 100644 github.com/envoyproxy/go-control-plane/envoy/type/range.pb.validate.go create mode 100644 istio.io/api/envoy/config/filter/http/authn/v2alpha1/config.pb.go create mode 100644 istio.io/api/envoy/config/filter/http/authn/v2alpha1/config.proto diff --git a/Gopkg.lock b/Gopkg.lock index a7cfe653..15ccc264 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -264,7 +264,7 @@ "pkg/server", "pkg/util" ] - revision = "aa344ee5f4fff239fadab634413ca6764025511c" + revision = "9fdf4bd79736a87c78b3d48b7baa84ea24be1c1a" [[projects]] name = "github.com/fluent/fluent-logger-golang" @@ -1215,7 +1215,7 @@ "rbac/v1alpha1", "routing/v1alpha1" ] - revision = "64e9770daf900edc2a50fc4c57793f370cfdaf75" + revision = "47ab2f5893cfec02da3c2ec9776406a875b63ab6" [[projects]] name = "istio.io/fortio" @@ -1513,6 +1513,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "0998474db4d29e59a52fff3e808f5aeff315b986099e8738dfe38173c2340d4e" + inputs-digest = "6abb0fcd11142dab68f9b741450f03eba604f983f73387ec952e996c7ef6333a" solver-name = "gps-cdcl" solver-version = 1 diff --git a/github.com/envoyproxy/go-control-plane/Makefile b/github.com/envoyproxy/go-control-plane/Makefile index f4acf2f1..6cecbeaf 100644 --- a/github.com/envoyproxy/go-control-plane/Makefile +++ b/github.com/envoyproxy/go-control-plane/Makefile @@ -94,7 +94,7 @@ integration.docker: docker #-- code generaion #----------------- -generate: $(BINDIR)/gogofast +generate: $(BINDIR)/gogofast $(BINDIR)/validate @echo "--> generating pb.go files" $(SHELL) build/generate_protos.sh @@ -152,3 +152,7 @@ tools.glide: $(BINDIR)/gogofast: vendor @echo "--> building $@" @go build -o $@ vendor/github.com/gogo/protobuf/protoc-gen-gogofast/main.go + +$(BINDIR)/validate: vendor + @echo "--> building $@" + @go build -o $@ vendor/github.com/lyft/protoc-gen-validate/main.go diff --git a/github.com/envoyproxy/go-control-plane/build/generate_protos.sh b/github.com/envoyproxy/go-control-plane/build/generate_protos.sh index 6f140078..7fe72d5d 100755 --- a/github.com/envoyproxy/go-control-plane/build/generate_protos.sh +++ b/github.com/envoyproxy/go-control-plane/build/generate_protos.sh @@ -72,6 +72,7 @@ do then echo "Generating protos ${path} ..." $protoc ${protocarg} ${path}/*.proto \ - --plugin=protoc-gen-gogofast=${root}/bin/gogofast --gogofast_out=${gogoarg}:. + --plugin=protoc-gen-gogofast=${root}/bin/gogofast --gogofast_out=${gogoarg}:. \ + --plugin=protoc-gen-validate=${root}/bin/validate --validate_out="lang=gogo:." fi done diff --git a/github.com/envoyproxy/go-control-plane/envoy/admin/v2/config_dump.pb.go b/github.com/envoyproxy/go-control-plane/envoy/admin/v2/config_dump.pb.go new file mode 100644 index 00000000..c415d90f --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/admin/v2/config_dump.pb.go @@ -0,0 +1,650 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: envoy/admin/v2/config_dump.proto + +/* + Package envoy_admin_v2 is a generated protocol buffer package. + + It is generated from these files: + envoy/admin/v2/config_dump.proto + + It has these top-level messages: + ConfigDump + RouteConfigDump +*/ +package envoy_admin_v2 + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/gogo/protobuf/types" +import envoy_api_v21 "github.com/envoyproxy/go-control-plane/envoy/api/v2" +import _ "github.com/gogo/protobuf/gogoproto" + +import io "io" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +// The /config_dump admin endpoint uses this wrapper message to maintain and serve arbitrary +// configuration information from any component in Envoy. +// TODO(jsedgwick) In the future, we may want to formalize this further with an RPC for config_dump, +// and perhaps even with an RPC per config type. That strategy across all endpoints will allow for +// more flexibility w.r.t. protocol, serialization, parameters, etc. +type ConfigDump struct { + // This map is serialized and dumped in its entirety at the /config_dump endpoint. + // + // Keys should be a short descriptor of the config object they map to. For example, envoy's HTTP + // routing subsystem might use "routes" as the key for its config, for which it uses the message + // RouteConfigDump as defined below. In the future, the key will also be used to filter the output + // of the /config_dump endpoint. + Configs map[string]google_protobuf.Any `protobuf:"bytes,1,rep,name=configs" json:"configs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *ConfigDump) Reset() { *m = ConfigDump{} } +func (m *ConfigDump) String() string { return proto.CompactTextString(m) } +func (*ConfigDump) ProtoMessage() {} +func (*ConfigDump) Descriptor() ([]byte, []int) { return fileDescriptorConfigDump, []int{0} } + +func (m *ConfigDump) GetConfigs() map[string]google_protobuf.Any { + if m != nil { + return m.Configs + } + return nil +} + +// Envoy's RDS implementation fills this message with all currently loaded routes, as described by +// their RouteConnfiguration objects. Static routes configured in the bootstrap configuration are +// separated from those configured dynamically via RDS. This message is available at the +// /config_dump admin endpoint. +type RouteConfigDump struct { + StaticRouteConfigs []envoy_api_v21.RouteConfiguration `protobuf:"bytes,1,rep,name=static_route_configs,json=staticRouteConfigs" json:"static_route_configs"` + DynamicRouteConfigs []envoy_api_v21.RouteConfiguration `protobuf:"bytes,2,rep,name=dynamic_route_configs,json=dynamicRouteConfigs" json:"dynamic_route_configs"` +} + +func (m *RouteConfigDump) Reset() { *m = RouteConfigDump{} } +func (m *RouteConfigDump) String() string { return proto.CompactTextString(m) } +func (*RouteConfigDump) ProtoMessage() {} +func (*RouteConfigDump) Descriptor() ([]byte, []int) { return fileDescriptorConfigDump, []int{1} } + +func (m *RouteConfigDump) GetStaticRouteConfigs() []envoy_api_v21.RouteConfiguration { + if m != nil { + return m.StaticRouteConfigs + } + return nil +} + +func (m *RouteConfigDump) GetDynamicRouteConfigs() []envoy_api_v21.RouteConfiguration { + if m != nil { + return m.DynamicRouteConfigs + } + return nil +} + +func init() { + proto.RegisterType((*ConfigDump)(nil), "envoy.admin.v2.ConfigDump") + proto.RegisterType((*RouteConfigDump)(nil), "envoy.admin.v2.RouteConfigDump") +} +func (m *ConfigDump) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConfigDump) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Configs) > 0 { + for k, _ := range m.Configs { + dAtA[i] = 0xa + i++ + v := m.Configs[k] + msgSize := 0 + if (&v) != nil { + msgSize = (&v).Size() + msgSize += 1 + sovConfigDump(uint64(msgSize)) + } + mapSize := 1 + len(k) + sovConfigDump(uint64(len(k))) + msgSize + i = encodeVarintConfigDump(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintConfigDump(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintConfigDump(dAtA, i, uint64((&v).Size())) + n1, err := (&v).MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + } + return i, nil +} + +func (m *RouteConfigDump) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RouteConfigDump) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.StaticRouteConfigs) > 0 { + for _, msg := range m.StaticRouteConfigs { + dAtA[i] = 0xa + i++ + i = encodeVarintConfigDump(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.DynamicRouteConfigs) > 0 { + for _, msg := range m.DynamicRouteConfigs { + dAtA[i] = 0x12 + i++ + i = encodeVarintConfigDump(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func encodeVarintConfigDump(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *ConfigDump) Size() (n int) { + var l int + _ = l + if len(m.Configs) > 0 { + for k, v := range m.Configs { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovConfigDump(uint64(len(k))) + 1 + l + sovConfigDump(uint64(l)) + n += mapEntrySize + 1 + sovConfigDump(uint64(mapEntrySize)) + } + } + return n +} + +func (m *RouteConfigDump) Size() (n int) { + var l int + _ = l + if len(m.StaticRouteConfigs) > 0 { + for _, e := range m.StaticRouteConfigs { + l = e.Size() + n += 1 + l + sovConfigDump(uint64(l)) + } + } + if len(m.DynamicRouteConfigs) > 0 { + for _, e := range m.DynamicRouteConfigs { + l = e.Size() + n += 1 + l + sovConfigDump(uint64(l)) + } + } + return n +} + +func sovConfigDump(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozConfigDump(x uint64) (n int) { + return sovConfigDump(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ConfigDump) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfigDump + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfigDump: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigDump: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfigDump + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfigDump + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Configs == nil { + m.Configs = make(map[string]google_protobuf.Any) + } + var mapkey string + mapvalue := &google_protobuf.Any{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfigDump + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfigDump + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthConfigDump + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfigDump + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthConfigDump + } + postmsgIndex := iNdEx + mapmsglen + if mapmsglen < 0 { + return ErrInvalidLengthConfigDump + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &google_protobuf.Any{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipConfigDump(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConfigDump + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Configs[mapkey] = *mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfigDump(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConfigDump + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RouteConfigDump) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfigDump + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RouteConfigDump: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RouteConfigDump: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StaticRouteConfigs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfigDump + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfigDump + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StaticRouteConfigs = append(m.StaticRouteConfigs, envoy_api_v21.RouteConfiguration{}) + if err := m.StaticRouteConfigs[len(m.StaticRouteConfigs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DynamicRouteConfigs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfigDump + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfigDump + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DynamicRouteConfigs = append(m.DynamicRouteConfigs, envoy_api_v21.RouteConfiguration{}) + if err := m.DynamicRouteConfigs[len(m.DynamicRouteConfigs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfigDump(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConfigDump + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipConfigDump(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfigDump + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfigDump + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfigDump + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthConfigDump + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfigDump + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipConfigDump(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthConfigDump = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowConfigDump = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("envoy/admin/v2/config_dump.proto", fileDescriptorConfigDump) } + +var fileDescriptorConfigDump = []byte{ + // 311 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x8f, 0xb1, 0x4e, 0xf3, 0x30, + 0x14, 0x85, 0x7f, 0xb7, 0x3f, 0x20, 0xdc, 0x0a, 0x90, 0x29, 0xa8, 0x64, 0x08, 0x51, 0x17, 0x22, + 0x06, 0x5b, 0x0a, 0x0b, 0x62, 0xa3, 0x80, 0x58, 0x51, 0x26, 0xc4, 0x12, 0xb9, 0x4d, 0x1a, 0x59, + 0x34, 0x76, 0x94, 0xd8, 0x91, 0xfc, 0x44, 0x3c, 0x0a, 0x1d, 0x79, 0x02, 0x84, 0xf2, 0x24, 0x28, + 0x76, 0x22, 0x52, 0x31, 0xb1, 0x1d, 0xdd, 0x73, 0xee, 0x77, 0xcf, 0x85, 0x5e, 0xc2, 0x2b, 0xa1, + 0x09, 0x8d, 0x33, 0xc6, 0x49, 0x15, 0x90, 0xa5, 0xe0, 0x2b, 0x96, 0x46, 0xb1, 0xca, 0x72, 0x9c, + 0x17, 0x42, 0x0a, 0x74, 0x60, 0x12, 0xd8, 0x24, 0x70, 0x15, 0x38, 0x67, 0xa9, 0x10, 0xe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xbb, 0x60, 0xb1, 0x6b, 0x1e, 0xbe, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x2a, + 0x10, 0xc8, 0xf0, 0x05, 0x02, 0x00, 0x00, +} diff --git a/github.com/envoyproxy/go-control-plane/envoy/admin/v2/config_dump.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/admin/v2/config_dump.pb.validate.go new file mode 100644 index 00000000..a394987f --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/admin/v2/config_dump.pb.validate.go @@ -0,0 +1,150 @@ +// Code generated by protoc-gen-validate +// source: envoy/admin/v2/config_dump.proto +// DO NOT EDIT!!! + +package envoy_admin_v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on ConfigDump with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *ConfigDump) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Configs + + return nil +} + +// ConfigDumpValidationError is the validation error returned by +// ConfigDump.Validate if the designated constraints aren't met. +type ConfigDumpValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ConfigDumpValidationError) 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 %sConfigDump.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ConfigDumpValidationError{} + +// Validate checks the field values on RouteConfigDump with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *RouteConfigDump) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetStaticRouteConfigs() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteConfigDumpValidationError{ + Field: fmt.Sprintf("StaticRouteConfigs[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetDynamicRouteConfigs() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteConfigDumpValidationError{ + Field: fmt.Sprintf("DynamicRouteConfigs[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// RouteConfigDumpValidationError is the validation error returned by +// RouteConfigDump.Validate if the designated constraints aren't met. +type RouteConfigDumpValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteConfigDumpValidationError) 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 %sRouteConfigDump.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteConfigDumpValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/auth/auth.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/auth/auth.pb.validate.go new file mode 100644 index 00000000..448be5d5 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/auth/auth.pb.validate.go @@ -0,0 +1,341 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/auth/auth.proto +// DO NOT EDIT!!! + +package auth + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on AuthAction with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *AuthAction) Validate() error { + if m == nil { + return nil + } + + // no validation rules for ActionType + + for idx, item := range m.GetRules() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AuthActionValidationError{ + Field: fmt.Sprintf("Rules[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// AuthActionValidationError is the validation error returned by +// AuthAction.Validate if the designated constraints aren't met. +type AuthActionValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AuthActionValidationError) 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 %sAuthAction.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AuthActionValidationError{} + +// Validate checks the field values on AuthAction_AndRule with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *AuthAction_AndRule) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetRules() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AuthAction_AndRuleValidationError{ + Field: fmt.Sprintf("Rules[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// AuthAction_AndRuleValidationError is the validation error returned by +// AuthAction_AndRule.Validate if the designated constraints aren't met. +type AuthAction_AndRuleValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AuthAction_AndRuleValidationError) 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 %sAuthAction_AndRule.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AuthAction_AndRuleValidationError{} + +// Validate checks the field values on AuthAction_OrRule with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *AuthAction_OrRule) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetRules() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AuthAction_OrRuleValidationError{ + Field: fmt.Sprintf("Rules[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// AuthAction_OrRuleValidationError is the validation error returned by +// AuthAction_OrRule.Validate if the designated constraints aren't met. +type AuthAction_OrRuleValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AuthAction_OrRuleValidationError) 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 %sAuthAction_OrRule.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AuthAction_OrRuleValidationError{} + +// Validate checks the field values on AuthAction_X509Rule with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *AuthAction_X509Rule) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetValidationContext()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AuthAction_X509RuleValidationError{ + Field: "ValidationContext", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// AuthAction_X509RuleValidationError is the validation error returned by +// AuthAction_X509Rule.Validate if the designated constraints aren't met. +type AuthAction_X509RuleValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AuthAction_X509RuleValidationError) 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 %sAuthAction_X509Rule.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AuthAction_X509RuleValidationError{} + +// Validate checks the field values on AuthAction_Rule with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *AuthAction_Rule) Validate() error { + if m == nil { + return nil + } + + switch m.RuleSpecifier.(type) { + + case *AuthAction_Rule_AndRule: + + if v, ok := interface{}(m.GetAndRule()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AuthAction_RuleValidationError{ + Field: "AndRule", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *AuthAction_Rule_OrRule: + + if v, ok := interface{}(m.GetOrRule()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AuthAction_RuleValidationError{ + Field: "OrRule", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *AuthAction_Rule_X509Rule: + + if v, ok := interface{}(m.GetX509Rule()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AuthAction_RuleValidationError{ + Field: "X509Rule", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// AuthAction_RuleValidationError is the validation error returned by +// AuthAction_Rule.Validate if the designated constraints aren't met. +type AuthAction_RuleValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AuthAction_RuleValidationError) 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 %sAuthAction_Rule.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AuthAction_RuleValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/auth/cert.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/auth/cert.pb.validate.go new file mode 100644 index 00000000..accfe7fd --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/auth/cert.pb.validate.go @@ -0,0 +1,768 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/auth/cert.proto +// DO NOT EDIT!!! + +package auth + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on TlsParameters with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *TlsParameters) Validate() error { + if m == nil { + return nil + } + + if _, ok := TlsParameters_TlsProtocol_name[int32(m.GetTlsMinimumProtocolVersion())]; !ok { + return TlsParametersValidationError{ + Field: "TlsMinimumProtocolVersion", + Reason: "value must be one of the defined enum values", + } + } + + if _, ok := TlsParameters_TlsProtocol_name[int32(m.GetTlsMaximumProtocolVersion())]; !ok { + return TlsParametersValidationError{ + Field: "TlsMaximumProtocolVersion", + Reason: "value must be one of the defined enum values", + } + } + + return nil +} + +// TlsParametersValidationError is the validation error returned by +// TlsParameters.Validate if the designated constraints aren't met. +type TlsParametersValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TlsParametersValidationError) 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 %sTlsParameters.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TlsParametersValidationError{} + +// Validate checks the field values on TlsCertificate with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *TlsCertificate) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetCertificateChain()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TlsCertificateValidationError{ + Field: "CertificateChain", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetPrivateKey()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TlsCertificateValidationError{ + Field: "PrivateKey", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetPassword()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TlsCertificateValidationError{ + Field: "Password", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetOcspStaple()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TlsCertificateValidationError{ + Field: "OcspStaple", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetSignedCertificateTimestamp() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TlsCertificateValidationError{ + Field: fmt.Sprintf("SignedCertificateTimestamp[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// TlsCertificateValidationError is the validation error returned by +// TlsCertificate.Validate if the designated constraints aren't met. +type TlsCertificateValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TlsCertificateValidationError) 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 %sTlsCertificate.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TlsCertificateValidationError{} + +// Validate checks the field values on TlsSessionTicketKeys with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *TlsSessionTicketKeys) Validate() error { + if m == nil { + return nil + } + + if len(m.GetKeys()) < 1 { + return TlsSessionTicketKeysValidationError{ + Field: "Keys", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetKeys() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TlsSessionTicketKeysValidationError{ + Field: fmt.Sprintf("Keys[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// TlsSessionTicketKeysValidationError is the validation error returned by +// TlsSessionTicketKeys.Validate if the designated constraints aren't met. +type TlsSessionTicketKeysValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TlsSessionTicketKeysValidationError) 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 %sTlsSessionTicketKeys.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TlsSessionTicketKeysValidationError{} + +// Validate checks the field values on CertificateValidationContext with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CertificateValidationContext) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetTrustedCa()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CertificateValidationContextValidationError{ + Field: "TrustedCa", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRequireOcspStaple()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CertificateValidationContextValidationError{ + Field: "RequireOcspStaple", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRequireSignedCertificateTimestamp()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CertificateValidationContextValidationError{ + Field: "RequireSignedCertificateTimestamp", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetCrl()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CertificateValidationContextValidationError{ + Field: "Crl", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// CertificateValidationContextValidationError is the validation error returned +// by CertificateValidationContext.Validate if the designated constraints +// aren't met. +type CertificateValidationContextValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CertificateValidationContextValidationError) 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 %sCertificateValidationContext.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CertificateValidationContextValidationError{} + +// Validate checks the field values on CommonTlsContext with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *CommonTlsContext) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetTlsParams()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonTlsContextValidationError{ + Field: "TlsParams", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if len(m.GetTlsCertificates()) > 1 { + return CommonTlsContextValidationError{ + Field: "TlsCertificates", + Reason: "value must contain no more than 1 item(s)", + } + } + + for idx, item := range m.GetTlsCertificates() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonTlsContextValidationError{ + Field: fmt.Sprintf("TlsCertificates[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetTlsCertificateSdsSecretConfigs() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonTlsContextValidationError{ + Field: fmt.Sprintf("TlsCertificateSdsSecretConfigs[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetValidationContext()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonTlsContextValidationError{ + Field: "ValidationContext", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDeprecatedV1()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonTlsContextValidationError{ + Field: "DeprecatedV1", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// CommonTlsContextValidationError is the validation error returned by +// CommonTlsContext.Validate if the designated constraints aren't met. +type CommonTlsContextValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CommonTlsContextValidationError) 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 %sCommonTlsContext.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CommonTlsContextValidationError{} + +// Validate checks the field values on UpstreamTlsContext with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *UpstreamTlsContext) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetCommonTlsContext()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpstreamTlsContextValidationError{ + Field: "CommonTlsContext", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for Sni + + return nil +} + +// UpstreamTlsContextValidationError is the validation error returned by +// UpstreamTlsContext.Validate if the designated constraints aren't met. +type UpstreamTlsContextValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e UpstreamTlsContextValidationError) 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 %sUpstreamTlsContext.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = UpstreamTlsContextValidationError{} + +// Validate checks the field values on DownstreamTlsContext with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *DownstreamTlsContext) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetCommonTlsContext()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DownstreamTlsContextValidationError{ + Field: "CommonTlsContext", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRequireClientCertificate()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DownstreamTlsContextValidationError{ + Field: "RequireClientCertificate", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRequireSni()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DownstreamTlsContextValidationError{ + Field: "RequireSni", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + switch m.SessionTicketKeysType.(type) { + + case *DownstreamTlsContext_SessionTicketKeys: + + if v, ok := interface{}(m.GetSessionTicketKeys()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DownstreamTlsContextValidationError{ + Field: "SessionTicketKeys", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *DownstreamTlsContext_SessionTicketKeysSdsSecretConfig: + + if v, ok := interface{}(m.GetSessionTicketKeysSdsSecretConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DownstreamTlsContextValidationError{ + Field: "SessionTicketKeysSdsSecretConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// DownstreamTlsContextValidationError is the validation error returned by +// DownstreamTlsContext.Validate if the designated constraints aren't met. +type DownstreamTlsContextValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e DownstreamTlsContextValidationError) 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 %sDownstreamTlsContext.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = DownstreamTlsContextValidationError{} + +// Validate checks the field values on SdsSecretConfig with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *SdsSecretConfig) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + if v, ok := interface{}(m.GetSdsConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SdsSecretConfigValidationError{ + Field: "SdsConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// SdsSecretConfigValidationError is the validation error returned by +// SdsSecretConfig.Validate if the designated constraints aren't met. +type SdsSecretConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e SdsSecretConfigValidationError) 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 %sSdsSecretConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = SdsSecretConfigValidationError{} + +// Validate checks the field values on Secret with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Secret) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + switch m.Type.(type) { + + case *Secret_TlsCertificate: + + if v, ok := interface{}(m.GetTlsCertificate()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SecretValidationError{ + Field: "TlsCertificate", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *Secret_SessionTicketKeys: + + if v, ok := interface{}(m.GetSessionTicketKeys()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SecretValidationError{ + Field: "SessionTicketKeys", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// SecretValidationError is the validation error returned by Secret.Validate if +// the designated constraints aren't met. +type SecretValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e SecretValidationError) 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 %sSecret.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = SecretValidationError{} + +// Validate checks the field values on CommonTlsContext_DeprecatedV1 with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CommonTlsContext_DeprecatedV1) Validate() error { + if m == nil { + return nil + } + + // no validation rules for AltAlpnProtocols + + return nil +} + +// CommonTlsContext_DeprecatedV1ValidationError is the validation error +// returned by CommonTlsContext_DeprecatedV1.Validate if the designated +// constraints aren't met. +type CommonTlsContext_DeprecatedV1ValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CommonTlsContext_DeprecatedV1ValidationError) 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 %sCommonTlsContext_DeprecatedV1.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CommonTlsContext_DeprecatedV1ValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/cds.pb.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/cds.pb.go index 0a7ddee0..1edfbc56 100644 --- a/github.com/envoyproxy/go-control-plane/envoy/api/v2/cds.pb.go +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/cds.pb.go @@ -841,6 +841,10 @@ type Cluster_CommonLbConfig struct { // .. note:: // The specified percent will be truncated to the nearest 1%. HealthyPanicThreshold *envoy_type.Percent `protobuf:"bytes,1,opt,name=healthy_panic_threshold,json=healthyPanicThreshold" json:"healthy_panic_threshold,omitempty"` + // Types that are valid to be assigned to LocalityConfigSpecifier: + // *Cluster_CommonLbConfig_ZoneAwareLbConfig_ + // *Cluster_CommonLbConfig_LocalityWeightedLbConfig_ + LocalityConfigSpecifier isCluster_CommonLbConfig_LocalityConfigSpecifier `protobuf_oneof:"locality_config_specifier"` } func (m *Cluster_CommonLbConfig) Reset() { *m = Cluster_CommonLbConfig{} } @@ -848,6 +852,31 @@ func (m *Cluster_CommonLbConfig) String() string { return proto.Compa func (*Cluster_CommonLbConfig) ProtoMessage() {} func (*Cluster_CommonLbConfig) Descriptor() ([]byte, []int) { return fileDescriptorCds, []int{0, 3} } +type isCluster_CommonLbConfig_LocalityConfigSpecifier interface { + isCluster_CommonLbConfig_LocalityConfigSpecifier() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type Cluster_CommonLbConfig_ZoneAwareLbConfig_ struct { + ZoneAwareLbConfig *Cluster_CommonLbConfig_ZoneAwareLbConfig `protobuf:"bytes,2,opt,name=zone_aware_lb_config,json=zoneAwareLbConfig,oneof"` +} +type Cluster_CommonLbConfig_LocalityWeightedLbConfig_ struct { + LocalityWeightedLbConfig *Cluster_CommonLbConfig_LocalityWeightedLbConfig `protobuf:"bytes,3,opt,name=locality_weighted_lb_config,json=localityWeightedLbConfig,oneof"` +} + +func (*Cluster_CommonLbConfig_ZoneAwareLbConfig_) isCluster_CommonLbConfig_LocalityConfigSpecifier() {} +func (*Cluster_CommonLbConfig_LocalityWeightedLbConfig_) isCluster_CommonLbConfig_LocalityConfigSpecifier() { +} + +func (m *Cluster_CommonLbConfig) GetLocalityConfigSpecifier() isCluster_CommonLbConfig_LocalityConfigSpecifier { + if m != nil { + return m.LocalityConfigSpecifier + } + return nil +} + func (m *Cluster_CommonLbConfig) GetHealthyPanicThreshold() *envoy_type.Percent { if m != nil { return m.HealthyPanicThreshold @@ -855,6 +884,97 @@ func (m *Cluster_CommonLbConfig) GetHealthyPanicThreshold() *envoy_type.Percent return nil } +func (m *Cluster_CommonLbConfig) GetZoneAwareLbConfig() *Cluster_CommonLbConfig_ZoneAwareLbConfig { + if x, ok := m.GetLocalityConfigSpecifier().(*Cluster_CommonLbConfig_ZoneAwareLbConfig_); ok { + return x.ZoneAwareLbConfig + } + return nil +} + +func (m *Cluster_CommonLbConfig) GetLocalityWeightedLbConfig() *Cluster_CommonLbConfig_LocalityWeightedLbConfig { + if x, ok := m.GetLocalityConfigSpecifier().(*Cluster_CommonLbConfig_LocalityWeightedLbConfig_); ok { + return x.LocalityWeightedLbConfig + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Cluster_CommonLbConfig) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Cluster_CommonLbConfig_OneofMarshaler, _Cluster_CommonLbConfig_OneofUnmarshaler, _Cluster_CommonLbConfig_OneofSizer, []interface{}{ + (*Cluster_CommonLbConfig_ZoneAwareLbConfig_)(nil), + (*Cluster_CommonLbConfig_LocalityWeightedLbConfig_)(nil), + } +} + +func _Cluster_CommonLbConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Cluster_CommonLbConfig) + // locality_config_specifier + switch x := m.LocalityConfigSpecifier.(type) { + case *Cluster_CommonLbConfig_ZoneAwareLbConfig_: + _ = b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ZoneAwareLbConfig); err != nil { + return err + } + case *Cluster_CommonLbConfig_LocalityWeightedLbConfig_: + _ = b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.LocalityWeightedLbConfig); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Cluster_CommonLbConfig.LocalityConfigSpecifier has unexpected type %T", x) + } + return nil +} + +func _Cluster_CommonLbConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Cluster_CommonLbConfig) + switch tag { + case 2: // locality_config_specifier.zone_aware_lb_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Cluster_CommonLbConfig_ZoneAwareLbConfig) + err := b.DecodeMessage(msg) + m.LocalityConfigSpecifier = &Cluster_CommonLbConfig_ZoneAwareLbConfig_{msg} + return true, err + case 3: // locality_config_specifier.locality_weighted_lb_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Cluster_CommonLbConfig_LocalityWeightedLbConfig) + err := b.DecodeMessage(msg) + m.LocalityConfigSpecifier = &Cluster_CommonLbConfig_LocalityWeightedLbConfig_{msg} + return true, err + default: + return false, nil + } +} + +func _Cluster_CommonLbConfig_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Cluster_CommonLbConfig) + // locality_config_specifier + switch x := m.LocalityConfigSpecifier.(type) { + case *Cluster_CommonLbConfig_ZoneAwareLbConfig_: + s := proto.Size(x.ZoneAwareLbConfig) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Cluster_CommonLbConfig_LocalityWeightedLbConfig_: + s := proto.Size(x.LocalityWeightedLbConfig) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Configuration for :ref:`zone aware routing +// `. +// [#not-implemented-hide:] type Cluster_CommonLbConfig_ZoneAwareLbConfig struct { // [#not-implemented-hide:] // Configures percentage of requests that will be considered for zone aware routing @@ -894,6 +1014,23 @@ func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) GetMinClusterSize() *google_p return nil } +// Configuration for :ref:`locality weighted load balancing +// ` +// [#not-implemented-hide:] +type Cluster_CommonLbConfig_LocalityWeightedLbConfig struct { +} + +func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) Reset() { + *m = Cluster_CommonLbConfig_LocalityWeightedLbConfig{} +} +func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) String() string { + return proto.CompactTextString(m) +} +func (*Cluster_CommonLbConfig_LocalityWeightedLbConfig) ProtoMessage() {} +func (*Cluster_CommonLbConfig_LocalityWeightedLbConfig) Descriptor() ([]byte, []int) { + return fileDescriptorCds, []int{0, 3, 1} +} + // An extensible structure containing the address Envoy should bind to when // establishing upstream connections. type UpstreamBindConfig struct { @@ -922,6 +1059,7 @@ func init() { proto.RegisterType((*Cluster_RingHashLbConfig_DeprecatedV1)(nil), "envoy.api.v2.Cluster.RingHashLbConfig.DeprecatedV1") proto.RegisterType((*Cluster_CommonLbConfig)(nil), "envoy.api.v2.Cluster.CommonLbConfig") proto.RegisterType((*Cluster_CommonLbConfig_ZoneAwareLbConfig)(nil), "envoy.api.v2.Cluster.CommonLbConfig.ZoneAwareLbConfig") + proto.RegisterType((*Cluster_CommonLbConfig_LocalityWeightedLbConfig)(nil), "envoy.api.v2.Cluster.CommonLbConfig.LocalityWeightedLbConfig") proto.RegisterType((*UpstreamBindConfig)(nil), "envoy.api.v2.UpstreamBindConfig") proto.RegisterEnum("envoy.api.v2.Cluster_DiscoveryType", Cluster_DiscoveryType_name, Cluster_DiscoveryType_value) proto.RegisterEnum("envoy.api.v2.Cluster_LbPolicy", Cluster_LbPolicy_name, Cluster_LbPolicy_value) @@ -1300,6 +1438,75 @@ func (this *Cluster_CommonLbConfig) Equal(that interface{}) bool { if !this.HealthyPanicThreshold.Equal(that1.HealthyPanicThreshold) { return false } + if that1.LocalityConfigSpecifier == nil { + if this.LocalityConfigSpecifier != nil { + return false + } + } else if this.LocalityConfigSpecifier == nil { + return false + } else if !this.LocalityConfigSpecifier.Equal(that1.LocalityConfigSpecifier) { + return false + } + return true +} +func (this *Cluster_CommonLbConfig_ZoneAwareLbConfig_) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Cluster_CommonLbConfig_ZoneAwareLbConfig_) + if !ok { + that2, ok := that.(Cluster_CommonLbConfig_ZoneAwareLbConfig_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.ZoneAwareLbConfig.Equal(that1.ZoneAwareLbConfig) { + return false + } + return true +} +func (this *Cluster_CommonLbConfig_LocalityWeightedLbConfig_) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Cluster_CommonLbConfig_LocalityWeightedLbConfig_) + if !ok { + that2, ok := that.(Cluster_CommonLbConfig_LocalityWeightedLbConfig_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.LocalityWeightedLbConfig.Equal(that1.LocalityWeightedLbConfig) { + return false + } return true } func (this *Cluster_CommonLbConfig_ZoneAwareLbConfig) Equal(that interface{}) bool { @@ -1335,6 +1542,33 @@ func (this *Cluster_CommonLbConfig_ZoneAwareLbConfig) Equal(that interface{}) bo } return true } +func (this *Cluster_CommonLbConfig_LocalityWeightedLbConfig) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Cluster_CommonLbConfig_LocalityWeightedLbConfig) + if !ok { + that2, ok := that.(Cluster_CommonLbConfig_LocalityWeightedLbConfig) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + return true +} func (this *UpstreamBindConfig) Equal(that interface{}) bool { if that == nil { if this == nil { @@ -2010,9 +2244,44 @@ func (m *Cluster_CommonLbConfig) MarshalTo(dAtA []byte) (int, error) { } i += n25 } + if m.LocalityConfigSpecifier != nil { + nn26, err := m.LocalityConfigSpecifier.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += nn26 + } return i, nil } +func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig_) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.ZoneAwareLbConfig != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintCds(dAtA, i, uint64(m.ZoneAwareLbConfig.Size())) + n27, err := m.ZoneAwareLbConfig.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n27 + } + return i, nil +} +func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig_) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.LocalityWeightedLbConfig != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintCds(dAtA, i, uint64(m.LocalityWeightedLbConfig.Size())) + n28, err := m.LocalityWeightedLbConfig.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n28 + } + return i, nil +} func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2032,22 +2301,40 @@ func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) MarshalTo(dAtA []byte) (int, dAtA[i] = 0xa i++ i = encodeVarintCds(dAtA, i, uint64(m.RoutingEnabled.Size())) - n26, err := m.RoutingEnabled.MarshalTo(dAtA[i:]) + n29, err := m.RoutingEnabled.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n26 + i += n29 } if m.MinClusterSize != nil { dAtA[i] = 0x12 i++ i = encodeVarintCds(dAtA, i, uint64(m.MinClusterSize.Size())) - n27, err := m.MinClusterSize.MarshalTo(dAtA[i:]) + n30, err := m.MinClusterSize.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n27 + i += n30 + } + return i, nil +} + +func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l return i, nil } @@ -2070,11 +2357,11 @@ func (m *UpstreamBindConfig) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintCds(dAtA, i, uint64(m.SourceAddress.Size())) - n28, err := m.SourceAddress.MarshalTo(dAtA[i:]) + n31, err := m.SourceAddress.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n28 + i += n31 } return i, nil } @@ -2286,9 +2573,30 @@ func (m *Cluster_CommonLbConfig) Size() (n int) { l = m.HealthyPanicThreshold.Size() n += 1 + l + sovCds(uint64(l)) } + if m.LocalityConfigSpecifier != nil { + n += m.LocalityConfigSpecifier.Size() + } return n } +func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig_) Size() (n int) { + var l int + _ = l + if m.ZoneAwareLbConfig != nil { + l = m.ZoneAwareLbConfig.Size() + n += 1 + l + sovCds(uint64(l)) + } + return n +} +func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig_) Size() (n int) { + var l int + _ = l + if m.LocalityWeightedLbConfig != nil { + l = m.LocalityWeightedLbConfig.Size() + n += 1 + l + sovCds(uint64(l)) + } + return n +} func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) Size() (n int) { var l int _ = l @@ -2303,6 +2611,12 @@ func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) Size() (n int) { return n } +func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) Size() (n int) { + var l int + _ = l + return n +} + func (m *UpstreamBindConfig) Size() (n int) { var l int _ = l @@ -3778,6 +4092,70 @@ func (m *Cluster_CommonLbConfig) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ZoneAwareLbConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCds + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCds + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Cluster_CommonLbConfig_ZoneAwareLbConfig{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.LocalityConfigSpecifier = &Cluster_CommonLbConfig_ZoneAwareLbConfig_{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalityWeightedLbConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCds + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCds + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Cluster_CommonLbConfig_LocalityWeightedLbConfig{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.LocalityConfigSpecifier = &Cluster_CommonLbConfig_LocalityWeightedLbConfig_{v} + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCds(dAtA[iNdEx:]) @@ -3915,6 +4293,56 @@ func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) Unmarshal(dAtA []byte) error } return nil } +func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCds + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LocalityWeightedLbConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LocalityWeightedLbConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipCds(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCds + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *UpstreamBindConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4106,123 +4534,128 @@ var ( func init() { proto.RegisterFile("envoy/api/v2/cds.proto", fileDescriptorCds) } var fileDescriptorCds = []byte{ - // 1875 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x73, 0xdb, 0xc6, - 0x15, 0x17, 0x28, 0xda, 0x96, 0x9e, 0x44, 0x12, 0x5a, 0xd9, 0x16, 0x4c, 0xd9, 0xb2, 0xcc, 0xc6, - 0xa9, 0xc6, 0xd3, 0x21, 0x63, 0x3a, 0x49, 0x67, 0xd2, 0x4c, 0x3a, 0xfc, 0x27, 0x89, 0x09, 0x4d, - 0xaa, 0x00, 0x28, 0x4d, 0x9a, 0x7a, 0xb6, 0x4b, 0x60, 0x29, 0xa2, 0x02, 0x01, 0x14, 0xbb, 0x50, - 0xac, 0x1c, 0x73, 0xca, 0xbd, 0x97, 0xf6, 0xd0, 0x7b, 0xa7, 0x1f, 0xa1, 0xa7, 0x1e, 0x73, 0xec, - 0x4c, 0xcf, 0xfd, 0x33, 0x9e, 0xce, 0x74, 0xfa, 0x11, 0x7a, 0xeb, 0x60, 0xb1, 0xa0, 0x45, 0x0a, - 0x72, 0x9c, 0x99, 0x9e, 0x88, 0x7d, 0xef, 0xf7, 0x7e, 0xfb, 0xf6, 0xed, 0xdb, 0xb7, 0x6f, 0x09, - 0x77, 0xa9, 0x77, 0xee, 0x5f, 0xd4, 0x48, 0xe0, 0xd4, 0xce, 0xeb, 0x35, 0xcb, 0x66, 0xd5, 0x20, - 0xf4, 0xb9, 0x8f, 0xd6, 0x85, 0xbc, 0x4a, 0x02, 0xa7, 0x7a, 0x5e, 0x2f, 0x3f, 0x9c, 0x47, 0xf9, - 0x21, 0xad, 0x11, 0xdb, 0x0e, 0x29, 0x93, 0xf0, 0xf2, 0xfd, 0x39, 0x00, 0x89, 0xf8, 0xa4, 0x66, - 0xd1, 0x90, 0x67, 0x6a, 0x85, 0xf9, 0x88, 0x30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 0x41, 0x61, 0x9f, - 0x72, 0x6b, 0xf2, 0xff, 0xe3, 0x7d, 0xf4, 0xf5, 0x5f, 0xff, 0xf5, 0x9b, 0xdc, 0x76, 0xe5, 0xee, - 0xdc, 0x7f, 0x10, 0x1f, 0xc9, 0x14, 0x67, 0x1f, 0x29, 0x4f, 0x9a, 0x9b, 0x7f, 0x78, 0xb5, 0xa3, - 0x7c, 0xfb, 0x6a, 0x47, 0xf9, 0xcb, 0xab, 0x1d, 0xe5, 0x9f, 0xaf, 0x76, 0x94, 0x6f, 0x14, 0x65, - 0x74, 0x53, 0x24, 0xfa, 0xb3, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xe3, 0x8a, 0x2c, 0x6f, - 0x11, 0x00, 0x00, + // 1959 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x6f, 0xdb, 0xc8, + 0x15, 0x37, 0x65, 0x25, 0xb1, 0x9f, 0x2d, 0x89, 0x1e, 0x27, 0x31, 0x23, 0x27, 0x8e, 0xa3, 0x6e, + 0xb6, 0x46, 0x50, 0xc8, 0x1b, 0x67, 0x37, 0x05, 0xb6, 0xdb, 0x2d, 0xf4, 0xcf, 0xb6, 0x76, 0x15, + 0xc9, 0x25, 0xe9, 0x18, 0xdb, 0x6d, 0x30, 0x1d, 0x91, 0x23, 0x8b, 0x35, 0x45, 0xb2, 0x9c, 0xa1, + 0x13, 0xe7, 0x50, 0xa0, 0x7b, 0xda, 0x7b, 0x2f, 0xed, 0x61, 0xef, 0x45, 0x3f, 0x42, 0x4f, 0x3d, + 0xee, 0xb1, 0x40, 0xef, 0x6d, 0x11, 0x14, 0x28, 0xfa, 0x2d, 0x0a, 0x0e, 0x87, 0x8a, 0xfe, 0xd0, + 0x59, 0x2f, 0xd0, 0x93, 0x38, 0xef, 0xfd, 0xde, 0x6f, 0xe6, 0xbd, 0x79, 0xef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 0x37, 0x5b, 0xca, 0xdf, 0xde, 0x6c, 0x29, 0xff, 0x7a, 0xb3, + 0xa5, 0x7c, 0xad, 0x28, 0xfd, 0xeb, 0xa2, 0x42, 0x9e, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x9f, + 0xca, 0x29, 0x6d, 0x93, 0x12, 0x00, 0x00, } diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/cds.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/cds.pb.validate.go new file mode 100644 index 00000000..60c73cf2 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/cds.pb.validate.go @@ -0,0 +1,877 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/cds.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Cluster with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Cluster) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return ClusterValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for AltStatName + + if _, ok := Cluster_DiscoveryType_name[int32(m.GetType())]; !ok { + return ClusterValidationError{ + Field: "Type", + Reason: "value must be one of the defined enum values", + } + } + + if v, ok := interface{}(m.GetEdsClusterConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "EdsClusterConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if true { + dur := m.GetConnectTimeout() + + gt := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur <= gt { + return ClusterValidationError{ + Field: "ConnectTimeout", + Reason: "value must be greater than 0s", + } + } + + } + + if v, ok := interface{}(m.GetPerConnectionBufferLimitBytes()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "PerConnectionBufferLimitBytes", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if _, ok := Cluster_LbPolicy_name[int32(m.GetLbPolicy())]; !ok { + return ClusterValidationError{ + Field: "LbPolicy", + Reason: "value must be one of the defined enum values", + } + } + + for idx, item := range m.GetHosts() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: fmt.Sprintf("Hosts[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetHealthChecks() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: fmt.Sprintf("HealthChecks[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetMaxRequestsPerConnection()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "MaxRequestsPerConnection", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetCircuitBreakers()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "CircuitBreakers", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTlsContext()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "TlsContext", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetCommonHttpProtocolOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "CommonHttpProtocolOptions", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetHttpProtocolOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "HttpProtocolOptions", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "Http2ProtocolOptions", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if d := m.GetDnsRefreshRate(); d != nil { + dur := *d + + gt := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur <= gt { + return ClusterValidationError{ + Field: "DnsRefreshRate", + Reason: "value must be greater than 0s", + } + } + + } + + if _, ok := Cluster_DnsLookupFamily_name[int32(m.GetDnsLookupFamily())]; !ok { + return ClusterValidationError{ + Field: "DnsLookupFamily", + Reason: "value must be one of the defined enum values", + } + } + + for idx, item := range m.GetDnsResolvers() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: fmt.Sprintf("DnsResolvers[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetOutlierDetection()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "OutlierDetection", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if d := m.GetCleanupInterval(); d != nil { + dur := *d + + gt := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur <= gt { + return ClusterValidationError{ + Field: "CleanupInterval", + Reason: "value must be greater than 0s", + } + } + + } + + if v, ok := interface{}(m.GetUpstreamBindConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "UpstreamBindConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetLbSubsetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "LbSubsetConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetCommonLbConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "CommonLbConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTransportSocket()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "TransportSocket", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "Metadata", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for ProtocolSelection + + switch m.LbConfig.(type) { + + case *Cluster_RingHashLbConfig_: + + if v, ok := interface{}(m.GetRingHashLbConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterValidationError{ + Field: "RingHashLbConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// ClusterValidationError is the validation error returned by Cluster.Validate +// if the designated constraints aren't met. +type ClusterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ClusterValidationError) 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 %sCluster.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ClusterValidationError{} + +// Validate checks the field values on UpstreamBindConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *UpstreamBindConfig) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetSourceAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpstreamBindConfigValidationError{ + Field: "SourceAddress", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// UpstreamBindConfigValidationError is the validation error returned by +// UpstreamBindConfig.Validate if the designated constraints aren't met. +type UpstreamBindConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e UpstreamBindConfigValidationError) 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 %sUpstreamBindConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = UpstreamBindConfigValidationError{} + +// Validate checks the field values on Cluster_EdsClusterConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Cluster_EdsClusterConfig) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetEdsConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_EdsClusterConfigValidationError{ + Field: "EdsConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for ServiceName + + return nil +} + +// Cluster_EdsClusterConfigValidationError is the validation error returned by +// Cluster_EdsClusterConfig.Validate if the designated constraints aren't met. +type Cluster_EdsClusterConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Cluster_EdsClusterConfigValidationError) 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 %sCluster_EdsClusterConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Cluster_EdsClusterConfigValidationError{} + +// Validate checks the field values on Cluster_LbSubsetConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Cluster_LbSubsetConfig) Validate() error { + if m == nil { + return nil + } + + if _, ok := Cluster_LbSubsetConfig_LbSubsetFallbackPolicy_name[int32(m.GetFallbackPolicy())]; !ok { + return Cluster_LbSubsetConfigValidationError{ + Field: "FallbackPolicy", + Reason: "value must be one of the defined enum values", + } + } + + if v, ok := interface{}(m.GetDefaultSubset()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_LbSubsetConfigValidationError{ + Field: "DefaultSubset", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetSubsetSelectors() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_LbSubsetConfigValidationError{ + Field: fmt.Sprintf("SubsetSelectors[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// Cluster_LbSubsetConfigValidationError is the validation error returned by +// Cluster_LbSubsetConfig.Validate if the designated constraints aren't met. +type Cluster_LbSubsetConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Cluster_LbSubsetConfigValidationError) 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 %sCluster_LbSubsetConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Cluster_LbSubsetConfigValidationError{} + +// Validate checks the field values on Cluster_RingHashLbConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Cluster_RingHashLbConfig) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetMinimumRingSize()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_RingHashLbConfigValidationError{ + Field: "MinimumRingSize", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDeprecatedV1()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_RingHashLbConfigValidationError{ + Field: "DeprecatedV1", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// Cluster_RingHashLbConfigValidationError is the validation error returned by +// Cluster_RingHashLbConfig.Validate if the designated constraints aren't met. +type Cluster_RingHashLbConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Cluster_RingHashLbConfigValidationError) 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 %sCluster_RingHashLbConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Cluster_RingHashLbConfigValidationError{} + +// Validate checks the field values on Cluster_CommonLbConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Cluster_CommonLbConfig) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetHealthyPanicThreshold()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_CommonLbConfigValidationError{ + Field: "HealthyPanicThreshold", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + switch m.LocalityConfigSpecifier.(type) { + + case *Cluster_CommonLbConfig_ZoneAwareLbConfig_: + + if v, ok := interface{}(m.GetZoneAwareLbConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_CommonLbConfigValidationError{ + Field: "ZoneAwareLbConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *Cluster_CommonLbConfig_LocalityWeightedLbConfig_: + + if v, ok := interface{}(m.GetLocalityWeightedLbConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_CommonLbConfigValidationError{ + Field: "LocalityWeightedLbConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// Cluster_CommonLbConfigValidationError is the validation error returned by +// Cluster_CommonLbConfig.Validate if the designated constraints aren't met. +type Cluster_CommonLbConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Cluster_CommonLbConfigValidationError) 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 %sCluster_CommonLbConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Cluster_CommonLbConfigValidationError{} + +// Validate checks the field values on Cluster_LbSubsetConfig_LbSubsetSelector +// with the rules defined in the proto definition for this message. If any +// rules are violated, an error is returned. +func (m *Cluster_LbSubsetConfig_LbSubsetSelector) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// Cluster_LbSubsetConfig_LbSubsetSelectorValidationError is the validation +// error returned by Cluster_LbSubsetConfig_LbSubsetSelector.Validate if the +// designated constraints aren't met. +type Cluster_LbSubsetConfig_LbSubsetSelectorValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) 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 %sCluster_LbSubsetConfig_LbSubsetSelector.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Cluster_LbSubsetConfig_LbSubsetSelectorValidationError{} + +// Validate checks the field values on Cluster_RingHashLbConfig_DeprecatedV1 +// with the rules defined in the proto definition for this message. If any +// rules are violated, an error is returned. +func (m *Cluster_RingHashLbConfig_DeprecatedV1) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetUseStdHash()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_RingHashLbConfig_DeprecatedV1ValidationError{ + Field: "UseStdHash", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// Cluster_RingHashLbConfig_DeprecatedV1ValidationError is the validation error +// returned by Cluster_RingHashLbConfig_DeprecatedV1.Validate if the +// designated constraints aren't met. +type Cluster_RingHashLbConfig_DeprecatedV1ValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Cluster_RingHashLbConfig_DeprecatedV1ValidationError) 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 %sCluster_RingHashLbConfig_DeprecatedV1.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Cluster_RingHashLbConfig_DeprecatedV1ValidationError{} + +// Validate checks the field values on Cluster_CommonLbConfig_ZoneAwareLbConfig +// with the rules defined in the proto definition for this message. If any +// rules are violated, an error is returned. +func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetRoutingEnabled()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{ + Field: "RoutingEnabled", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMinClusterSize()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{ + Field: "MinClusterSize", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError is the validation +// error returned by Cluster_CommonLbConfig_ZoneAwareLbConfig.Validate if the +// designated constraints aren't met. +type Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) 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 %sCluster_CommonLbConfig_ZoneAwareLbConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{} + +// Validate checks the field values on +// Cluster_CommonLbConfig_LocalityWeightedLbConfig with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError is the +// validation error returned by +// Cluster_CommonLbConfig_LocalityWeightedLbConfig.Validate if the designated +// constraints aren't met. +type Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) 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 %sCluster_CommonLbConfig_LocalityWeightedLbConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/cluster/circuit_breaker.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/cluster/circuit_breaker.pb.validate.go new file mode 100644 index 00000000..20b3ac13 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/cluster/circuit_breaker.pb.validate.go @@ -0,0 +1,176 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/cluster/circuit_breaker.proto +// DO NOT EDIT!!! + +package cluster + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on CircuitBreakers with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *CircuitBreakers) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetThresholds() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CircuitBreakersValidationError{ + Field: fmt.Sprintf("Thresholds[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// CircuitBreakersValidationError is the validation error returned by +// CircuitBreakers.Validate if the designated constraints aren't met. +type CircuitBreakersValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CircuitBreakersValidationError) 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 %sCircuitBreakers.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CircuitBreakersValidationError{} + +// Validate checks the field values on CircuitBreakers_Thresholds with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CircuitBreakers_Thresholds) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Priority + + if v, ok := interface{}(m.GetMaxConnections()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CircuitBreakers_ThresholdsValidationError{ + Field: "MaxConnections", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMaxPendingRequests()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CircuitBreakers_ThresholdsValidationError{ + Field: "MaxPendingRequests", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMaxRequests()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CircuitBreakers_ThresholdsValidationError{ + Field: "MaxRequests", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMaxRetries()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CircuitBreakers_ThresholdsValidationError{ + Field: "MaxRetries", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// CircuitBreakers_ThresholdsValidationError is the validation error returned +// by CircuitBreakers_Thresholds.Validate if the designated constraints aren't met. +type CircuitBreakers_ThresholdsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CircuitBreakers_ThresholdsValidationError) 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 %sCircuitBreakers_Thresholds.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CircuitBreakers_ThresholdsValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/cluster/outlier_detection.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/cluster/outlier_detection.pb.validate.go new file mode 100644 index 00000000..5e9c820e --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/cluster/outlier_detection.pb.validate.go @@ -0,0 +1,213 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/cluster/outlier_detection.proto +// DO NOT EDIT!!! + +package cluster + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on OutlierDetection with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *OutlierDetection) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetConsecutive_5Xx()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OutlierDetectionValidationError{ + Field: "Consecutive_5Xx", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if d := m.GetInterval(); d != nil { + dur, err := types.DurationFromProto(d) + if err != nil { + return OutlierDetectionValidationError{ + Field: "Interval", + Reason: "value is not a valid duration", + Cause: err, + } + } + + gt := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur <= gt { + return OutlierDetectionValidationError{ + Field: "Interval", + Reason: "value must be greater than 0s", + } + } + + } + + if d := m.GetBaseEjectionTime(); d != nil { + dur, err := types.DurationFromProto(d) + if err != nil { + return OutlierDetectionValidationError{ + Field: "BaseEjectionTime", + Reason: "value is not a valid duration", + Cause: err, + } + } + + gt := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur <= gt { + return OutlierDetectionValidationError{ + Field: "BaseEjectionTime", + Reason: "value must be greater than 0s", + } + } + + } + + if wrapper := m.GetMaxEjectionPercent(); wrapper != nil { + + if wrapper.GetValue() > 100 { + return OutlierDetectionValidationError{ + Field: "MaxEjectionPercent", + Reason: "value must be less than or equal to 100", + } + } + + } + + if wrapper := m.GetEnforcingConsecutive_5Xx(); wrapper != nil { + + if wrapper.GetValue() > 100 { + return OutlierDetectionValidationError{ + Field: "EnforcingConsecutive_5Xx", + Reason: "value must be less than or equal to 100", + } + } + + } + + if wrapper := m.GetEnforcingSuccessRate(); wrapper != nil { + + if wrapper.GetValue() > 100 { + return OutlierDetectionValidationError{ + Field: "EnforcingSuccessRate", + Reason: "value must be less than or equal to 100", + } + } + + } + + if v, ok := interface{}(m.GetSuccessRateMinimumHosts()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OutlierDetectionValidationError{ + Field: "SuccessRateMinimumHosts", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetSuccessRateRequestVolume()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OutlierDetectionValidationError{ + Field: "SuccessRateRequestVolume", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetSuccessRateStdevFactor()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OutlierDetectionValidationError{ + Field: "SuccessRateStdevFactor", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetConsecutiveGatewayFailure()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OutlierDetectionValidationError{ + Field: "ConsecutiveGatewayFailure", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if wrapper := m.GetEnforcingConsecutiveGatewayFailure(); wrapper != nil { + + if wrapper.GetValue() > 100 { + return OutlierDetectionValidationError{ + Field: "EnforcingConsecutiveGatewayFailure", + Reason: "value must be less than or equal to 100", + } + } + + } + + return nil +} + +// OutlierDetectionValidationError is the validation error returned by +// OutlierDetection.Validate if the designated constraints aren't met. +type OutlierDetectionValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e OutlierDetectionValidationError) 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 %sOutlierDetection.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = OutlierDetectionValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/address.pb.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/address.pb.go index 127689e4..5eff9c60 100644 --- a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/address.pb.go +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/address.pb.go @@ -272,10 +272,14 @@ func _SocketAddress_OneofSizer(msg proto.Message) (n int) { type BindConfig struct { // The address to bind to when creating a socket. SourceAddress SocketAddress `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress" json:"source_address"` - // [#not-implemented-hide:] Whether to set the IP_FREEBIND option when creating the socket. If - // set, allows the source_address specified to be an address that is not configured on the system - // running Envoy. Defaults to false. - Freebind bool `protobuf:"varint,2,opt,name=freebind,proto3" json:"freebind,omitempty"` + // [#not-implemented-hide:] Whether to set the *IP_FREEBIND* option when + // creating the socket. When this flag is set to true, allows the + // :ref:`source_address ` + // to be an IP address that is not configured on the system running Envoy. + // When this flag is set to false, the option *IP_FREEBIND* is disabled on the + // socket. When this flag is not set (default), the socket is not modified, + // i.e. the option is neither enabled nor disabled. + Freebind *google_protobuf.BoolValue `protobuf:"bytes,2,opt,name=freebind" json:"freebind,omitempty"` } func (m *BindConfig) Reset() { *m = BindConfig{} } @@ -290,11 +294,11 @@ func (m *BindConfig) GetSourceAddress() SocketAddress { return SocketAddress{} } -func (m *BindConfig) GetFreebind() bool { +func (m *BindConfig) GetFreebind() *google_protobuf.BoolValue { if m != nil { return m.Freebind } - return false + return nil } // Addresses specify either a logical or physical address and port, which are @@ -626,7 +630,7 @@ func (this *BindConfig) Equal(that interface{}) bool { if !this.SourceAddress.Equal(&that1.SourceAddress) { return false } - if this.Freebind != that1.Freebind { + if !this.Freebind.Equal(that1.Freebind) { return false } return true @@ -874,15 +878,15 @@ func (m *BindConfig) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n2 - if m.Freebind { - dAtA[i] = 0x10 + if m.Freebind != nil { + dAtA[i] = 0x12 i++ - if m.Freebind { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + i = encodeVarintAddress(dAtA, i, uint64(m.Freebind.Size())) + n3, err := m.Freebind.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i++ + i += n3 } return i, nil } @@ -903,11 +907,11 @@ func (m *Address) MarshalTo(dAtA []byte) (int, error) { var l int _ = l if m.Address != nil { - nn3, err := m.Address.MarshalTo(dAtA[i:]) + nn4, err := m.Address.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += nn3 + i += nn4 } return i, nil } @@ -918,11 +922,11 @@ func (m *Address_SocketAddress) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintAddress(dAtA, i, uint64(m.SocketAddress.Size())) - n4, err := m.SocketAddress.MarshalTo(dAtA[i:]) + n5, err := m.SocketAddress.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n4 + i += n5 } return i, nil } @@ -932,11 +936,11 @@ func (m *Address_Pipe) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintAddress(dAtA, i, uint64(m.Pipe.Size())) - n5, err := m.Pipe.MarshalTo(dAtA[i:]) + n6, err := m.Pipe.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n5 + i += n6 } return i, nil } @@ -965,11 +969,11 @@ func (m *CidrRange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintAddress(dAtA, i, uint64(m.PrefixLen.Size())) - n6, err := m.PrefixLen.MarshalTo(dAtA[i:]) + n7, err := m.PrefixLen.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n7 } return i, nil } @@ -1034,8 +1038,9 @@ func (m *BindConfig) Size() (n int) { _ = l l = m.SourceAddress.Size() n += 1 + l + sovAddress(uint64(l)) - if m.Freebind { - n += 2 + if m.Freebind != nil { + l = m.Freebind.Size() + n += 1 + l + sovAddress(uint64(l)) } return n } @@ -1429,10 +1434,10 @@ func (m *BindConfig) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Freebind", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAddress @@ -1442,12 +1447,25 @@ func (m *BindConfig) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Freebind = bool(v != 0) + if msglen < 0 { + return ErrInvalidLengthAddress + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Freebind == nil { + m.Freebind = &google_protobuf.BoolValue{} + } + if err := m.Freebind.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAddress(dAtA[iNdEx:]) @@ -1803,41 +1821,41 @@ var ( func init() { proto.RegisterFile("envoy/api/v2/core/address.proto", fileDescriptorAddress) } var fileDescriptorAddress = []byte{ - // 564 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x8a, 0xd3, 0x40, - 0x18, 0xce, 0xb4, 0xd9, 0xdd, 0xf6, 0x5f, 0x5b, 0x6a, 0x10, 0x36, 0x14, 0xcd, 0x96, 0x2c, 0x42, - 0x15, 0x4c, 0x24, 0xeb, 0x0b, 0x98, 0x0a, 0x76, 0x41, 0x24, 0x46, 0x57, 0x8f, 0x61, 0x9a, 0x4c, - 0xe3, 0x60, 0x9a, 0x19, 0xa6, 0x69, 0xd4, 0x9b, 0x7a, 0x10, 0xf1, 0xee, 0x13, 0x78, 0xf1, 0x11, - 0xc4, 0xd3, 0x1e, 0xf7, 0xe0, 0xc1, 0x27, 0x10, 0xe9, 0x6d, 0xdf, 0x42, 0x66, 0x92, 0x14, 0x75, - 0x05, 0xf1, 0xf6, 0xe7, 0xfb, 0xbf, 0xff, 0xcb, 0x37, 0xdf, 0xfc, 0x03, 0xfb, 0x24, 0x2f, 0xd9, - 0x4b, 0x17, 0x73, 0xea, 0x96, 0x9e, 0x1b, 0x33, 0x41, 0x5c, 0x9c, 0x24, 0x82, 0x2c, 0x97, 0x0e, - 0x17, 0xac, 0x60, 0xc6, 0x45, 0x45, 0x70, 0x30, 0xa7, 0x4e, 0xe9, 0x39, 0x92, 0x30, 0xb4, 0x52, - 0xc6, 0xd2, 0x8c, 0xb8, 0x8a, 0x30, 0x5b, 0xcd, 0xdd, 0xe7, 0x02, 0x73, 0x4e, 0x44, 0x3d, 0x32, - 0xdc, 0x2b, 0x71, 0x46, 0x13, 0x5c, 0x10, 0xb7, 0x29, 0xea, 0xc6, 0xa5, 0x94, 0xa5, 0x4c, 0x95, - 0xae, 0xac, 0x2a, 0xd4, 0xbe, 0x0a, 0x7a, 0x40, 0x39, 0x31, 0xae, 0x80, 0xce, 0x71, 0xf1, 0xd4, - 0x44, 0x23, 0x34, 0xee, 0xfa, 0xdd, 0x2f, 0x67, 0x27, 0x6d, 0x5d, 0xb4, 0x46, 0x28, 0x54, 0xb0, - 0xfd, 0xb5, 0x05, 0xbd, 0x87, 0x2c, 0x7e, 0x46, 0x8a, 0xdb, 0x95, 0x41, 0xe3, 0x01, 0x74, 0x94, - 0x42, 0xcc, 0x32, 0x35, 0xd4, 0xf7, 0xae, 0x39, 0xe7, 0xdc, 0x3a, 0xbf, 0xcd, 0x38, 0x41, 0x3d, - 0xe0, 0x83, 0xd4, 0xdf, 0x7a, 0x83, 0x5a, 0x03, 0x14, 0x6e, 0x64, 0x8c, 0x03, 0xd8, 0xa9, 0x8f, - 0x6f, 0xb6, 0xfe, 0xb4, 0xd1, 0x74, 0x8c, 0x7d, 0x00, 0xce, 0x44, 0x11, 0x95, 0x38, 0x5b, 0x11, - 0xb3, 0x3d, 0x42, 0xe3, 0xde, 0x54, 0x0b, 0xbb, 0x12, 0x7b, 0x2c, 0x21, 0x49, 0xc8, 0xf1, 0x82, - 0x24, 0x91, 0x84, 0x4c, 0x5d, 0x0a, 0x49, 0x82, 0xc2, 0x02, 0x26, 0x0a, 0xe3, 0x00, 0x7a, 0x82, - 0x2c, 0x59, 0x56, 0x12, 0x11, 0x49, 0xd4, 0xdc, 0x92, 0x9c, 0xf0, 0x42, 0x03, 0xde, 0xc7, 0x0b, - 0xa9, 0xb2, 0x4b, 0x79, 0x79, 0x2b, 0x8a, 0xd9, 0x82, 0xe3, 0xc2, 0xdc, 0x1e, 0xa1, 0x71, 0x27, - 0x04, 0x09, 0x4d, 0x14, 0x62, 0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xd5, 0x38, 0xcd, 0xab, 0x71, 0x8e, 0x8f, - 0xf2, 0xe2, 0xd0, 0x53, 0x1b, 0x53, 0x6f, 0xe3, 0xf5, 0xb6, 0xf9, 0x0a, 0x85, 0xdd, 0x6a, 0xf6, - 0x1e, 0xc9, 0xfd, 0xc1, 0xa7, 0xb5, 0x85, 0x4e, 0xd7, 0x16, 0xfa, 0xb6, 0xb6, 0xd0, 0x8f, 0xb5, - 0x85, 0x66, 0xdb, 0x6a, 0xfc, 0xf0, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x0a, 0x6c, 0xbb, - 0xb8, 0x03, 0x00, 0x00, + // 571 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xc1, 0x8b, 0xd3, 0x4e, + 0x18, 0xcd, 0xb4, 0xd9, 0xdd, 0xf6, 0xdb, 0x5f, 0x4b, 0x7f, 0x41, 0xd8, 0x50, 0x34, 0x5b, 0xb2, + 0x08, 0xab, 0x60, 0x22, 0x59, 0xf1, 0x6e, 0x2a, 0xd8, 0x05, 0x91, 0x18, 0x5d, 0x3d, 0x86, 0x69, + 0x32, 0x8d, 0x83, 0x69, 0x66, 0x98, 0xa6, 0x51, 0x6f, 0xe2, 0x41, 0xc4, 0xbb, 0x47, 0x4f, 0x5e, + 0xfc, 0x13, 0xc4, 0xd3, 0x1e, 0xf7, 0xe0, 0xc1, 0xbf, 0x40, 0xa4, 0xb7, 0xfd, 0x2f, 0x64, 0x26, + 0x49, 0x51, 0x2b, 0x88, 0xb7, 0x8f, 0xf7, 0xbd, 0xef, 0xe5, 0xcd, 0xcb, 0x83, 0x7d, 0x92, 0x97, + 0xec, 0x85, 0x8b, 0x39, 0x75, 0x4b, 0xcf, 0x8d, 0x99, 0x20, 0x2e, 0x4e, 0x12, 0x41, 0x16, 0x0b, + 0x87, 0x0b, 0x56, 0x30, 0xe3, 0x7f, 0x45, 0x70, 0x30, 0xa7, 0x4e, 0xe9, 0x39, 0x92, 0x30, 0xb4, + 0x52, 0xc6, 0xd2, 0x8c, 0xb8, 0x8a, 0x30, 0x5d, 0xce, 0xdc, 0x67, 0x02, 0x73, 0x4e, 0x44, 0x7d, + 0x32, 0xdc, 0x2b, 0x71, 0x46, 0x13, 0x5c, 0x10, 0xb7, 0x19, 0xea, 0xc5, 0x85, 0x94, 0xa5, 0x4c, + 0x8d, 0xae, 0x9c, 0x2a, 0xd4, 0xbe, 0x0c, 0x7a, 0x40, 0x39, 0x31, 0x2e, 0x81, 0xce, 0x71, 0xf1, + 0xc4, 0x44, 0x23, 0x74, 0xd8, 0xf5, 0xbb, 0x9f, 0xcf, 0x4f, 0xdb, 0xba, 0x68, 0x8d, 0x50, 0xa8, + 0x60, 0xfb, 0x4b, 0x0b, 0x7a, 0x0f, 0x58, 0xfc, 0x94, 0x14, 0xb7, 0x2a, 0x83, 0xc6, 0x7d, 0xe8, + 0x28, 0x85, 0x98, 0x65, 0xea, 0xa8, 0xef, 0x5d, 0x71, 0x36, 0xdc, 0x3a, 0xbf, 0xdc, 0x38, 0x41, + 0x7d, 0xe0, 0x83, 0xd4, 0xdf, 0x7a, 0x85, 0x5a, 0x03, 0x14, 0xae, 0x65, 0x8c, 0x03, 0xd8, 0xa9, + 0x9f, 0x6f, 0xb6, 0x7e, 0xb7, 0xd1, 0x6c, 0x8c, 0x7d, 0x00, 0xce, 0x44, 0x11, 0x95, 0x38, 0x5b, + 0x12, 0xb3, 0x3d, 0x42, 0x87, 0xbd, 0x89, 0x16, 0x76, 0x25, 0xf6, 0x48, 0x42, 0x92, 0x90, 0xe3, + 0x39, 0x49, 0x22, 0x09, 0x99, 0xba, 0x14, 0x92, 0x04, 0x85, 0x05, 0x4c, 0x14, 0xc6, 0x01, 0xf4, + 0x04, 0x59, 0xb0, 0xac, 0x24, 0x22, 0x92, 0xa8, 0xb9, 0x25, 0x39, 0xe1, 0x7f, 0x0d, 0x78, 0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 0x38, 0x4f, 0x89, 0x71, 0x1d, 0xfa, 0xf5, 0x3e, 0xe2, 0x82, 0xcc, + 0xe8, 0xf3, 0xcd, 0xf6, 0xf6, 0x6a, 0x42, 0xa0, 0xf6, 0xc6, 0x1d, 0x80, 0x8a, 0x19, 0x65, 0x24, + 0xaf, 0x6d, 0x5c, 0xdc, 0x48, 0xe4, 0xe4, 0x38, 0x2f, 0x8e, 0x3c, 0x95, 0x49, 0xdd, 0xd4, 0xab, + 0x6d, 0xf3, 0x25, 0x0a, 0xbb, 0xd5, 0xed, 0x5d, 0x92, 0xfb, 0x83, 0x8f, 0x2b, 0x0b, 0x9d, 0xad, + 0x2c, 0xf4, 0x75, 0x65, 0xa1, 0xef, 0x2b, 0x0b, 0x4d, 0xb7, 0xd5, 0xf9, 0xd1, 0x8f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x60, 0x2d, 0x0c, 0xc4, 0xd4, 0x03, 0x00, 0x00, } diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/address.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/address.pb.validate.go new file mode 100644 index 00000000..a2269f98 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/address.pb.validate.go @@ -0,0 +1,354 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/core/address.proto +// DO NOT EDIT!!! + +package core + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Pipe with the rules defined in the proto +// definition for this message. If any rules are violated, an error is returned. +func (m *Pipe) Validate() error { + if m == nil { + return nil + } + + if len(m.GetPath()) < 1 { + return PipeValidationError{ + Field: "Path", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// PipeValidationError is the validation error returned by Pipe.Validate if the +// designated constraints aren't met. +type PipeValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e PipeValidationError) 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 %sPipe.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = PipeValidationError{} + +// Validate checks the field values on SocketAddress with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *SocketAddress) Validate() error { + if m == nil { + return nil + } + + if _, ok := SocketAddress_Protocol_name[int32(m.GetProtocol())]; !ok { + return SocketAddressValidationError{ + Field: "Protocol", + Reason: "value must be one of the defined enum values", + } + } + + if len(m.GetAddress()) < 1 { + return SocketAddressValidationError{ + Field: "Address", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for ResolverName + + // no validation rules for Ipv4Compat + + switch m.PortSpecifier.(type) { + + case *SocketAddress_PortValue: + // no validation rules for PortValue + + case *SocketAddress_NamedPort: + // no validation rules for NamedPort + + default: + return SocketAddressValidationError{ + Field: "PortSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// SocketAddressValidationError is the validation error returned by +// SocketAddress.Validate if the designated constraints aren't met. +type SocketAddressValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e SocketAddressValidationError) 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 %sSocketAddress.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = SocketAddressValidationError{} + +// Validate checks the field values on BindConfig with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *BindConfig) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetSourceAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BindConfigValidationError{ + Field: "SourceAddress", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetFreebind()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BindConfigValidationError{ + Field: "Freebind", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// BindConfigValidationError is the validation error returned by +// BindConfig.Validate if the designated constraints aren't met. +type BindConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e BindConfigValidationError) 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 %sBindConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = BindConfigValidationError{} + +// Validate checks the field values on Address with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Address) Validate() error { + if m == nil { + return nil + } + + switch m.Address.(type) { + + case *Address_SocketAddress: + + if v, ok := interface{}(m.GetSocketAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddressValidationError{ + Field: "SocketAddress", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *Address_Pipe: + + if v, ok := interface{}(m.GetPipe()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddressValidationError{ + Field: "Pipe", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return AddressValidationError{ + Field: "Address", + Reason: "value is required", + } + + } + + return nil +} + +// AddressValidationError is the validation error returned by Address.Validate +// if the designated constraints aren't met. +type AddressValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AddressValidationError) 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 %sAddress.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AddressValidationError{} + +// Validate checks the field values on CidrRange with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *CidrRange) Validate() error { + if m == nil { + return nil + } + + if len(m.GetAddressPrefix()) < 1 { + return CidrRangeValidationError{ + Field: "AddressPrefix", + Reason: "value length must be at least 1 bytes", + } + } + + if wrapper := m.GetPrefixLen(); wrapper != nil { + + if wrapper.GetValue() > 128 { + return CidrRangeValidationError{ + Field: "PrefixLen", + Reason: "value must be less than or equal to 128", + } + } + + } + + return nil +} + +// CidrRangeValidationError is the validation error returned by +// CidrRange.Validate if the designated constraints aren't met. +type CidrRangeValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CidrRangeValidationError) 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 %sCidrRange.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CidrRangeValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/base.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/base.pb.validate.go new file mode 100644 index 00000000..54d7a9ad --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/base.pb.validate.go @@ -0,0 +1,488 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/core/base.proto +// DO NOT EDIT!!! + +package core + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Locality with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Locality) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Region + + // no validation rules for Zone + + // no validation rules for SubZone + + return nil +} + +// LocalityValidationError is the validation error returned by +// Locality.Validate if the designated constraints aren't met. +type LocalityValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e LocalityValidationError) 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 %sLocality.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = LocalityValidationError{} + +// Validate checks the field values on Node with the rules defined in the proto +// definition for this message. If any rules are violated, an error is returned. +func (m *Node) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Id + + // no validation rules for Cluster + + if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NodeValidationError{ + Field: "Metadata", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NodeValidationError{ + Field: "Locality", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for BuildVersion + + return nil +} + +// NodeValidationError is the validation error returned by Node.Validate if the +// designated constraints aren't met. +type NodeValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e NodeValidationError) 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 %sNode.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = NodeValidationError{} + +// Validate checks the field values on Metadata with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Metadata) Validate() error { + if m == nil { + return nil + } + + // no validation rules for FilterMetadata + + return nil +} + +// 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 +} + +// 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{} + +// Validate checks the field values on RuntimeUInt32 with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *RuntimeUInt32) Validate() error { + if m == nil { + return nil + } + + // no validation rules for DefaultValue + + if len(m.GetRuntimeKey()) < 1 { + return RuntimeUInt32ValidationError{ + Field: "RuntimeKey", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// RuntimeUInt32ValidationError is the validation error returned by +// RuntimeUInt32.Validate if the designated constraints aren't met. +type RuntimeUInt32ValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RuntimeUInt32ValidationError) 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 %sRuntimeUInt32.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RuntimeUInt32ValidationError{} + +// Validate checks the field values on HeaderValue with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *HeaderValue) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Key + + // no validation rules for Value + + return nil +} + +// HeaderValueValidationError is the validation error returned by +// HeaderValue.Validate if the designated constraints aren't met. +type HeaderValueValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HeaderValueValidationError) 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 %sHeaderValue.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HeaderValueValidationError{} + +// Validate checks the field values on HeaderValueOption with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *HeaderValueOption) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetHeader()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderValueOptionValidationError{ + Field: "Header", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetAppend()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderValueOptionValidationError{ + Field: "Append", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// HeaderValueOptionValidationError is the validation error returned by +// HeaderValueOption.Validate if the designated constraints aren't met. +type HeaderValueOptionValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HeaderValueOptionValidationError) 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 %sHeaderValueOption.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HeaderValueOptionValidationError{} + +// Validate checks the field values on DataSource with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *DataSource) Validate() error { + if m == nil { + return nil + } + + switch m.Specifier.(type) { + + case *DataSource_Filename: + + if len(m.GetFilename()) < 1 { + return DataSourceValidationError{ + Field: "Filename", + Reason: "value length must be at least 1 bytes", + } + } + + case *DataSource_InlineBytes: + + if len(m.GetInlineBytes()) < 1 { + return DataSourceValidationError{ + Field: "InlineBytes", + Reason: "value length must be at least 1 bytes", + } + } + + case *DataSource_InlineString: + + if len(m.GetInlineString()) < 1 { + return DataSourceValidationError{ + Field: "InlineString", + Reason: "value length must be at least 1 bytes", + } + } + + default: + return DataSourceValidationError{ + Field: "Specifier", + Reason: "value is required", + } + + } + + return nil +} + +// DataSourceValidationError is the validation error returned by +// DataSource.Validate if the designated constraints aren't met. +type DataSourceValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e DataSourceValidationError) 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 %sDataSource.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = DataSourceValidationError{} + +// Validate checks the field values on TransportSocket with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *TransportSocket) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return TransportSocketValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TransportSocketValidationError{ + Field: "Config", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// TransportSocketValidationError is the validation error returned by +// TransportSocket.Validate if the designated constraints aren't met. +type TransportSocketValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TransportSocketValidationError) 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 %sTransportSocket.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TransportSocketValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/config_source.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/config_source.pb.validate.go new file mode 100644 index 00000000..2e26b3b1 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/config_source.pb.validate.go @@ -0,0 +1,230 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/core/config_source.proto +// DO NOT EDIT!!! + +package core + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on ApiConfigSource with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *ApiConfigSource) Validate() error { + if m == nil { + return nil + } + + if _, ok := ApiConfigSource_ApiType_name[int32(m.GetApiType())]; !ok { + return ApiConfigSourceValidationError{ + Field: "ApiType", + Reason: "value must be one of the defined enum values", + } + } + + for idx, item := range m.GetGrpcServices() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ApiConfigSourceValidationError{ + Field: fmt.Sprintf("GrpcServices[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetRefreshDelay()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ApiConfigSourceValidationError{ + Field: "RefreshDelay", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// ApiConfigSourceValidationError is the validation error returned by +// ApiConfigSource.Validate if the designated constraints aren't met. +type ApiConfigSourceValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ApiConfigSourceValidationError) 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 %sApiConfigSource.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ApiConfigSourceValidationError{} + +// Validate checks the field values on AggregatedConfigSource with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *AggregatedConfigSource) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// AggregatedConfigSourceValidationError is the validation error returned by +// AggregatedConfigSource.Validate if the designated constraints aren't met. +type AggregatedConfigSourceValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AggregatedConfigSourceValidationError) 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 %sAggregatedConfigSource.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AggregatedConfigSourceValidationError{} + +// Validate checks the field values on ConfigSource with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ConfigSource) Validate() error { + if m == nil { + return nil + } + + switch m.ConfigSourceSpecifier.(type) { + + case *ConfigSource_Path: + // no validation rules for Path + + case *ConfigSource_ApiConfigSource: + + if v, ok := interface{}(m.GetApiConfigSource()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigSourceValidationError{ + Field: "ApiConfigSource", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *ConfigSource_Ads: + + if v, ok := interface{}(m.GetAds()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfigSourceValidationError{ + Field: "Ads", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return ConfigSourceValidationError{ + Field: "ConfigSourceSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// ConfigSourceValidationError is the validation error returned by +// ConfigSource.Validate if the designated constraints aren't met. +type ConfigSourceValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ConfigSourceValidationError) 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 %sConfigSource.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ConfigSourceValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/grpc_service.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/grpc_service.pb.validate.go new file mode 100644 index 00000000..e8d0fdef --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/grpc_service.pb.validate.go @@ -0,0 +1,404 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/core/grpc_service.proto +// DO NOT EDIT!!! + +package core + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on GrpcService with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *GrpcService) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcServiceValidationError{ + Field: "Timeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetCredentials() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcServiceValidationError{ + Field: fmt.Sprintf("Credentials[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetInitialMetadata() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcServiceValidationError{ + Field: fmt.Sprintf("InitialMetadata[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + switch m.TargetSpecifier.(type) { + + case *GrpcService_EnvoyGrpc_: + + if v, ok := interface{}(m.GetEnvoyGrpc()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcServiceValidationError{ + Field: "EnvoyGrpc", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *GrpcService_GoogleGrpc_: + + if v, ok := interface{}(m.GetGoogleGrpc()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcServiceValidationError{ + Field: "GoogleGrpc", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return GrpcServiceValidationError{ + Field: "TargetSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// GrpcServiceValidationError is the validation error returned by +// GrpcService.Validate if the designated constraints aren't met. +type GrpcServiceValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e GrpcServiceValidationError) 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 %sGrpcService.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = GrpcServiceValidationError{} + +// Validate checks the field values on GrpcService_EnvoyGrpc with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GrpcService_EnvoyGrpc) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClusterName()) < 1 { + return GrpcService_EnvoyGrpcValidationError{ + Field: "ClusterName", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// GrpcService_EnvoyGrpcValidationError is the validation error returned by +// GrpcService_EnvoyGrpc.Validate if the designated constraints aren't met. +type GrpcService_EnvoyGrpcValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e GrpcService_EnvoyGrpcValidationError) 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 %sGrpcService_EnvoyGrpc.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = GrpcService_EnvoyGrpcValidationError{} + +// Validate checks the field values on GrpcService_GoogleGrpc with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GrpcService_GoogleGrpc) Validate() error { + if m == nil { + return nil + } + + if len(m.GetTargetUri()) < 1 { + return GrpcService_GoogleGrpcValidationError{ + Field: "TargetUri", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetSslCredentials()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcService_GoogleGrpcValidationError{ + Field: "SslCredentials", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if len(m.GetStatPrefix()) < 1 { + return GrpcService_GoogleGrpcValidationError{ + Field: "StatPrefix", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcService_GoogleGrpcValidationError{ + Field: "Config", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// GrpcService_GoogleGrpcValidationError is the validation error returned by +// GrpcService_GoogleGrpc.Validate if the designated constraints aren't met. +type GrpcService_GoogleGrpcValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e GrpcService_GoogleGrpcValidationError) 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 %sGrpcService_GoogleGrpc.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = GrpcService_GoogleGrpcValidationError{} + +// Validate checks the field values on GrpcService_Credentials with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GrpcService_Credentials) Validate() error { + if m == nil { + return nil + } + + switch m.CredentialSpecifier.(type) { + + case *GrpcService_Credentials_AccessToken: + // no validation rules for AccessToken + + default: + return GrpcService_CredentialsValidationError{ + Field: "CredentialSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// GrpcService_CredentialsValidationError is the validation error returned by +// GrpcService_Credentials.Validate if the designated constraints aren't met. +type GrpcService_CredentialsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e GrpcService_CredentialsValidationError) 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 %sGrpcService_Credentials.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = GrpcService_CredentialsValidationError{} + +// Validate checks the field values on GrpcService_GoogleGrpc_SslCredentials +// with the rules defined in the proto definition for this message. If any +// rules are violated, an error is returned. +func (m *GrpcService_GoogleGrpc_SslCredentials) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetRootCerts()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcService_GoogleGrpc_SslCredentialsValidationError{ + Field: "RootCerts", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetPrivateKey()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcService_GoogleGrpc_SslCredentialsValidationError{ + Field: "PrivateKey", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetCertChain()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcService_GoogleGrpc_SslCredentialsValidationError{ + Field: "CertChain", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// GrpcService_GoogleGrpc_SslCredentialsValidationError is the validation error +// returned by GrpcService_GoogleGrpc_SslCredentials.Validate if the +// designated constraints aren't met. +type GrpcService_GoogleGrpc_SslCredentialsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e GrpcService_GoogleGrpc_SslCredentialsValidationError) 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 %sGrpcService_GoogleGrpc_SslCredentials.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = GrpcService_GoogleGrpc_SslCredentialsValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/health_check.pb.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/health_check.pb.go index 552758de..9a70d709 100644 --- a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/health_check.pb.go +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/health_check.pb.go @@ -87,6 +87,14 @@ type HealthCheck struct { // *HealthCheck_RedisHealthCheck_ // *HealthCheck_GrpcHealthCheck_ HealthChecker isHealthCheck_HealthChecker `protobuf_oneof:"health_checker"` + // The "no traffic interval" is a special health check interval that is used when a cluster has + // never had traffic routed to it. This lower interval allows cluster information to be kept up to + // date, without sending a potentially large amount of active health checking traffic for no + // reason. Once a cluster has been used for traffic routing, Envoy will shift back to using the + // standard health check interval that is defined. + // + // The default value for "no traffic interval" is 60 seconds. + NoTrafficInterval *google_protobuf2.Duration `protobuf:"bytes,12,opt,name=no_traffic_interval,json=noTrafficInterval" json:"no_traffic_interval,omitempty"` } func (m *HealthCheck) Reset() { *m = HealthCheck{} } @@ -203,6 +211,13 @@ func (m *HealthCheck) GetGrpcHealthCheck() *HealthCheck_GrpcHealthCheck { return nil } +func (m *HealthCheck) GetNoTrafficInterval() *google_protobuf2.Duration { + if m != nil { + return m.NoTrafficInterval + } + return nil +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*HealthCheck) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _HealthCheck_OneofMarshaler, _HealthCheck_OneofUnmarshaler, _HealthCheck_OneofSizer, []interface{}{ @@ -637,6 +652,9 @@ func (this *HealthCheck) Equal(that interface{}) bool { } else if !this.HealthChecker.Equal(that1.HealthChecker) { return false } + if !this.NoTrafficInterval.Equal(that1.NoTrafficInterval) { + return false + } return true } func (this *HealthCheck_HttpHealthCheck_) Equal(that interface{}) bool { @@ -1087,6 +1105,16 @@ func (m *HealthCheck) MarshalTo(dAtA []byte) (int, error) { } i += nn8 } + if m.NoTrafficInterval != nil { + dAtA[i] = 0x62 + i++ + i = encodeVarintHealthCheck(dAtA, i, uint64(m.NoTrafficInterval.Size())) + n9, err := m.NoTrafficInterval.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n9 + } return i, nil } @@ -1096,11 +1124,11 @@ func (m *HealthCheck_HttpHealthCheck_) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x42 i++ i = encodeVarintHealthCheck(dAtA, i, uint64(m.HttpHealthCheck.Size())) - n9, err := m.HttpHealthCheck.MarshalTo(dAtA[i:]) + n10, err := m.HttpHealthCheck.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n10 } return i, nil } @@ -1110,11 +1138,11 @@ func (m *HealthCheck_TcpHealthCheck_) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x4a i++ i = encodeVarintHealthCheck(dAtA, i, uint64(m.TcpHealthCheck.Size())) - n10, err := m.TcpHealthCheck.MarshalTo(dAtA[i:]) + n11, err := m.TcpHealthCheck.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n10 + i += n11 } return i, nil } @@ -1124,11 +1152,11 @@ func (m *HealthCheck_RedisHealthCheck_) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x52 i++ i = encodeVarintHealthCheck(dAtA, i, uint64(m.RedisHealthCheck.Size())) - n11, err := m.RedisHealthCheck.MarshalTo(dAtA[i:]) + n12, err := m.RedisHealthCheck.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n11 + i += n12 } return i, nil } @@ -1138,11 +1166,11 @@ func (m *HealthCheck_GrpcHealthCheck_) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x5a i++ i = encodeVarintHealthCheck(dAtA, i, uint64(m.GrpcHealthCheck.Size())) - n12, err := m.GrpcHealthCheck.MarshalTo(dAtA[i:]) + n13, err := m.GrpcHealthCheck.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n12 + i += n13 } return i, nil } @@ -1162,11 +1190,11 @@ func (m *HealthCheck_Payload) MarshalTo(dAtA []byte) (int, error) { var l int _ = l if m.Payload != nil { - nn13, err := m.Payload.MarshalTo(dAtA[i:]) + nn14, err := m.Payload.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += nn13 + i += nn14 } return i, nil } @@ -1220,21 +1248,21 @@ func (m *HealthCheck_HttpHealthCheck) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintHealthCheck(dAtA, i, uint64(m.Send.Size())) - n14, err := m.Send.MarshalTo(dAtA[i:]) + n15, err := m.Send.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n14 + i += n15 } if m.Receive != nil { dAtA[i] = 0x22 i++ i = encodeVarintHealthCheck(dAtA, i, uint64(m.Receive.Size())) - n15, err := m.Receive.MarshalTo(dAtA[i:]) + n16, err := m.Receive.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n15 + i += n16 } if len(m.ServiceName) > 0 { dAtA[i] = 0x2a @@ -1264,11 +1292,11 @@ func (m *HealthCheck_TcpHealthCheck) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintHealthCheck(dAtA, i, uint64(m.Send.Size())) - n16, err := m.Send.MarshalTo(dAtA[i:]) + n17, err := m.Send.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n16 + i += n17 } if len(m.Receive) > 0 { for _, msg := range m.Receive { @@ -1376,6 +1404,10 @@ func (m *HealthCheck) Size() (n int) { if m.HealthChecker != nil { n += m.HealthChecker.Size() } + if m.NoTrafficInterval != nil { + l = m.NoTrafficInterval.Size() + n += 1 + l + sovHealthCheck(uint64(l)) + } return n } @@ -1903,6 +1935,39 @@ func (m *HealthCheck) Unmarshal(dAtA []byte) error { } m.HealthChecker = &HealthCheck_GrpcHealthCheck_{v} iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoTrafficInterval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHealthCheck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHealthCheck + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NoTrafficInterval == nil { + m.NoTrafficInterval = &google_protobuf2.Duration{} + } + if err := m.NoTrafficInterval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipHealthCheck(dAtA[iNdEx:]) @@ -2616,51 +2681,52 @@ var ( func init() { proto.RegisterFile("envoy/api/v2/core/health_check.proto", fileDescriptorHealthCheck) } var fileDescriptorHealthCheck = []byte{ - // 727 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0xc7, 0x33, 0x49, 0xda, 0x24, 0x27, 0xb9, 0x89, 0x3b, 0xf7, 0x4a, 0xf5, 0x8d, 0x20, 0x14, + // 752 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xc1, 0x6e, 0xd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, 0x56, 0xe6, 0x0f, 0x6a, 0xae, 0x6d, + 0x83, 0xbc, 0xe8, 0x50, 0x24, 0x43, 0xe6, 0x92, 0x8c, 0xa3, 0xbe, 0x07, 0x61, 0xed, 0x11, 0x54, + 0x16, 0x7c, 0x96, 0x78, 0xac, 0x94, 0x78, 0x6c, 0x73, 0x13, 0xca, 0xb3, 0x86, 0x26, 0x2c, 0xfa, + 0xed, 0x07, 0x3a, 0x94, 0x42, 0xd4, 0x2b, 0x8e, 0xf9, 0xd0, 0x47, 0x45, 0xc8, 0xf5, 0x3a, 0x2f, + 0x3a, 0xc7, 0xaf, 0x3b, 0x72, 0x2a, 0x58, 0xb4, 0x0e, 0x76, 0x5f, 0x76, 0x5b, 0x67, 0xb2, 0x84, + 0xfe, 0x81, 0x42, 0xaf, 0x13, 0x2f, 0xd3, 0xa8, 0x04, 0xf9, 0x7d, 0x7d, 0xb7, 0xdd, 0x69, 0x77, + 0x0e, 0xe5, 0x4c, 0x70, 0xb2, 0xdb, 0x3e, 0x3a, 0x38, 0xee, 0x75, 0xe5, 0x6c, 0x53, 0xfe, 0x38, + 0xa9, 0x4b, 0x5f, 0x27, 0x75, 0xe9, 0xdb, 0xa4, 0x2e, 0x7d, 0x9f, 0xd4, 0xa5, 0xf3, 0x75, 0xe1, + 0xe8, 0x9d, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x63, 0x59, 0x31, 0x3a, 0x11, 0x07, 0x00, 0x00, } diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/health_check.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/health_check.pb.validate.go new file mode 100644 index 00000000..6efadf6a --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/health_check.pb.validate.go @@ -0,0 +1,504 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/core/health_check.proto +// DO NOT EDIT!!! + +package core + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on HealthCheck with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *HealthCheck) Validate() error { + if m == nil { + return nil + } + + if m.GetTimeout() == nil { + return HealthCheckValidationError{ + Field: "Timeout", + Reason: "value is required", + } + } + + if m.GetInterval() == nil { + return HealthCheckValidationError{ + Field: "Interval", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetIntervalJitter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "IntervalJitter", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetUnhealthyThreshold()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "UnhealthyThreshold", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetHealthyThreshold()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "HealthyThreshold", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetAltPort()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "AltPort", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetReuseConnection()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "ReuseConnection", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetNoTrafficInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "NoTrafficInterval", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + switch m.HealthChecker.(type) { + + case *HealthCheck_HttpHealthCheck_: + + if v, ok := interface{}(m.GetHttpHealthCheck()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "HttpHealthCheck", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *HealthCheck_TcpHealthCheck_: + + if v, ok := interface{}(m.GetTcpHealthCheck()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "TcpHealthCheck", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *HealthCheck_RedisHealthCheck_: + + if v, ok := interface{}(m.GetRedisHealthCheck()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "RedisHealthCheck", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *HealthCheck_GrpcHealthCheck_: + + if v, ok := interface{}(m.GetGrpcHealthCheck()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "GrpcHealthCheck", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return HealthCheckValidationError{ + Field: "HealthChecker", + Reason: "value is required", + } + + } + + return nil +} + +// HealthCheckValidationError is the validation error returned by +// HealthCheck.Validate if the designated constraints aren't met. +type HealthCheckValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheckValidationError) 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 %sHealthCheck.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheckValidationError{} + +// Validate checks the field values on HealthCheck_Payload with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HealthCheck_Payload) Validate() error { + if m == nil { + return nil + } + + switch m.Payload.(type) { + + case *HealthCheck_Payload_Text: + + if len(m.GetText()) < 1 { + return HealthCheck_PayloadValidationError{ + Field: "Text", + Reason: "value length must be at least 1 bytes", + } + } + + case *HealthCheck_Payload_Binary: + // no validation rules for Binary + + default: + return HealthCheck_PayloadValidationError{ + Field: "Payload", + Reason: "value is required", + } + + } + + return nil +} + +// HealthCheck_PayloadValidationError is the validation error returned by +// HealthCheck_Payload.Validate if the designated constraints aren't met. +type HealthCheck_PayloadValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheck_PayloadValidationError) 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 %sHealthCheck_Payload.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheck_PayloadValidationError{} + +// Validate checks the field values on HealthCheck_HttpHealthCheck with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HealthCheck_HttpHealthCheck) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Host + + if len(m.GetPath()) < 1 { + return HealthCheck_HttpHealthCheckValidationError{ + Field: "Path", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetSend()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheck_HttpHealthCheckValidationError{ + Field: "Send", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetReceive()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheck_HttpHealthCheckValidationError{ + Field: "Receive", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for ServiceName + + return nil +} + +// HealthCheck_HttpHealthCheckValidationError is the validation error returned +// by HealthCheck_HttpHealthCheck.Validate if the designated constraints +// aren't met. +type HealthCheck_HttpHealthCheckValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheck_HttpHealthCheckValidationError) 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 %sHealthCheck_HttpHealthCheck.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheck_HttpHealthCheckValidationError{} + +// Validate checks the field values on HealthCheck_TcpHealthCheck with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HealthCheck_TcpHealthCheck) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetSend()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheck_TcpHealthCheckValidationError{ + Field: "Send", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetReceive() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheck_TcpHealthCheckValidationError{ + Field: fmt.Sprintf("Receive[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// HealthCheck_TcpHealthCheckValidationError is the validation error returned +// by HealthCheck_TcpHealthCheck.Validate if the designated constraints aren't met. +type HealthCheck_TcpHealthCheckValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheck_TcpHealthCheckValidationError) 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 %sHealthCheck_TcpHealthCheck.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheck_TcpHealthCheckValidationError{} + +// Validate checks the field values on HealthCheck_RedisHealthCheck with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HealthCheck_RedisHealthCheck) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Key + + return nil +} + +// HealthCheck_RedisHealthCheckValidationError is the validation error returned +// by HealthCheck_RedisHealthCheck.Validate if the designated constraints +// aren't met. +type HealthCheck_RedisHealthCheckValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheck_RedisHealthCheckValidationError) 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 %sHealthCheck_RedisHealthCheck.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheck_RedisHealthCheckValidationError{} + +// Validate checks the field values on HealthCheck_GrpcHealthCheck with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HealthCheck_GrpcHealthCheck) Validate() error { + if m == nil { + return nil + } + + // no validation rules for ServiceName + + return nil +} + +// HealthCheck_GrpcHealthCheckValidationError is the validation error returned +// by HealthCheck_GrpcHealthCheck.Validate if the designated constraints +// aren't met. +type HealthCheck_GrpcHealthCheckValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheck_GrpcHealthCheckValidationError) 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 %sHealthCheck_GrpcHealthCheck.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheck_GrpcHealthCheckValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/http_uri.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/http_uri.pb.validate.go new file mode 100644 index 00000000..df226927 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/http_uri.pb.validate.go @@ -0,0 +1,102 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/core/http_uri.proto +// DO NOT EDIT!!! + +package core + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on HttpUri with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *HttpUri) Validate() error { + if m == nil { + return nil + } + + if len(m.GetUri()) < 1 { + return HttpUriValidationError{ + Field: "Uri", + Reason: "value length must be at least 1 bytes", + } + } + + switch m.HttpUpstreamType.(type) { + + case *HttpUri_Cluster: + + if len(m.GetCluster()) < 1 { + return HttpUriValidationError{ + Field: "Cluster", + Reason: "value length must be at least 1 bytes", + } + } + + default: + return HttpUriValidationError{ + Field: "HttpUpstreamType", + Reason: "value is required", + } + + } + + return nil +} + +// HttpUriValidationError is the validation error returned by HttpUri.Validate +// if the designated constraints aren't met. +type HttpUriValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HttpUriValidationError) 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 %sHttpUri.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HttpUriValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/protocol.pb.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/protocol.pb.go index 6a54fd45..9bb75422 100644 --- a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/protocol.pb.go +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/protocol.pb.go @@ -33,7 +33,6 @@ func (*TcpProtocolOptions) ProtoMessage() {} func (*TcpProtocolOptions) Descriptor() ([]byte, []int) { return fileDescriptorProtocol, []int{0} } type HttpProtocolOptions struct { - // [#not-implemented-hide:] // The idle timeout for upstream connection pool connections. The idle timeout is defined as the // period in which there are no active requests. If not set, there is no idle timeout. When the // idle timeout is reached the connection will be closed. Note that request based timeouts mean @@ -59,13 +58,11 @@ type Http1ProtocolOptions struct { // envoy as their HTTP proxy. In Unix, for example, this is typically done by setting the // *http_proxy* environment variable. AllowAbsoluteUrl *google_protobuf.BoolValue `protobuf:"bytes,1,opt,name=allow_absolute_url,json=allowAbsoluteUrl" json:"allow_absolute_url,omitempty"` - // [#not-implemented-hide:] // Handle incoming HTTP/1.0 and HTTP 0.9 requests. // This is off by default, and not fully standards compliant. There is support for pre-HTTP/1.1 // style connect logic, dechunking, and handling lack of client host iff // *default_host_for_http_10* is configured. AcceptHttp_10 bool `protobuf:"varint,2,opt,name=accept_http_10,json=acceptHttp10,proto3" json:"accept_http_10,omitempty"` - // [#not-implemented-hide:] // A default host for HTTP/1.0 requests. This is highly suggested if *accept_http_10* is true as // Envoy does not otherwise support HTTP/1.0 without a Host header. // This is a no-op if *accept_http_10* is not true. diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/protocol.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/protocol.pb.validate.go new file mode 100644 index 00000000..37c70e27 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/core/protocol.pb.validate.go @@ -0,0 +1,322 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/core/protocol.proto +// DO NOT EDIT!!! + +package core + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on TcpProtocolOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *TcpProtocolOptions) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// TcpProtocolOptionsValidationError is the validation error returned by +// TcpProtocolOptions.Validate if the designated constraints aren't met. +type TcpProtocolOptionsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TcpProtocolOptionsValidationError) 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 %sTcpProtocolOptions.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TcpProtocolOptionsValidationError{} + +// Validate checks the field values on HttpProtocolOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HttpProtocolOptions) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetIdleTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpProtocolOptionsValidationError{ + Field: "IdleTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// HttpProtocolOptionsValidationError is the validation error returned by +// HttpProtocolOptions.Validate if the designated constraints aren't met. +type HttpProtocolOptionsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HttpProtocolOptionsValidationError) 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 %sHttpProtocolOptions.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HttpProtocolOptionsValidationError{} + +// Validate checks the field values on Http1ProtocolOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Http1ProtocolOptions) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetAllowAbsoluteUrl()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Http1ProtocolOptionsValidationError{ + Field: "AllowAbsoluteUrl", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for AcceptHttp_10 + + // no validation rules for DefaultHostForHttp_10 + + return nil +} + +// Http1ProtocolOptionsValidationError is the validation error returned by +// Http1ProtocolOptions.Validate if the designated constraints aren't met. +type Http1ProtocolOptionsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Http1ProtocolOptionsValidationError) 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 %sHttp1ProtocolOptions.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Http1ProtocolOptionsValidationError{} + +// Validate checks the field values on Http2ProtocolOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Http2ProtocolOptions) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetHpackTableSize()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Http2ProtocolOptionsValidationError{ + Field: "HpackTableSize", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if wrapper := m.GetMaxConcurrentStreams(); wrapper != nil { + + if val := wrapper.GetValue(); val < 1 || val > 2147483647 { + return Http2ProtocolOptionsValidationError{ + Field: "MaxConcurrentStreams", + Reason: "value must be inside range [1, 2147483647]", + } + } + + } + + if wrapper := m.GetInitialStreamWindowSize(); wrapper != nil { + + if val := wrapper.GetValue(); val < 65535 || val > 2147483647 { + return Http2ProtocolOptionsValidationError{ + Field: "InitialStreamWindowSize", + Reason: "value must be inside range [65535, 2147483647]", + } + } + + } + + if wrapper := m.GetInitialConnectionWindowSize(); wrapper != nil { + + if val := wrapper.GetValue(); val < 65535 || val > 2147483647 { + return Http2ProtocolOptionsValidationError{ + Field: "InitialConnectionWindowSize", + Reason: "value must be inside range [65535, 2147483647]", + } + } + + } + + return nil +} + +// Http2ProtocolOptionsValidationError is the validation error returned by +// Http2ProtocolOptions.Validate if the designated constraints aren't met. +type Http2ProtocolOptionsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Http2ProtocolOptionsValidationError) 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 %sHttp2ProtocolOptions.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Http2ProtocolOptionsValidationError{} + +// Validate checks the field values on GrpcProtocolOptions with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GrpcProtocolOptions) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcProtocolOptionsValidationError{ + Field: "Http2ProtocolOptions", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// GrpcProtocolOptionsValidationError is the validation error returned by +// GrpcProtocolOptions.Validate if the designated constraints aren't met. +type GrpcProtocolOptionsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e GrpcProtocolOptionsValidationError) 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 %sGrpcProtocolOptions.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = GrpcProtocolOptionsValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/discovery.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/discovery.pb.validate.go new file mode 100644 index 00000000..f87cc94d --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/discovery.pb.validate.go @@ -0,0 +1,168 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/discovery.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on DiscoveryRequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *DiscoveryRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for VersionInfo + + if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DiscoveryRequestValidationError{ + Field: "Node", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for TypeUrl + + // no validation rules for ResponseNonce + + if v, ok := interface{}(m.GetErrorDetail()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DiscoveryRequestValidationError{ + Field: "ErrorDetail", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// DiscoveryRequestValidationError is the validation error returned by +// DiscoveryRequest.Validate if the designated constraints aren't met. +type DiscoveryRequestValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e DiscoveryRequestValidationError) 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 %sDiscoveryRequest.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = DiscoveryRequestValidationError{} + +// Validate checks the field values on DiscoveryResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *DiscoveryResponse) Validate() error { + if m == nil { + return nil + } + + // no validation rules for VersionInfo + + for idx, item := range m.GetResources() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DiscoveryResponseValidationError{ + Field: fmt.Sprintf("Resources[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for Canary + + // no validation rules for TypeUrl + + // no validation rules for Nonce + + return nil +} + +// DiscoveryResponseValidationError is the validation error returned by +// DiscoveryResponse.Validate if the designated constraints aren't met. +type DiscoveryResponseValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e DiscoveryResponseValidationError) 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 %sDiscoveryResponse.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = DiscoveryResponseValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/eds.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/eds.pb.validate.go new file mode 100644 index 00000000..70a63925 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/eds.pb.validate.go @@ -0,0 +1,159 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/eds.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on ClusterLoadAssignment with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ClusterLoadAssignment) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClusterName()) < 1 { + return ClusterLoadAssignmentValidationError{ + Field: "ClusterName", + Reason: "value length must be at least 1 bytes", + } + } + + for idx, item := range m.GetEndpoints() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterLoadAssignmentValidationError{ + Field: fmt.Sprintf("Endpoints[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetPolicy()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterLoadAssignmentValidationError{ + Field: "Policy", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// ClusterLoadAssignmentValidationError is the validation error returned by +// ClusterLoadAssignment.Validate if the designated constraints aren't met. +type ClusterLoadAssignmentValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ClusterLoadAssignmentValidationError) 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 %sClusterLoadAssignment.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ClusterLoadAssignmentValidationError{} + +// Validate checks the field values on ClusterLoadAssignment_Policy with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ClusterLoadAssignment_Policy) Validate() error { + if m == nil { + return nil + } + + if val := m.GetDropOverload(); val < 0 || val > 100 { + return ClusterLoadAssignment_PolicyValidationError{ + Field: "DropOverload", + Reason: "value must be inside range [0, 100]", + } + } + + return nil +} + +// ClusterLoadAssignment_PolicyValidationError is the validation error returned +// by ClusterLoadAssignment_Policy.Validate if the designated constraints +// aren't met. +type ClusterLoadAssignment_PolicyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ClusterLoadAssignment_PolicyValidationError) 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 %sClusterLoadAssignment_Policy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ClusterLoadAssignment_PolicyValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/endpoint.pb.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/endpoint.pb.go index d05f0851..98fdffb2 100644 --- a/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/endpoint.pb.go +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/endpoint.pb.go @@ -136,11 +136,11 @@ type LocalityLbEndpoints struct { // localities at the same priority level to produce the effective percentage // of traffic for the locality. // - // Weights must be specified for either all localities in a given priority - // level or none. - // - // If unspecified, each locality is presumed to have equal weight in a - // cluster. + // Locality weights are only considered when :ref:`locality weighted load + // balancing ` is + // configured. These weights are ignored otherwise. If no weights are + // specificed when locality weighted load balancing is enabled, the cluster is + // assumed to have a weight of 1. // // .. attention:: // diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/endpoint.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/endpoint.pb.validate.go new file mode 100644 index 00000000..03f8a5be --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/endpoint.pb.validate.go @@ -0,0 +1,240 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/endpoint/endpoint.proto +// DO NOT EDIT!!! + +package endpoint + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Endpoint with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Endpoint) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EndpointValidationError{ + Field: "Address", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// EndpointValidationError is the validation error returned by +// Endpoint.Validate if the designated constraints aren't met. +type EndpointValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e EndpointValidationError) 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 %sEndpoint.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = EndpointValidationError{} + +// Validate checks the field values on LbEndpoint with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *LbEndpoint) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetEndpoint()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LbEndpointValidationError{ + Field: "Endpoint", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for HealthStatus + + if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LbEndpointValidationError{ + Field: "Metadata", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if wrapper := m.GetLoadBalancingWeight(); wrapper != nil { + + if val := wrapper.GetValue(); val < 1 || val > 128 { + return LbEndpointValidationError{ + Field: "LoadBalancingWeight", + Reason: "value must be inside range [1, 128]", + } + } + + } + + return nil +} + +// LbEndpointValidationError is the validation error returned by +// LbEndpoint.Validate if the designated constraints aren't met. +type LbEndpointValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e LbEndpointValidationError) 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 %sLbEndpoint.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = LbEndpointValidationError{} + +// Validate checks the field values on LocalityLbEndpoints with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *LocalityLbEndpoints) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalityLbEndpointsValidationError{ + Field: "Locality", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetLbEndpoints() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalityLbEndpointsValidationError{ + Field: fmt.Sprintf("LbEndpoints[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if wrapper := m.GetLoadBalancingWeight(); wrapper != nil { + + if val := wrapper.GetValue(); val < 1 || val > 128 { + return LocalityLbEndpointsValidationError{ + Field: "LoadBalancingWeight", + Reason: "value must be inside range [1, 128]", + } + } + + } + + // no validation rules for Priority + + return nil +} + +// LocalityLbEndpointsValidationError is the validation error returned by +// LocalityLbEndpoints.Validate if the designated constraints aren't met. +type LocalityLbEndpointsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e LocalityLbEndpointsValidationError) 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 %sLocalityLbEndpoints.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = LocalityLbEndpointsValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/load_report.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/load_report.pb.validate.go new file mode 100644 index 00000000..45bea01a --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint/load_report.pb.validate.go @@ -0,0 +1,231 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/endpoint/load_report.proto +// DO NOT EDIT!!! + +package endpoint + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on UpstreamLocalityStats with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *UpstreamLocalityStats) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpstreamLocalityStatsValidationError{ + Field: "Locality", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for TotalSuccessfulRequests + + // no validation rules for TotalRequestsInProgress + + // no validation rules for TotalErrorRequests + + for idx, item := range m.GetLoadMetricStats() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpstreamLocalityStatsValidationError{ + Field: fmt.Sprintf("LoadMetricStats[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for Priority + + return nil +} + +// UpstreamLocalityStatsValidationError is the validation error returned by +// UpstreamLocalityStats.Validate if the designated constraints aren't met. +type UpstreamLocalityStatsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e UpstreamLocalityStatsValidationError) 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 %sUpstreamLocalityStats.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = UpstreamLocalityStatsValidationError{} + +// Validate checks the field values on EndpointLoadMetricStats with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *EndpointLoadMetricStats) Validate() error { + if m == nil { + return nil + } + + // no validation rules for MetricName + + // no validation rules for NumRequestsFinishedWithMetric + + // no validation rules for TotalMetricValue + + return nil +} + +// EndpointLoadMetricStatsValidationError is the validation error returned by +// EndpointLoadMetricStats.Validate if the designated constraints aren't met. +type EndpointLoadMetricStatsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e EndpointLoadMetricStatsValidationError) 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 %sEndpointLoadMetricStats.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = EndpointLoadMetricStatsValidationError{} + +// Validate checks the field values on ClusterStats with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ClusterStats) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClusterName()) < 1 { + return ClusterStatsValidationError{ + Field: "ClusterName", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetUpstreamLocalityStats()) < 1 { + return ClusterStatsValidationError{ + Field: "UpstreamLocalityStats", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetUpstreamLocalityStats() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterStatsValidationError{ + Field: fmt.Sprintf("UpstreamLocalityStats[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for TotalDroppedRequests + + return nil +} + +// ClusterStatsValidationError is the validation error returned by +// ClusterStats.Validate if the designated constraints aren't met. +type ClusterStatsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ClusterStatsValidationError) 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 %sClusterStats.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ClusterStatsValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/lds.pb.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/lds.pb.go index 3020d533..ecae1c7e 100644 --- a/github.com/envoyproxy/go-control-plane/envoy/api/v2/lds.pb.go +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/lds.pb.go @@ -110,15 +110,29 @@ type Listener struct { // filters are processed sequentially right after a socket has been accepted by the listener, and // before a connection is created. ListenerFilters []envoy_api_v2_listener.ListenerFilter `protobuf:"bytes,9,rep,name=listener_filters,json=listenerFilters" json:"listener_filters"` - // Whether the listener should be set as a transparent socket. When this flag is set to true, - // connections can be redirected to the listener using an *iptables* *TPROXY* target, in which - // case the original source and destination addresses and ports are preserved on accepted - // connections. Requires Envoy to run with the *CAP_NET_ADMIN* capability. Defaults to false. - Transparent bool `protobuf:"varint,10,opt,name=transparent,proto3" json:"transparent,omitempty"` - // [#not-implemented-hide:] Whether the listener should set the IP_FREEBIND socket option. When - // this flag is set to true listeners can be bound to an IP address that is not configured on the - // system running Envoy. Defaults to false. - Freebind bool `protobuf:"varint,11,opt,name=freebind,proto3" json:"freebind,omitempty"` + // [#not-implemented-hide:] + // Whether the listener should be set as a transparent socket. + // When this flag is set to true, connections can be redirected to the listener using an + // *iptables* *TPROXY* target, in which case the original source and destination addresses and + // ports are preserved on accepted connections. This flag should be used in combination with + // :ref:`an original_dst ` :ref:`listener filter + // ` to mark the connections' local addresses as + // "restored." This can be used to hand off each redirected connection to another listener + // associated with the connection's destination address. Direct connections to the socket without + // using *TPROXY* cannot be distinguished from connections redirected using *TPROXY* and are + // therefore treated as if they were redirected. + // When this flag is set to false, the listener's socket is explicitly reset as non-transparent. + // Setting this flag requires Envoy to run with the *CAP_NET_ADMIN* capability. + // When this flag is not set (default), the socket is not modified, i.e. the transparent option + // is neither set nor reset. + Transparent *google_protobuf.BoolValue `protobuf:"bytes,10,opt,name=transparent" json:"transparent,omitempty"` + // [#not-implemented-hide:] Whether the listener should set the *IP_FREEBIND* + // socket option. When this flag is set to true, listeners can be bound to an + // IP address that is not configured on the system running Envoy. When this + // flag is set to false, the option *IP_FREEBIND* is disabled on the socket. + // When this flag is not set (default), the socket is not modified, i.e. the + // option is neither enabled nor disabled. + Freebind *google_protobuf.BoolValue `protobuf:"bytes,11,opt,name=freebind" json:"freebind,omitempty"` } func (m *Listener) Reset() { *m = Listener{} } @@ -189,18 +203,18 @@ func (m *Listener) GetListenerFilters() []envoy_api_v2_listener.ListenerFilter { return nil } -func (m *Listener) GetTransparent() bool { +func (m *Listener) GetTransparent() *google_protobuf.BoolValue { if m != nil { return m.Transparent } - return false + return nil } -func (m *Listener) GetFreebind() bool { +func (m *Listener) GetFreebind() *google_protobuf.BoolValue { if m != nil { return m.Freebind } - return false + return nil } // [#not-implemented-hide:] @@ -295,10 +309,10 @@ func (this *Listener) Equal(that interface{}) bool { return false } } - if this.Transparent != that1.Transparent { + if !this.Transparent.Equal(that1.Transparent) { return false } - if this.Freebind != that1.Freebind { + if !this.Freebind.Equal(that1.Freebind) { return false } return true @@ -570,25 +584,25 @@ func (m *Listener) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.Transparent { - dAtA[i] = 0x50 + if m.Transparent != nil { + dAtA[i] = 0x52 i++ - if m.Transparent { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + i = encodeVarintLds(dAtA, i, uint64(m.Transparent.Size())) + n6, err := m.Transparent.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i++ + i += n6 } - if m.Freebind { - dAtA[i] = 0x58 + if m.Freebind != nil { + dAtA[i] = 0x5a i++ - if m.Freebind { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + i = encodeVarintLds(dAtA, i, uint64(m.Freebind.Size())) + n7, err := m.Freebind.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i++ + i += n7 } return i, nil } @@ -612,11 +626,11 @@ func (m *Listener_DeprecatedV1) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintLds(dAtA, i, uint64(m.BindToPort.Size())) - n6, err := m.BindToPort.MarshalTo(dAtA[i:]) + n8, err := m.BindToPort.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n8 } return i, nil } @@ -670,11 +684,13 @@ func (m *Listener) Size() (n int) { n += 1 + l + sovLds(uint64(l)) } } - if m.Transparent { - n += 2 + if m.Transparent != nil { + l = m.Transparent.Size() + n += 1 + l + sovLds(uint64(l)) } - if m.Freebind { - n += 2 + if m.Freebind != nil { + l = m.Freebind.Size() + n += 1 + l + sovLds(uint64(l)) } return n } @@ -1004,10 +1020,10 @@ func (m *Listener) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 10: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Transparent", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLds @@ -1017,17 +1033,30 @@ func (m *Listener) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Transparent = bool(v != 0) + if msglen < 0 { + return ErrInvalidLengthLds + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Transparent == nil { + m.Transparent = &google_protobuf.BoolValue{} + } + if err := m.Transparent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 11: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Freebind", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLds @@ -1037,12 +1066,25 @@ func (m *Listener) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Freebind = bool(v != 0) + if msglen < 0 { + return ErrInvalidLengthLds + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Freebind == nil { + m.Freebind = &google_protobuf.BoolValue{} + } + if err := m.Freebind.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipLds(dAtA[iNdEx:]) @@ -1255,50 +1297,50 @@ var ( func init() { proto.RegisterFile("envoy/api/v2/lds.proto", fileDescriptorLds) } var fileDescriptorLds = []byte{ - // 718 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcf, 0x6f, 0x13, 0x39, - 0x18, 0xad, 0xd3, 0x5f, 0x89, 0x93, 0xa6, 0x91, 0x77, 0xb5, 0x1d, 0x65, 0xbb, 0x69, 0x36, 0xbb, - 0x2b, 0x65, 0xf7, 0x30, 0xd9, 0xa6, 0x07, 0xa4, 0x0a, 0x09, 0x35, 0x0d, 0x51, 0x2b, 0xa5, 0x14, - 0x4d, 0x7f, 0x40, 0x4f, 0x23, 0x27, 0xf3, 0x25, 0xb5, 0x34, 0xb1, 0x07, 0xdb, 0x09, 0xca, 0x95, - 0x13, 0xe2, 0x08, 0xff, 0x04, 0x7f, 0x03, 0x27, 0xc4, 0xa9, 0x47, 0x24, 0xee, 0x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 0x44, - 0x4b, 0xa0, 0x83, 0x98, 0xa1, 0x48, 0x69, 0xde, 0xa4, 0x64, 0xc4, 0x81, 0x27, 0x43, 0x50, 0xba, - 0xb8, 0x75, 0x2b, 0xae, 0x02, 0xc1, 0x15, 0x54, 0x16, 0xaa, 0xe8, 0x7f, 0x44, 0x86, 0x38, 0xdf, - 0x02, 0xdd, 0xbd, 0xfc, 0x89, 0xc2, 0x95, 0x67, 0x1f, 0x3e, 0xbf, 0x4a, 0x6d, 0x56, 0x36, 0xe6, - 0x7e, 0x5f, 0xbb, 0x71, 0x4e, 0x6a, 0x17, 0xfd, 0xd7, 0xf8, 0xe5, 0xf5, 0xa4, 0x84, 0xae, 0x26, - 0x25, 0xf4, 0x7e, 0x52, 0x42, 0x9f, 0x26, 0x25, 0xf4, 0x1c, 0xa1, 0xce, 0x8a, 0x71, 0x73, 0xe7, - 0x5b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xe5, 0xa3, 0x48, 0x66, 0x05, 0x00, 0x00, + // 716 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcf, 0x6b, 0x13, 0x4d, + 0x18, 0xc7, 0x3b, 0xe9, 0xaf, 0x64, 0x92, 0xa6, 0x61, 0xde, 0x97, 0xb7, 0x4b, 0xde, 0x9a, 0xc6, + 0xa8, 0x10, 0x3d, 0x6c, 0x6c, 0x0a, 0x0a, 0xa5, 0x20, 0x4d, 0x63, 0x68, 0x21, 0xb5, 0xb2, 0xfd, + 0xa1, 0x3d, 0x2d, 0x93, 0xec, 0x93, 0x74, 0x60, 0x33, 0xb3, 0xce, 0x4c, 0x22, 0xb9, 0x7a, 0x12, + 0x8f, 0xfa, 0x4f, 0xf8, 0x37, 0x78, 0xf2, 0xd8, 0xa3, 0xe0, 0x5d, 0x24, 0x78, 0x11, 0xff, 0x03, + 0x4f, 0xb2, 0x9b, 0xdd, 0x35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0, 0xa2, 0x0f, 0x4a, 0xe7, 0xd7, + 0xae, 0x9c, 0x2b, 0x4f, 0x70, 0x05, 0xa5, 0x99, 0x32, 0xba, 0x8f, 0x48, 0x1f, 0x67, 0x1b, 0xa0, + 0xdb, 0x67, 0x7f, 0x11, 0x5c, 0x7a, 0xf5, 0xf9, 0xdb, 0xbb, 0xc4, 0x6a, 0x69, 0x65, 0xea, 0xd9, + 0xdb, 0x8c, 0xf2, 0x55, 0x9b, 0xe8, 0x5e, 0xed, 0x9f, 0xf7, 0xa3, 0x02, 0x3a, 0x1f, 0x15, 0xd0, + 0xa7, 0x51, 0x01, 0x7d, 0x1d, 0x15, 0xd0, 0x6b, 0x84, 0x5a, 0x0b, 0x81, 0x9b, 0x1b, 0xbf, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x7b, 0x51, 0x8d, 0x4f, 0x9e, 0x05, 0x00, 0x00, } diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/lds.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/lds.pb.validate.go new file mode 100644 index 00000000..274dde2b --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/lds.pb.validate.go @@ -0,0 +1,239 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/lds.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Listener with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Listener) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + Field: "Address", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if len(m.GetFilterChains()) < 1 { + return ListenerValidationError{ + Field: "FilterChains", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetFilterChains() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + Field: fmt.Sprintf("FilterChains[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetUseOriginalDst()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + Field: "UseOriginalDst", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetPerConnectionBufferLimitBytes()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + Field: "PerConnectionBufferLimitBytes", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + Field: "Metadata", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDeprecatedV1()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + Field: "DeprecatedV1", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for DrainType + + for idx, item := range m.GetListenerFilters() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + Field: fmt.Sprintf("ListenerFilters[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetTransparent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + Field: "Transparent", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetFreebind()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerValidationError{ + Field: "Freebind", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// ListenerValidationError is the validation error returned by +// Listener.Validate if the designated constraints aren't met. +type ListenerValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ListenerValidationError) 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 %sListener.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ListenerValidationError{} + +// Validate checks the field values on Listener_DeprecatedV1 with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Listener_DeprecatedV1) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetBindToPort()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Listener_DeprecatedV1ValidationError{ + Field: "BindToPort", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// Listener_DeprecatedV1ValidationError is the validation error returned by +// Listener_DeprecatedV1.Validate if the designated constraints aren't met. +type Listener_DeprecatedV1ValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Listener_DeprecatedV1ValidationError) 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 %sListener_DeprecatedV1.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Listener_DeprecatedV1ValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/listener/listener.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/listener/listener.pb.validate.go new file mode 100644 index 00000000..5f79e0dd --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/listener/listener.pb.validate.go @@ -0,0 +1,422 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/listener/listener.proto +// DO NOT EDIT!!! + +package listener + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Filter with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Filter) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return FilterValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterValidationError{ + Field: "Config", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDeprecatedV1()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterValidationError{ + Field: "DeprecatedV1", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// FilterValidationError is the validation error returned by Filter.Validate if +// the designated constraints aren't met. +type FilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e FilterValidationError) 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 %sFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = FilterValidationError{} + +// Validate checks the field values on FilterChainMatch with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *FilterChainMatch) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetPrefixRanges() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainMatchValidationError{ + Field: fmt.Sprintf("PrefixRanges[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for AddressSuffix + + if v, ok := interface{}(m.GetSuffixLen()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainMatchValidationError{ + Field: "SuffixLen", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetSourcePrefixRanges() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainMatchValidationError{ + Field: fmt.Sprintf("SourcePrefixRanges[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetSourcePorts() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainMatchValidationError{ + Field: fmt.Sprintf("SourcePorts[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetDestinationPort()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainMatchValidationError{ + Field: "DestinationPort", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// FilterChainMatchValidationError is the validation error returned by +// FilterChainMatch.Validate if the designated constraints aren't met. +type FilterChainMatchValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e FilterChainMatchValidationError) 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 %sFilterChainMatch.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = FilterChainMatchValidationError{} + +// Validate checks the field values on FilterChain with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *FilterChain) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetFilterChainMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainValidationError{ + Field: "FilterChainMatch", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTlsContext()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainValidationError{ + Field: "TlsContext", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetFilters() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainValidationError{ + Field: fmt.Sprintf("Filters[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetUseProxyProto()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainValidationError{ + Field: "UseProxyProto", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainValidationError{ + Field: "Metadata", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTransportSocket()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FilterChainValidationError{ + Field: "TransportSocket", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// FilterChainValidationError is the validation error returned by +// FilterChain.Validate if the designated constraints aren't met. +type FilterChainValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e FilterChainValidationError) 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 %sFilterChain.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = FilterChainValidationError{} + +// Validate checks the field values on ListenerFilter with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ListenerFilter) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return ListenerFilterValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ListenerFilterValidationError{ + Field: "Config", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// ListenerFilterValidationError is the validation error returned by +// ListenerFilter.Validate if the designated constraints aren't met. +type ListenerFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ListenerFilterValidationError) 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 %sListenerFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ListenerFilterValidationError{} + +// Validate checks the field values on Filter_DeprecatedV1 with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Filter_DeprecatedV1) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Type + + return nil +} + +// Filter_DeprecatedV1ValidationError is the validation error returned by +// Filter_DeprecatedV1.Validate if the designated constraints aren't met. +type Filter_DeprecatedV1ValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Filter_DeprecatedV1ValidationError) 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 %sFilter_DeprecatedV1.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Filter_DeprecatedV1ValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/ratelimit/ratelimit.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/ratelimit/ratelimit.pb.validate.go new file mode 100644 index 00000000..34480f7b --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/ratelimit/ratelimit.pb.validate.go @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/ratelimit/ratelimit.proto +// DO NOT EDIT!!! + +package ratelimit + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on RateLimitDescriptor with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RateLimitDescriptor) Validate() error { + if m == nil { + return nil + } + + if len(m.GetEntries()) < 1 { + return RateLimitDescriptorValidationError{ + Field: "Entries", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetEntries() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimitDescriptorValidationError{ + Field: fmt.Sprintf("Entries[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// RateLimitDescriptorValidationError is the validation error returned by +// RateLimitDescriptor.Validate if the designated constraints aren't met. +type RateLimitDescriptorValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitDescriptorValidationError) 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 %sRateLimitDescriptor.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitDescriptorValidationError{} + +// Validate checks the field values on RateLimitDescriptor_Entry with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RateLimitDescriptor_Entry) Validate() error { + if m == nil { + return nil + } + + if len(m.GetKey()) < 1 { + return RateLimitDescriptor_EntryValidationError{ + Field: "Key", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetValue()) < 1 { + return RateLimitDescriptor_EntryValidationError{ + Field: "Value", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// RateLimitDescriptor_EntryValidationError is the validation error returned by +// RateLimitDescriptor_Entry.Validate if the designated constraints aren't met. +type RateLimitDescriptor_EntryValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitDescriptor_EntryValidationError) 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 %sRateLimitDescriptor_Entry.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitDescriptor_EntryValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/rds.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/rds.pb.validate.go new file mode 100644 index 00000000..a7a52165 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/rds.pb.validate.go @@ -0,0 +1,134 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/rds.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on RouteConfiguration with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RouteConfiguration) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + for idx, item := range m.GetVirtualHosts() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteConfigurationValidationError{ + Field: fmt.Sprintf("VirtualHosts[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetResponseHeadersToAdd() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteConfigurationValidationError{ + Field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetRequestHeadersToAdd() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteConfigurationValidationError{ + Field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetValidateClusters()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteConfigurationValidationError{ + Field: "ValidateClusters", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// RouteConfigurationValidationError is the validation error returned by +// RouteConfiguration.Validate if the designated constraints aren't met. +type RouteConfigurationValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteConfigurationValidationError) 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 %sRouteConfiguration.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteConfigurationValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/route/route.pb.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/route/route.pb.go index 9f957b29..6c063230 100644 --- a/github.com/envoyproxy/go-control-plane/envoy/api/v2/route/route.pb.go +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/route/route.pb.go @@ -2417,7 +2417,6 @@ type HeaderMatcher struct { // * The regex *\d{3}* does not match the value *1234* // * The regex *\d{3}* does not match the value *123.456* Regex *google_protobuf1.BoolValue `protobuf:"bytes,3,opt,name=regex" json:"regex,omitempty"` - // [#not-implemented-hide:] // Specifies how the header match will be performed to route the request. // If header_match_specifier is absent, a request that has the // :ref:`envoy_api_msg_route.HeaderMatcher.name` header will match, regardless of the header's diff --git a/github.com/envoyproxy/go-control-plane/envoy/api/v2/route/route.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/api/v2/route/route.pb.validate.go new file mode 100644 index 00000000..cc9b4c67 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/api/v2/route/route.pb.validate.go @@ -0,0 +1,2152 @@ +// Code generated by protoc-gen-validate +// source: envoy/api/v2/route/route.proto +// DO NOT EDIT!!! + +package route + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on VirtualHost with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *VirtualHost) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return VirtualHostValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetDomains()) < 1 { + return VirtualHostValidationError{ + Field: "Domains", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetRoutes() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VirtualHostValidationError{ + Field: fmt.Sprintf("Routes[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for RequireTls + + for idx, item := range m.GetVirtualClusters() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VirtualHostValidationError{ + Field: fmt.Sprintf("VirtualClusters[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetRateLimits() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VirtualHostValidationError{ + Field: fmt.Sprintf("RateLimits[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetRequestHeadersToAdd() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VirtualHostValidationError{ + Field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetResponseHeadersToAdd() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VirtualHostValidationError{ + Field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VirtualHostValidationError{ + Field: "Cors", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VirtualHostValidationError{ + Field: "Auth", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// VirtualHostValidationError is the validation error returned by +// VirtualHost.Validate if the designated constraints aren't met. +type VirtualHostValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e VirtualHostValidationError) 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 %sVirtualHost.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = VirtualHostValidationError{} + +// Validate checks the field values on Route with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Route) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteValidationError{ + Field: "Match", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteValidationError{ + Field: "Metadata", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDecorator()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteValidationError{ + Field: "Decorator", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteValidationError{ + Field: "Auth", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + switch m.Action.(type) { + + case *Route_Route: + + if v, ok := interface{}(m.GetRoute()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteValidationError{ + Field: "Route", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *Route_Redirect: + + if v, ok := interface{}(m.GetRedirect()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteValidationError{ + Field: "Redirect", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *Route_DirectResponse: + + if v, ok := interface{}(m.GetDirectResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteValidationError{ + Field: "DirectResponse", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return RouteValidationError{ + Field: "Action", + Reason: "value is required", + } + + } + + return nil +} + +// RouteValidationError is the validation error returned by Route.Validate if +// the designated constraints aren't met. +type RouteValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteValidationError) 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 %sRoute.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteValidationError{} + +// Validate checks the field values on WeightedCluster with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *WeightedCluster) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClusters()) < 1 { + return WeightedClusterValidationError{ + Field: "Clusters", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetClusters() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return WeightedClusterValidationError{ + Field: fmt.Sprintf("Clusters[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if wrapper := m.GetTotalWeight(); wrapper != nil { + + if wrapper.GetValue() < 1 { + return WeightedClusterValidationError{ + Field: "TotalWeight", + Reason: "value must be greater than or equal to 1", + } + } + + } + + // no validation rules for RuntimeKeyPrefix + + return nil +} + +// WeightedClusterValidationError is the validation error returned by +// WeightedCluster.Validate if the designated constraints aren't met. +type WeightedClusterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e WeightedClusterValidationError) 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 %sWeightedCluster.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = WeightedClusterValidationError{} + +// Validate checks the field values on RouteMatch with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *RouteMatch) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetCaseSensitive()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteMatchValidationError{ + Field: "CaseSensitive", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRuntime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteMatchValidationError{ + Field: "Runtime", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetHeaders() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteMatchValidationError{ + Field: fmt.Sprintf("Headers[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetQueryParameters() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteMatchValidationError{ + Field: fmt.Sprintf("QueryParameters[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + switch m.PathSpecifier.(type) { + + case *RouteMatch_Prefix: + // no validation rules for Prefix + + case *RouteMatch_Path: + // no validation rules for Path + + case *RouteMatch_Regex: + // no validation rules for Regex + + default: + return RouteMatchValidationError{ + Field: "PathSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// RouteMatchValidationError is the validation error returned by +// RouteMatch.Validate if the designated constraints aren't met. +type RouteMatchValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteMatchValidationError) 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 %sRouteMatch.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteMatchValidationError{} + +// Validate checks the field values on CorsPolicy with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *CorsPolicy) Validate() error { + if m == nil { + return nil + } + + // no validation rules for AllowMethods + + // no validation rules for AllowHeaders + + // no validation rules for ExposeHeaders + + // no validation rules for MaxAge + + if v, ok := interface{}(m.GetAllowCredentials()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CorsPolicyValidationError{ + Field: "AllowCredentials", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetEnabled()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CorsPolicyValidationError{ + Field: "Enabled", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// CorsPolicyValidationError is the validation error returned by +// CorsPolicy.Validate if the designated constraints aren't met. +type CorsPolicyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CorsPolicyValidationError) 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 %sCorsPolicy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CorsPolicyValidationError{} + +// Validate checks the field values on RouteAction with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *RouteAction) Validate() error { + if m == nil { + return nil + } + + if _, ok := RouteAction_ClusterNotFoundResponseCode_name[int32(m.GetClusterNotFoundResponseCode())]; !ok { + return RouteActionValidationError{ + Field: "ClusterNotFoundResponseCode", + Reason: "value must be one of the defined enum values", + } + } + + if v, ok := interface{}(m.GetMetadataMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: "MetadataMatch", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for PrefixRewrite + + if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: "Timeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: "RetryPolicy", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRequestMirrorPolicy()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: "RequestMirrorPolicy", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for Priority + + for idx, item := range m.GetRequestHeadersToAdd() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetResponseHeadersToAdd() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetRateLimits() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: fmt.Sprintf("RateLimits[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetIncludeVhRateLimits()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: "IncludeVhRateLimits", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetHashPolicy() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: fmt.Sprintf("HashPolicy[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetUseWebsocket()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: "UseWebsocket", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: "Cors", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + switch m.ClusterSpecifier.(type) { + + case *RouteAction_Cluster: + // no validation rules for Cluster + + case *RouteAction_ClusterHeader: + // no validation rules for ClusterHeader + + case *RouteAction_WeightedClusters: + + if v, ok := interface{}(m.GetWeightedClusters()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: "WeightedClusters", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return RouteActionValidationError{ + Field: "ClusterSpecifier", + Reason: "value is required", + } + + } + + switch m.HostRewriteSpecifier.(type) { + + case *RouteAction_HostRewrite: + // no validation rules for HostRewrite + + case *RouteAction_AutoHostRewrite: + + if v, ok := interface{}(m.GetAutoHostRewrite()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteActionValidationError{ + Field: "AutoHostRewrite", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// RouteActionValidationError is the validation error returned by +// RouteAction.Validate if the designated constraints aren't met. +type RouteActionValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteActionValidationError) 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 %sRouteAction.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteActionValidationError{} + +// Validate checks the field values on RedirectAction with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *RedirectAction) Validate() error { + if m == nil { + return nil + } + + // no validation rules for HostRedirect + + if _, ok := RedirectAction_RedirectResponseCode_name[int32(m.GetResponseCode())]; !ok { + return RedirectActionValidationError{ + Field: "ResponseCode", + Reason: "value must be one of the defined enum values", + } + } + + // no validation rules for HttpsRedirect + + // no validation rules for StripQuery + + switch m.PathRewriteSpecifier.(type) { + + case *RedirectAction_PathRedirect: + // no validation rules for PathRedirect + + case *RedirectAction_PrefixRewrite: + // no validation rules for PrefixRewrite + + } + + return nil +} + +// RedirectActionValidationError is the validation error returned by +// RedirectAction.Validate if the designated constraints aren't met. +type RedirectActionValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RedirectActionValidationError) 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 %sRedirectAction.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RedirectActionValidationError{} + +// Validate checks the field values on DirectResponseAction with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *DirectResponseAction) Validate() error { + if m == nil { + return nil + } + + if val := m.GetStatus(); val < 100 || val >= 600 { + return DirectResponseActionValidationError{ + Field: "Status", + Reason: "value must be inside range [100, 600)", + } + } + + if v, ok := interface{}(m.GetBody()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DirectResponseActionValidationError{ + Field: "Body", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// DirectResponseActionValidationError is the validation error returned by +// DirectResponseAction.Validate if the designated constraints aren't met. +type DirectResponseActionValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e DirectResponseActionValidationError) 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 %sDirectResponseAction.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = DirectResponseActionValidationError{} + +// Validate checks the field values on Decorator with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Decorator) Validate() error { + if m == nil { + return nil + } + + if len(m.GetOperation()) < 1 { + return DecoratorValidationError{ + Field: "Operation", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// DecoratorValidationError is the validation error returned by +// Decorator.Validate if the designated constraints aren't met. +type DecoratorValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e DecoratorValidationError) 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 %sDecorator.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = DecoratorValidationError{} + +// Validate checks the field values on VirtualCluster with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *VirtualCluster) Validate() error { + if m == nil { + return nil + } + + if len(m.GetPattern()) < 1 { + return VirtualClusterValidationError{ + Field: "Pattern", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetName()) < 1 { + return VirtualClusterValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Method + + return nil +} + +// VirtualClusterValidationError is the validation error returned by +// VirtualCluster.Validate if the designated constraints aren't met. +type VirtualClusterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e VirtualClusterValidationError) 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 %sVirtualCluster.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = VirtualClusterValidationError{} + +// Validate checks the field values on RateLimit with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *RateLimit) Validate() error { + if m == nil { + return nil + } + + if wrapper := m.GetStage(); wrapper != nil { + + if wrapper.GetValue() > 10 { + return RateLimitValidationError{ + Field: "Stage", + Reason: "value must be less than or equal to 10", + } + } + + } + + // no validation rules for DisableKey + + if len(m.GetActions()) < 1 { + return RateLimitValidationError{ + Field: "Actions", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetActions() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimitValidationError{ + Field: fmt.Sprintf("Actions[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// RateLimitValidationError is the validation error returned by +// RateLimit.Validate if the designated constraints aren't met. +type RateLimitValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitValidationError) 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 %sRateLimit.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitValidationError{} + +// Validate checks the field values on HeaderMatcher with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *HeaderMatcher) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return HeaderMatcherValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Value + + if v, ok := interface{}(m.GetRegex()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMatcherValidationError{ + Field: "Regex", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + switch m.HeaderMatchSpecifier.(type) { + + case *HeaderMatcher_ExactMatch: + // no validation rules for ExactMatch + + case *HeaderMatcher_RegexMatch: + // no validation rules for RegexMatch + + case *HeaderMatcher_RangeMatch: + + if v, ok := interface{}(m.GetRangeMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HeaderMatcherValidationError{ + Field: "RangeMatch", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// HeaderMatcherValidationError is the validation error returned by +// HeaderMatcher.Validate if the designated constraints aren't met. +type HeaderMatcherValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HeaderMatcherValidationError) 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 %sHeaderMatcher.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HeaderMatcherValidationError{} + +// Validate checks the field values on QueryParameterMatcher with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *QueryParameterMatcher) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return QueryParameterMatcherValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Value + + if v, ok := interface{}(m.GetRegex()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return QueryParameterMatcherValidationError{ + Field: "Regex", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// QueryParameterMatcherValidationError is the validation error returned by +// QueryParameterMatcher.Validate if the designated constraints aren't met. +type QueryParameterMatcherValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e QueryParameterMatcherValidationError) 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 %sQueryParameterMatcher.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = QueryParameterMatcherValidationError{} + +// Validate checks the field values on WeightedCluster_ClusterWeight with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *WeightedCluster_ClusterWeight) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return WeightedCluster_ClusterWeightValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetWeight()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return WeightedCluster_ClusterWeightValidationError{ + Field: "Weight", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMetadataMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return WeightedCluster_ClusterWeightValidationError{ + Field: "MetadataMatch", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetRequestHeadersToAdd() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return WeightedCluster_ClusterWeightValidationError{ + Field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetResponseHeadersToAdd() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return WeightedCluster_ClusterWeightValidationError{ + Field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// WeightedCluster_ClusterWeightValidationError is the validation error +// returned by WeightedCluster_ClusterWeight.Validate if the designated +// constraints aren't met. +type WeightedCluster_ClusterWeightValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e WeightedCluster_ClusterWeightValidationError) 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 %sWeightedCluster_ClusterWeight.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = WeightedCluster_ClusterWeightValidationError{} + +// Validate checks the field values on RouteAction_RetryPolicy with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RouteAction_RetryPolicy) Validate() error { + if m == nil { + return nil + } + + // no validation rules for RetryOn + + if v, ok := interface{}(m.GetNumRetries()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteAction_RetryPolicyValidationError{ + Field: "NumRetries", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetPerTryTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteAction_RetryPolicyValidationError{ + Field: "PerTryTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// RouteAction_RetryPolicyValidationError is the validation error returned by +// RouteAction_RetryPolicy.Validate if the designated constraints aren't met. +type RouteAction_RetryPolicyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteAction_RetryPolicyValidationError) 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 %sRouteAction_RetryPolicy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteAction_RetryPolicyValidationError{} + +// Validate checks the field values on RouteAction_RequestMirrorPolicy with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RouteAction_RequestMirrorPolicy) Validate() error { + if m == nil { + return nil + } + + if len(m.GetCluster()) < 1 { + return RouteAction_RequestMirrorPolicyValidationError{ + Field: "Cluster", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for RuntimeKey + + return nil +} + +// RouteAction_RequestMirrorPolicyValidationError is the validation error +// returned by RouteAction_RequestMirrorPolicy.Validate if the designated +// constraints aren't met. +type RouteAction_RequestMirrorPolicyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteAction_RequestMirrorPolicyValidationError) 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 %sRouteAction_RequestMirrorPolicy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteAction_RequestMirrorPolicyValidationError{} + +// Validate checks the field values on RouteAction_HashPolicy with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RouteAction_HashPolicy) Validate() error { + if m == nil { + return nil + } + + switch m.PolicySpecifier.(type) { + + case *RouteAction_HashPolicy_Header_: + + if v, ok := interface{}(m.GetHeader()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteAction_HashPolicyValidationError{ + Field: "Header", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *RouteAction_HashPolicy_Cookie_: + + if v, ok := interface{}(m.GetCookie()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteAction_HashPolicyValidationError{ + Field: "Cookie", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *RouteAction_HashPolicy_ConnectionProperties_: + + if v, ok := interface{}(m.GetConnectionProperties()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteAction_HashPolicyValidationError{ + Field: "ConnectionProperties", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return RouteAction_HashPolicyValidationError{ + Field: "PolicySpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// RouteAction_HashPolicyValidationError is the validation error returned by +// RouteAction_HashPolicy.Validate if the designated constraints aren't met. +type RouteAction_HashPolicyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteAction_HashPolicyValidationError) 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 %sRouteAction_HashPolicy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteAction_HashPolicyValidationError{} + +// Validate checks the field values on RouteAction_HashPolicy_Header with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RouteAction_HashPolicy_Header) Validate() error { + if m == nil { + return nil + } + + if len(m.GetHeaderName()) < 1 { + return RouteAction_HashPolicy_HeaderValidationError{ + Field: "HeaderName", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// RouteAction_HashPolicy_HeaderValidationError is the validation error +// returned by RouteAction_HashPolicy_Header.Validate if the designated +// constraints aren't met. +type RouteAction_HashPolicy_HeaderValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteAction_HashPolicy_HeaderValidationError) 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 %sRouteAction_HashPolicy_Header.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteAction_HashPolicy_HeaderValidationError{} + +// Validate checks the field values on RouteAction_HashPolicy_Cookie with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RouteAction_HashPolicy_Cookie) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return RouteAction_HashPolicy_CookieValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetTtl()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouteAction_HashPolicy_CookieValidationError{ + Field: "Ttl", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// RouteAction_HashPolicy_CookieValidationError is the validation error +// returned by RouteAction_HashPolicy_Cookie.Validate if the designated +// constraints aren't met. +type RouteAction_HashPolicy_CookieValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteAction_HashPolicy_CookieValidationError) 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 %sRouteAction_HashPolicy_Cookie.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteAction_HashPolicy_CookieValidationError{} + +// Validate checks the field values on +// RouteAction_HashPolicy_ConnectionProperties with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *RouteAction_HashPolicy_ConnectionProperties) Validate() error { + if m == nil { + return nil + } + + // no validation rules for SourceIp + + return nil +} + +// RouteAction_HashPolicy_ConnectionPropertiesValidationError is the validation +// error returned by RouteAction_HashPolicy_ConnectionProperties.Validate if +// the designated constraints aren't met. +type RouteAction_HashPolicy_ConnectionPropertiesValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) 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 %sRouteAction_HashPolicy_ConnectionProperties.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouteAction_HashPolicy_ConnectionPropertiesValidationError{} + +// Validate checks the field values on RateLimit_Action with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *RateLimit_Action) Validate() error { + if m == nil { + return nil + } + + switch m.ActionSpecifier.(type) { + + case *RateLimit_Action_SourceCluster_: + + if v, ok := interface{}(m.GetSourceCluster()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimit_ActionValidationError{ + Field: "SourceCluster", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *RateLimit_Action_DestinationCluster_: + + if v, ok := interface{}(m.GetDestinationCluster()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimit_ActionValidationError{ + Field: "DestinationCluster", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *RateLimit_Action_RequestHeaders_: + + if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimit_ActionValidationError{ + Field: "RequestHeaders", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *RateLimit_Action_RemoteAddress_: + + if v, ok := interface{}(m.GetRemoteAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimit_ActionValidationError{ + Field: "RemoteAddress", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *RateLimit_Action_GenericKey_: + + if v, ok := interface{}(m.GetGenericKey()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimit_ActionValidationError{ + Field: "GenericKey", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *RateLimit_Action_HeaderValueMatch_: + + if v, ok := interface{}(m.GetHeaderValueMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimit_ActionValidationError{ + Field: "HeaderValueMatch", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return RateLimit_ActionValidationError{ + Field: "ActionSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// RateLimit_ActionValidationError is the validation error returned by +// RateLimit_Action.Validate if the designated constraints aren't met. +type RateLimit_ActionValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimit_ActionValidationError) 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 %sRateLimit_Action.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimit_ActionValidationError{} + +// Validate checks the field values on RateLimit_Action_SourceCluster with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RateLimit_Action_SourceCluster) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// RateLimit_Action_SourceClusterValidationError is the validation error +// returned by RateLimit_Action_SourceCluster.Validate if the designated +// constraints aren't met. +type RateLimit_Action_SourceClusterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimit_Action_SourceClusterValidationError) 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 %sRateLimit_Action_SourceCluster.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimit_Action_SourceClusterValidationError{} + +// Validate checks the field values on RateLimit_Action_DestinationCluster with +// the rules defined in the proto definition for this message. If any rules +// are violated, an error is returned. +func (m *RateLimit_Action_DestinationCluster) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// RateLimit_Action_DestinationClusterValidationError is the validation error +// returned by RateLimit_Action_DestinationCluster.Validate if the designated +// constraints aren't met. +type RateLimit_Action_DestinationClusterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimit_Action_DestinationClusterValidationError) 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 %sRateLimit_Action_DestinationCluster.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimit_Action_DestinationClusterValidationError{} + +// Validate checks the field values on RateLimit_Action_RequestHeaders with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RateLimit_Action_RequestHeaders) Validate() error { + if m == nil { + return nil + } + + if len(m.GetHeaderName()) < 1 { + return RateLimit_Action_RequestHeadersValidationError{ + Field: "HeaderName", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetDescriptorKey()) < 1 { + return RateLimit_Action_RequestHeadersValidationError{ + Field: "DescriptorKey", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// RateLimit_Action_RequestHeadersValidationError is the validation error +// returned by RateLimit_Action_RequestHeaders.Validate if the designated +// constraints aren't met. +type RateLimit_Action_RequestHeadersValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimit_Action_RequestHeadersValidationError) 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 %sRateLimit_Action_RequestHeaders.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimit_Action_RequestHeadersValidationError{} + +// Validate checks the field values on RateLimit_Action_RemoteAddress with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RateLimit_Action_RemoteAddress) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// RateLimit_Action_RemoteAddressValidationError is the validation error +// returned by RateLimit_Action_RemoteAddress.Validate if the designated +// constraints aren't met. +type RateLimit_Action_RemoteAddressValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimit_Action_RemoteAddressValidationError) 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 %sRateLimit_Action_RemoteAddress.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimit_Action_RemoteAddressValidationError{} + +// Validate checks the field values on RateLimit_Action_GenericKey with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RateLimit_Action_GenericKey) Validate() error { + if m == nil { + return nil + } + + if len(m.GetDescriptorValue()) < 1 { + return RateLimit_Action_GenericKeyValidationError{ + Field: "DescriptorValue", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// RateLimit_Action_GenericKeyValidationError is the validation error returned +// by RateLimit_Action_GenericKey.Validate if the designated constraints +// aren't met. +type RateLimit_Action_GenericKeyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimit_Action_GenericKeyValidationError) 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 %sRateLimit_Action_GenericKey.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimit_Action_GenericKeyValidationError{} + +// Validate checks the field values on RateLimit_Action_HeaderValueMatch with +// the rules defined in the proto definition for this message. If any rules +// are violated, an error is returned. +func (m *RateLimit_Action_HeaderValueMatch) Validate() error { + if m == nil { + return nil + } + + if len(m.GetDescriptorValue()) < 1 { + return RateLimit_Action_HeaderValueMatchValidationError{ + Field: "DescriptorValue", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetExpectMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimit_Action_HeaderValueMatchValidationError{ + Field: "ExpectMatch", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if len(m.GetHeaders()) < 1 { + return RateLimit_Action_HeaderValueMatchValidationError{ + Field: "Headers", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetHeaders() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimit_Action_HeaderValueMatchValidationError{ + Field: fmt.Sprintf("Headers[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// RateLimit_Action_HeaderValueMatchValidationError is the validation error +// returned by RateLimit_Action_HeaderValueMatch.Validate if the designated +// constraints aren't met. +type RateLimit_Action_HeaderValueMatchValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimit_Action_HeaderValueMatchValidationError) 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 %sRateLimit_Action_HeaderValueMatch.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimit_Action_HeaderValueMatchValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v2/als.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v2/als.pb.validate.go new file mode 100644 index 00000000..9c9a222a --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v2/als.pb.validate.go @@ -0,0 +1,219 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/accesslog/v2/als.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on TcpGrpcAccessLogConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *TcpGrpcAccessLogConfig) Validate() error { + if m == nil { + return nil + } + + if m.GetCommonConfig() == nil { + return TcpGrpcAccessLogConfigValidationError{ + Field: "CommonConfig", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetCommonConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TcpGrpcAccessLogConfigValidationError{ + Field: "CommonConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// TcpGrpcAccessLogConfigValidationError is the validation error returned by +// TcpGrpcAccessLogConfig.Validate if the designated constraints aren't met. +type TcpGrpcAccessLogConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TcpGrpcAccessLogConfigValidationError) 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 %sTcpGrpcAccessLogConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TcpGrpcAccessLogConfigValidationError{} + +// Validate checks the field values on HttpGrpcAccessLogConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HttpGrpcAccessLogConfig) Validate() error { + if m == nil { + return nil + } + + if m.GetCommonConfig() == nil { + return HttpGrpcAccessLogConfigValidationError{ + Field: "CommonConfig", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetCommonConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpGrpcAccessLogConfigValidationError{ + Field: "CommonConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// HttpGrpcAccessLogConfigValidationError is the validation error returned by +// HttpGrpcAccessLogConfig.Validate if the designated constraints aren't met. +type HttpGrpcAccessLogConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HttpGrpcAccessLogConfigValidationError) 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 %sHttpGrpcAccessLogConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HttpGrpcAccessLogConfigValidationError{} + +// Validate checks the field values on CommonGrpcAccessLogConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *CommonGrpcAccessLogConfig) Validate() error { + if m == nil { + return nil + } + + if len(m.GetLogName()) < 1 { + return CommonGrpcAccessLogConfigValidationError{ + Field: "LogName", + Reason: "value length must be at least 1 bytes", + } + } + + if m.GetGrpcService() == nil { + return CommonGrpcAccessLogConfigValidationError{ + Field: "GrpcService", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CommonGrpcAccessLogConfigValidationError{ + Field: "GrpcService", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// CommonGrpcAccessLogConfigValidationError is the validation error returned by +// CommonGrpcAccessLogConfig.Validate if the designated constraints aren't met. +type CommonGrpcAccessLogConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CommonGrpcAccessLogConfigValidationError) 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 %sCommonGrpcAccessLogConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CommonGrpcAccessLogConfigValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v2/bootstrap.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v2/bootstrap.pb.validate.go new file mode 100644 index 00000000..e3a958af --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/bootstrap/v2/bootstrap.pb.validate.go @@ -0,0 +1,737 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/bootstrap/v2/bootstrap.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Bootstrap with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Bootstrap) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "Node", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetStaticResources()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "StaticResources", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDynamicResources()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "DynamicResources", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetClusterManager()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "ClusterManager", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for FlagsPath + + for idx, item := range m.GetStatsSinks() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: fmt.Sprintf("StatsSinks[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetStatsConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "StatsConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetStatsFlushInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "StatsFlushInterval", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetWatchdog()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "Watchdog", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "Tracing", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRateLimitService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "RateLimitService", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRuntime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "Runtime", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetAdmin()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BootstrapValidationError{ + Field: "Admin", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// BootstrapValidationError is the validation error returned by +// Bootstrap.Validate if the designated constraints aren't met. +type BootstrapValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e BootstrapValidationError) 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 %sBootstrap.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = BootstrapValidationError{} + +// Validate checks the field values on Admin with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Admin) Validate() error { + if m == nil { + return nil + } + + if len(m.GetAccessLogPath()) < 1 { + return AdminValidationError{ + Field: "AccessLogPath", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for ProfilePath + + if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AdminValidationError{ + Field: "Address", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// AdminValidationError is the validation error returned by Admin.Validate if +// the designated constraints aren't met. +type AdminValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AdminValidationError) 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 %sAdmin.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AdminValidationError{} + +// Validate checks the field values on ClusterManager with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ClusterManager) Validate() error { + if m == nil { + return nil + } + + // no validation rules for LocalClusterName + + if v, ok := interface{}(m.GetOutlierDetection()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterManagerValidationError{ + Field: "OutlierDetection", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetUpstreamBindConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterManagerValidationError{ + Field: "UpstreamBindConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetLoadStatsConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterManagerValidationError{ + Field: "LoadStatsConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// ClusterManagerValidationError is the validation error returned by +// ClusterManager.Validate if the designated constraints aren't met. +type ClusterManagerValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ClusterManagerValidationError) 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 %sClusterManager.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ClusterManagerValidationError{} + +// Validate checks the field values on Watchdog with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Watchdog) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetMissTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return WatchdogValidationError{ + Field: "MissTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMegamissTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return WatchdogValidationError{ + Field: "MegamissTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetKillTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return WatchdogValidationError{ + Field: "KillTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMultikillTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return WatchdogValidationError{ + Field: "MultikillTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// WatchdogValidationError is the validation error returned by +// Watchdog.Validate if the designated constraints aren't met. +type WatchdogValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e WatchdogValidationError) 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 %sWatchdog.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = WatchdogValidationError{} + +// Validate checks the field values on Runtime with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Runtime) Validate() error { + if m == nil { + return nil + } + + if len(m.GetSymlinkRoot()) < 1 { + return RuntimeValidationError{ + Field: "SymlinkRoot", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Subdirectory + + // no validation rules for OverrideSubdirectory + + return nil +} + +// RuntimeValidationError is the validation error returned by Runtime.Validate +// if the designated constraints aren't met. +type RuntimeValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RuntimeValidationError) 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 %sRuntime.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RuntimeValidationError{} + +// Validate checks the field values on Bootstrap_StaticResources with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Bootstrap_StaticResources) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetListeners() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Bootstrap_StaticResourcesValidationError{ + Field: fmt.Sprintf("Listeners[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetClusters() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Bootstrap_StaticResourcesValidationError{ + Field: fmt.Sprintf("Clusters[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetSecrets() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Bootstrap_StaticResourcesValidationError{ + Field: fmt.Sprintf("Secrets[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// Bootstrap_StaticResourcesValidationError is the validation error returned by +// Bootstrap_StaticResources.Validate if the designated constraints aren't met. +type Bootstrap_StaticResourcesValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Bootstrap_StaticResourcesValidationError) 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 %sBootstrap_StaticResources.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Bootstrap_StaticResourcesValidationError{} + +// Validate checks the field values on Bootstrap_DynamicResources with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Bootstrap_DynamicResources) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetLdsConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Bootstrap_DynamicResourcesValidationError{ + Field: "LdsConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetCdsConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Bootstrap_DynamicResourcesValidationError{ + Field: "CdsConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetAdsConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Bootstrap_DynamicResourcesValidationError{ + Field: "AdsConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDeprecatedV1()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Bootstrap_DynamicResourcesValidationError{ + Field: "DeprecatedV1", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// Bootstrap_DynamicResourcesValidationError is the validation error returned +// by Bootstrap_DynamicResources.Validate if the designated constraints aren't met. +type Bootstrap_DynamicResourcesValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Bootstrap_DynamicResourcesValidationError) 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 %sBootstrap_DynamicResources.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Bootstrap_DynamicResourcesValidationError{} + +// Validate checks the field values on Bootstrap_DynamicResources_DeprecatedV1 +// with the rules defined in the proto definition for this message. If any +// rules are violated, an error is returned. +func (m *Bootstrap_DynamicResources_DeprecatedV1) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetSdsConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Bootstrap_DynamicResources_DeprecatedV1ValidationError{ + Field: "SdsConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// Bootstrap_DynamicResources_DeprecatedV1ValidationError is the validation +// error returned by Bootstrap_DynamicResources_DeprecatedV1.Validate if the +// designated constraints aren't met. +type Bootstrap_DynamicResources_DeprecatedV1ValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Bootstrap_DynamicResources_DeprecatedV1ValidationError) 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 %sBootstrap_DynamicResources_DeprecatedV1.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Bootstrap_DynamicResources_DeprecatedV1ValidationError{} + +// Validate checks the field values on ClusterManager_OutlierDetection with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ClusterManager_OutlierDetection) Validate() error { + if m == nil { + return nil + } + + // no validation rules for EventLogPath + + return nil +} + +// ClusterManager_OutlierDetectionValidationError is the validation error +// returned by ClusterManager_OutlierDetection.Validate if the designated +// constraints aren't met. +type ClusterManager_OutlierDetectionValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ClusterManager_OutlierDetectionValidationError) 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 %sClusterManager_OutlierDetection.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ClusterManager_OutlierDetectionValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/accesslog/v2/accesslog.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/accesslog/v2/accesslog.pb.validate.go new file mode 100644 index 00000000..5b68adda --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/accesslog/v2/accesslog.pb.validate.go @@ -0,0 +1,1370 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/accesslog/v2/accesslog.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on AccessLogCommon with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *AccessLogCommon) Validate() error { + if m == nil { + return nil + } + + if m.GetSampleRate() > 1 { + return AccessLogCommonValidationError{ + Field: "SampleRate", + Reason: "value must be less than or equal to 1", + } + } + + if v, ok := interface{}(m.GetDownstreamRemoteAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "DownstreamRemoteAddress", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDownstreamLocalAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "DownstreamLocalAddress", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTlsProperties()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "TlsProperties", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "StartTime", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTimeToLastRxByte()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "TimeToLastRxByte", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTimeToFirstUpstreamTxByte()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "TimeToFirstUpstreamTxByte", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTimeToLastUpstreamTxByte()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "TimeToLastUpstreamTxByte", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTimeToFirstUpstreamRxByte()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "TimeToFirstUpstreamRxByte", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTimeToLastUpstreamRxByte()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "TimeToLastUpstreamRxByte", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTimeToFirstDownstreamTxByte()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "TimeToFirstDownstreamTxByte", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTimeToLastDownstreamTxByte()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "TimeToLastDownstreamTxByte", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetUpstreamRemoteAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "UpstreamRemoteAddress", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetUpstreamLocalAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "UpstreamLocalAddress", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for UpstreamCluster + + if v, ok := interface{}(m.GetResponseFlags()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "ResponseFlags", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogCommonValidationError{ + Field: "Metadata", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// AccessLogCommonValidationError is the validation error returned by +// AccessLogCommon.Validate if the designated constraints aren't met. +type AccessLogCommonValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AccessLogCommonValidationError) 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 %sAccessLogCommon.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AccessLogCommonValidationError{} + +// Validate checks the field values on ResponseFlags with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ResponseFlags) Validate() error { + if m == nil { + return nil + } + + // no validation rules for FailedLocalHealthcheck + + // no validation rules for NoHealthyUpstream + + // no validation rules for UpstreamRequestTimeout + + // no validation rules for LocalReset + + // no validation rules for UpstreamRemoteReset + + // no validation rules for UpstreamConnectionFailure + + // no validation rules for UpstreamConnectionTermination + + // no validation rules for UpstreamOverflow + + // no validation rules for NoRouteFound + + // no validation rules for DelayInjected + + // no validation rules for FaultInjected + + // no validation rules for RateLimited + + if v, ok := interface{}(m.GetUnauthorizedDetails()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResponseFlagsValidationError{ + Field: "UnauthorizedDetails", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// ResponseFlagsValidationError is the validation error returned by +// ResponseFlags.Validate if the designated constraints aren't met. +type ResponseFlagsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ResponseFlagsValidationError) 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 %sResponseFlags.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ResponseFlagsValidationError{} + +// Validate checks the field values on TLSProperties with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *TLSProperties) Validate() error { + if m == nil { + return nil + } + + // no validation rules for TlsVersion + + if v, ok := interface{}(m.GetTlsCipherSuite()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TLSPropertiesValidationError{ + Field: "TlsCipherSuite", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for TlsSniHostname + + return nil +} + +// TLSPropertiesValidationError is the validation error returned by +// TLSProperties.Validate if the designated constraints aren't met. +type TLSPropertiesValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TLSPropertiesValidationError) 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 %sTLSProperties.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TLSPropertiesValidationError{} + +// Validate checks the field values on TCPAccessLogEntry with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *TCPAccessLogEntry) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetCommonProperties()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TCPAccessLogEntryValidationError{ + Field: "CommonProperties", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// TCPAccessLogEntryValidationError is the validation error returned by +// TCPAccessLogEntry.Validate if the designated constraints aren't met. +type TCPAccessLogEntryValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TCPAccessLogEntryValidationError) 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 %sTCPAccessLogEntry.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TCPAccessLogEntryValidationError{} + +// Validate checks the field values on HTTPRequestProperties with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HTTPRequestProperties) Validate() error { + if m == nil { + return nil + } + + // no validation rules for RequestMethod + + // no validation rules for Scheme + + // no validation rules for Authority + + if v, ok := interface{}(m.GetPort()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HTTPRequestPropertiesValidationError{ + Field: "Port", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for Path + + // no validation rules for UserAgent + + // no validation rules for Referer + + // no validation rules for ForwardedFor + + // no validation rules for RequestId + + // no validation rules for OriginalPath + + // no validation rules for RequestHeadersBytes + + // no validation rules for RequestBodyBytes + + // no validation rules for RequestHeaders + + return nil +} + +// HTTPRequestPropertiesValidationError is the validation error returned by +// HTTPRequestProperties.Validate if the designated constraints aren't met. +type HTTPRequestPropertiesValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HTTPRequestPropertiesValidationError) 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 %sHTTPRequestProperties.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HTTPRequestPropertiesValidationError{} + +// Validate checks the field values on HTTPResponseProperties with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HTTPResponseProperties) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetResponseCode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HTTPResponsePropertiesValidationError{ + Field: "ResponseCode", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for ResponseHeadersBytes + + // no validation rules for ResponseBodyBytes + + // no validation rules for ResponseHeaders + + return nil +} + +// HTTPResponsePropertiesValidationError is the validation error returned by +// HTTPResponseProperties.Validate if the designated constraints aren't met. +type HTTPResponsePropertiesValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HTTPResponsePropertiesValidationError) 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 %sHTTPResponseProperties.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HTTPResponsePropertiesValidationError{} + +// Validate checks the field values on HTTPAccessLogEntry with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HTTPAccessLogEntry) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetCommonProperties()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HTTPAccessLogEntryValidationError{ + Field: "CommonProperties", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for ProtocolVersion + + if v, ok := interface{}(m.GetRequest()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HTTPAccessLogEntryValidationError{ + Field: "Request", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HTTPAccessLogEntryValidationError{ + Field: "Response", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// HTTPAccessLogEntryValidationError is the validation error returned by +// HTTPAccessLogEntry.Validate if the designated constraints aren't met. +type HTTPAccessLogEntryValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HTTPAccessLogEntryValidationError) 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 %sHTTPAccessLogEntry.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HTTPAccessLogEntryValidationError{} + +// Validate checks the field values on AccessLog with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *AccessLog) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogValidationError{ + Field: "Filter", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogValidationError{ + Field: "Config", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// AccessLogValidationError is the validation error returned by +// AccessLog.Validate if the designated constraints aren't met. +type AccessLogValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AccessLogValidationError) 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 %sAccessLog.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AccessLogValidationError{} + +// Validate checks the field values on AccessLogFilter with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *AccessLogFilter) Validate() error { + if m == nil { + return nil + } + + switch m.FilterSpecifier.(type) { + + case *AccessLogFilter_StatusCodeFilter: + + if v, ok := interface{}(m.GetStatusCodeFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogFilterValidationError{ + Field: "StatusCodeFilter", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *AccessLogFilter_DurationFilter: + + if v, ok := interface{}(m.GetDurationFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogFilterValidationError{ + Field: "DurationFilter", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *AccessLogFilter_NotHealthCheckFilter: + + if v, ok := interface{}(m.GetNotHealthCheckFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogFilterValidationError{ + Field: "NotHealthCheckFilter", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *AccessLogFilter_TraceableFilter: + + if v, ok := interface{}(m.GetTraceableFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogFilterValidationError{ + Field: "TraceableFilter", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *AccessLogFilter_RuntimeFilter: + + if v, ok := interface{}(m.GetRuntimeFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogFilterValidationError{ + Field: "RuntimeFilter", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *AccessLogFilter_AndFilter: + + if v, ok := interface{}(m.GetAndFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogFilterValidationError{ + Field: "AndFilter", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *AccessLogFilter_OrFilter: + + if v, ok := interface{}(m.GetOrFilter()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccessLogFilterValidationError{ + Field: "OrFilter", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return AccessLogFilterValidationError{ + Field: "FilterSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// AccessLogFilterValidationError is the validation error returned by +// AccessLogFilter.Validate if the designated constraints aren't met. +type AccessLogFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AccessLogFilterValidationError) 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 %sAccessLogFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AccessLogFilterValidationError{} + +// Validate checks the field values on ComparisonFilter with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *ComparisonFilter) Validate() error { + if m == nil { + return nil + } + + if _, ok := ComparisonFilter_Op_name[int32(m.GetOp())]; !ok { + return ComparisonFilterValidationError{ + Field: "Op", + Reason: "value must be one of the defined enum values", + } + } + + if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ComparisonFilterValidationError{ + Field: "Value", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// ComparisonFilterValidationError is the validation error returned by +// ComparisonFilter.Validate if the designated constraints aren't met. +type ComparisonFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ComparisonFilterValidationError) 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 %sComparisonFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ComparisonFilterValidationError{} + +// Validate checks the field values on StatusCodeFilter with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *StatusCodeFilter) Validate() error { + if m == nil { + return nil + } + + if m.GetComparison() == nil { + return StatusCodeFilterValidationError{ + Field: "Comparison", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetComparison()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StatusCodeFilterValidationError{ + Field: "Comparison", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// StatusCodeFilterValidationError is the validation error returned by +// StatusCodeFilter.Validate if the designated constraints aren't met. +type StatusCodeFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StatusCodeFilterValidationError) 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 %sStatusCodeFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StatusCodeFilterValidationError{} + +// Validate checks the field values on DurationFilter with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *DurationFilter) Validate() error { + if m == nil { + return nil + } + + if m.GetComparison() == nil { + return DurationFilterValidationError{ + Field: "Comparison", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetComparison()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DurationFilterValidationError{ + Field: "Comparison", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// DurationFilterValidationError is the validation error returned by +// DurationFilter.Validate if the designated constraints aren't met. +type DurationFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e DurationFilterValidationError) 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 %sDurationFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = DurationFilterValidationError{} + +// Validate checks the field values on NotHealthCheckFilter with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *NotHealthCheckFilter) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// NotHealthCheckFilterValidationError is the validation error returned by +// NotHealthCheckFilter.Validate if the designated constraints aren't met. +type NotHealthCheckFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e NotHealthCheckFilterValidationError) 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 %sNotHealthCheckFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = NotHealthCheckFilterValidationError{} + +// Validate checks the field values on TraceableFilter with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *TraceableFilter) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// TraceableFilterValidationError is the validation error returned by +// TraceableFilter.Validate if the designated constraints aren't met. +type TraceableFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TraceableFilterValidationError) 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 %sTraceableFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TraceableFilterValidationError{} + +// Validate checks the field values on RuntimeFilter with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *RuntimeFilter) Validate() error { + if m == nil { + return nil + } + + if len(m.GetRuntimeKey()) < 1 { + return RuntimeFilterValidationError{ + Field: "RuntimeKey", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetPercentSampled()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RuntimeFilterValidationError{ + Field: "PercentSampled", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for UseIndependentRandomness + + return nil +} + +// RuntimeFilterValidationError is the validation error returned by +// RuntimeFilter.Validate if the designated constraints aren't met. +type RuntimeFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RuntimeFilterValidationError) 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 %sRuntimeFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RuntimeFilterValidationError{} + +// Validate checks the field values on AndFilter with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *AndFilter) Validate() error { + if m == nil { + return nil + } + + if len(m.GetFilters()) < 2 { + return AndFilterValidationError{ + Field: "Filters", + Reason: "value must contain at least 2 item(s)", + } + } + + for idx, item := range m.GetFilters() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AndFilterValidationError{ + Field: fmt.Sprintf("Filters[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// AndFilterValidationError is the validation error returned by +// AndFilter.Validate if the designated constraints aren't met. +type AndFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AndFilterValidationError) 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 %sAndFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AndFilterValidationError{} + +// Validate checks the field values on OrFilter with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *OrFilter) Validate() error { + if m == nil { + return nil + } + + if len(m.GetFilters()) < 2 { + return OrFilterValidationError{ + Field: "Filters", + Reason: "value must contain at least 2 item(s)", + } + } + + for idx, item := range m.GetFilters() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return OrFilterValidationError{ + Field: fmt.Sprintf("Filters[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// OrFilterValidationError is the validation error returned by +// OrFilter.Validate if the designated constraints aren't met. +type OrFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e OrFilterValidationError) 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 %sOrFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = OrFilterValidationError{} + +// Validate checks the field values on FileAccessLog with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *FileAccessLog) Validate() error { + if m == nil { + return nil + } + + if len(m.GetPath()) < 1 { + return FileAccessLogValidationError{ + Field: "Path", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Format + + return nil +} + +// FileAccessLogValidationError is the validation error returned by +// FileAccessLog.Validate if the designated constraints aren't met. +type FileAccessLogValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e FileAccessLogValidationError) 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 %sFileAccessLog.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = FileAccessLogValidationError{} + +// Validate checks the field values on ResponseFlags_Unauthorized with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ResponseFlags_Unauthorized) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Reason + + return nil +} + +// ResponseFlags_UnauthorizedValidationError is the validation error returned +// by ResponseFlags_Unauthorized.Validate if the designated constraints aren't met. +type ResponseFlags_UnauthorizedValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ResponseFlags_UnauthorizedValidationError) 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 %sResponseFlags_Unauthorized.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ResponseFlags_UnauthorizedValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/fault/v2/fault.pb.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/fault/v2/fault.pb.go index 1a2cbef1..57767d29 100644 --- a/github.com/envoyproxy/go-control-plane/envoy/config/filter/fault/v2/fault.pb.go +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/fault/v2/fault.pb.go @@ -66,9 +66,9 @@ type FaultDelay struct { // An integer between 0-100 indicating the percentage of operations/connection requests // on which the delay will be injected. Percent uint32 `protobuf:"varint,2,opt,name=percent,proto3" json:"percent,omitempty"` - // Types that are valid to be assigned to FaultDelayType: + // Types that are valid to be assigned to FaultDelaySecifier: // *FaultDelay_FixedDelay - FaultDelayType isFaultDelay_FaultDelayType `protobuf_oneof:"fault_delay_type"` + FaultDelaySecifier isFaultDelay_FaultDelaySecifier `protobuf_oneof:"fault_delay_secifier"` } func (m *FaultDelay) Reset() { *m = FaultDelay{} } @@ -76,8 +76,8 @@ func (m *FaultDelay) String() string { return proto.CompactTextString func (*FaultDelay) ProtoMessage() {} func (*FaultDelay) Descriptor() ([]byte, []int) { return fileDescriptorFault, []int{0} } -type isFaultDelay_FaultDelayType interface { - isFaultDelay_FaultDelayType() +type isFaultDelay_FaultDelaySecifier interface { + isFaultDelay_FaultDelaySecifier() MarshalTo([]byte) (int, error) Size() int } @@ -86,11 +86,11 @@ type FaultDelay_FixedDelay struct { FixedDelay *time.Duration `protobuf:"bytes,3,opt,name=fixed_delay,json=fixedDelay,oneof,stdduration"` } -func (*FaultDelay_FixedDelay) isFaultDelay_FaultDelayType() {} +func (*FaultDelay_FixedDelay) isFaultDelay_FaultDelaySecifier() {} -func (m *FaultDelay) GetFaultDelayType() isFaultDelay_FaultDelayType { +func (m *FaultDelay) GetFaultDelaySecifier() isFaultDelay_FaultDelaySecifier { if m != nil { - return m.FaultDelayType + return m.FaultDelaySecifier } return nil } @@ -110,7 +110,7 @@ func (m *FaultDelay) GetPercent() uint32 { } func (m *FaultDelay) GetFixedDelay() *time.Duration { - if x, ok := m.GetFaultDelayType().(*FaultDelay_FixedDelay); ok { + if x, ok := m.GetFaultDelaySecifier().(*FaultDelay_FixedDelay); ok { return x.FixedDelay } return nil @@ -125,8 +125,8 @@ func (*FaultDelay) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) er func _FaultDelay_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*FaultDelay) - // fault_delay_type - switch x := m.FaultDelayType.(type) { + // fault_delay_secifier + switch x := m.FaultDelaySecifier.(type) { case *FaultDelay_FixedDelay: _ = b.EncodeVarint(3<<3 | proto.WireBytes) dAtA, err := github_com_gogo_protobuf_types.StdDurationMarshal(*x.FixedDelay) @@ -138,7 +138,7 @@ func _FaultDelay_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { } case nil: default: - return fmt.Errorf("FaultDelay.FaultDelayType has unexpected type %T", x) + return fmt.Errorf("FaultDelay.FaultDelaySecifier has unexpected type %T", x) } return nil } @@ -146,7 +146,7 @@ func _FaultDelay_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { func _FaultDelay_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*FaultDelay) switch tag { - case 3: // fault_delay_type.fixed_delay + case 3: // fault_delay_secifier.fixed_delay if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } @@ -158,7 +158,7 @@ func _FaultDelay_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buf if err2 := github_com_gogo_protobuf_types.StdDurationUnmarshal(c, x); err2 != nil { return true, err } - m.FaultDelayType = &FaultDelay_FixedDelay{c} + m.FaultDelaySecifier = &FaultDelay_FixedDelay{c} return true, err default: return false, nil @@ -167,8 +167,8 @@ func _FaultDelay_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buf func _FaultDelay_OneofSizer(msg proto.Message) (n int) { m := msg.(*FaultDelay) - // fault_delay_type - switch x := m.FaultDelayType.(type) { + // fault_delay_secifier + switch x := m.FaultDelaySecifier.(type) { case *FaultDelay_FixedDelay: s := github_com_gogo_protobuf_types.SizeOfStdDuration(*x.FixedDelay) n += proto.SizeVarint(3<<3 | proto.WireBytes) @@ -210,8 +210,8 @@ func (m *FaultDelay) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintFault(dAtA, i, uint64(m.Percent)) } - if m.FaultDelayType != nil { - nn1, err := m.FaultDelayType.MarshalTo(dAtA[i:]) + if m.FaultDelaySecifier != nil { + nn1, err := m.FaultDelaySecifier.MarshalTo(dAtA[i:]) if err != nil { return 0, err } @@ -252,8 +252,8 @@ func (m *FaultDelay) Size() (n int) { if m.Percent != 0 { n += 1 + sovFault(uint64(m.Percent)) } - if m.FaultDelayType != nil { - n += m.FaultDelayType.Size() + if m.FaultDelaySecifier != nil { + n += m.FaultDelaySecifier.Size() } return n } @@ -378,7 +378,7 @@ func (m *FaultDelay) Unmarshal(dAtA []byte) error { if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(v, dAtA[iNdEx:postIndex]); err != nil { return err } - m.FaultDelayType = &FaultDelay_FixedDelay{v} + m.FaultDelaySecifier = &FaultDelay_FixedDelay{v} iNdEx = postIndex default: iNdEx = preIndex @@ -509,26 +509,26 @@ var ( func init() { proto.RegisterFile("envoy/config/filter/fault/v2/fault.proto", fileDescriptorFault) } var fileDescriptorFault = []byte{ - // 327 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xcd, 0x2b, 0xcb, - 0xaf, 0xd4, 0x4f, 0xce, 0xcf, 0x4b, 0xcb, 0x4c, 0xd7, 0x4f, 0xcb, 0xcc, 0x29, 0x49, 0x2d, 0xd2, - 0x4f, 0x4b, 0x2c, 0xcd, 0x29, 0xd1, 0x2f, 0x33, 0x82, 0x30, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, - 0x85, 0x64, 0xc0, 0x2a, 0xf5, 0x20, 0x2a, 0xf5, 0x20, 0x2a, 0xf5, 0x20, 0x0a, 0xca, 0x8c, 0xa4, - 0xe4, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0x6a, 0x93, 0x4a, 0xd3, 0xf4, 0x53, 0x4a, - 0x8b, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0x20, 0xba, 0xa5, 0xc4, 0xcb, 0x12, 0x73, 0x32, 0x53, 0x12, - 0x4b, 0x52, 0xf5, 0x61, 0x0c, 0xa8, 0x84, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, - 0x41, 0x44, 0x95, 0x26, 0x30, 0x71, 0x71, 0xb9, 0x81, 0xcc, 0x76, 0x49, 0xcd, 0x49, 0xac, 0x14, - 0x0a, 0xe7, 0x62, 0x29, 0xa9, 0x2c, 0x48, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x33, 0x32, 0xd7, - 0xc3, 0xe7, 0x14, 0x3d, 0x84, 0x3e, 0x24, 0x66, 0x48, 0x65, 0x41, 0xaa, 0x13, 0xd7, 0xae, 0x97, - 0x07, 0x98, 0x59, 0x9b, 0x18, 0x99, 0x04, 0x18, 0x83, 0xc0, 0x06, 0x0a, 0x29, 0x73, 0xb1, 0x17, - 0xa4, 0x16, 0x25, 0xa7, 0xe6, 0x95, 0x48, 0x30, 0x29, 0x30, 0x6a, 0xf0, 0x3a, 0x71, 0x82, 0x94, - 0xb0, 0x68, 0x31, 0x49, 0xa4, 0x04, 0xc1, 0x64, 0x84, 0x7c, 0xb8, 0xb8, 0xd3, 0x32, 0x2b, 0x52, - 0x53, 0xe2, 0x53, 0x40, 0x26, 0x49, 0x30, 0x2b, 0x30, 0x6a, 0x70, 0x1b, 0x49, 0xea, 0x41, 0x7c, - 0xac, 0x07, 0xf3, 0xb1, 0x9e, 0x0b, 0xd4, 0xc7, 0x4e, 0x7c, 0x33, 0xee, 0xcb, 0x33, 0x82, 0xad, - 0x5a, 0xc5, 0xc8, 0xa4, 0xc5, 0xe0, 0xc1, 0x10, 0xc4, 0x05, 0xd6, 0x0f, 0x76, 0x88, 0x92, 0x34, - 0x17, 0x1f, 0xaa, 0xb3, 0x84, 0x38, 0xb9, 0x58, 0xdd, 0x3c, 0x23, 0x5c, 0x5d, 0x04, 0x18, 0x9c, - 0x24, 0xb9, 0x04, 0xc0, 0xfe, 0x80, 0x58, 0x15, 0x0f, 0x76, 0x23, 0xeb, 0x8e, 0x97, 0x07, 0x98, - 0x19, 0x9d, 0x04, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, - 0x28, 0xa6, 0x32, 0xa3, 0x24, 0x36, 0xb0, 0xd5, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x62, - 0x8c, 0xc1, 0xea, 0xc4, 0x01, 0x00, 0x00, + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x8f, 0x3f, 0x4b, 0xfb, 0x40, + 0x18, 0xc7, 0xfb, 0xa4, 0xed, 0xef, 0x47, 0xaf, 0x58, 0x4a, 0x28, 0x18, 0xab, 0xc6, 0x52, 0x97, + 0xd0, 0xe1, 0x0e, 0xe2, 0xe0, 0x1e, 0x6a, 0x51, 0x70, 0x2a, 0x82, 0xe2, 0x52, 0xd2, 0xe6, 0x49, + 0x38, 0x08, 0xb9, 0x10, 0xaf, 0xc1, 0xac, 0xbe, 0x06, 0x07, 0x5f, 0x83, 0xaf, 0x40, 0x9c, 0x3a, + 0x3a, 0xfa, 0x0e, 0x94, 0x6e, 0x7d, 0x17, 0x92, 0xbb, 0x06, 0x75, 0x71, 0xfb, 0x72, 0xf7, 0x79, + 0xbe, 0x7f, 0x88, 0x83, 0x49, 0x2e, 0x0a, 0xb6, 0x10, 0x49, 0xc8, 0x23, 0x16, 0xf2, 0x58, 0x62, + 0xc6, 0x42, 0x7f, 0x19, 0x4b, 0x96, 0xbb, 0x5a, 0xd0, 0x34, 0x13, 0x52, 0x98, 0x07, 0x8a, 0xa4, + 0x9a, 0xa4, 0x9a, 0xa4, 0x1a, 0xc8, 0xdd, 0xbe, 0x1d, 0x09, 0x11, 0xc5, 0xc8, 0x14, 0x3b, 0x5f, + 0x86, 0x2c, 0x58, 0x66, 0xbe, 0xe4, 0x22, 0xd1, 0xd7, 0xfd, 0xdd, 0xdc, 0x8f, 0x79, 0xe0, 0x4b, + 0x64, 0x95, 0xd8, 0x7e, 0xf4, 0x22, 0x11, 0x09, 0x25, 0x59, 0xa9, 0xf4, 0xeb, 0xf0, 0xd1, 0x20, + 0x64, 0x52, 0x7a, 0x8f, 0x31, 0xf6, 0x0b, 0xf3, 0x9a, 0x34, 0x64, 0x91, 0xa2, 0x05, 0x03, 0x70, + 0x3a, 0xee, 0x29, 0xfd, 0xab, 0x0a, 0xfd, 0xbe, 0xfb, 0x21, 0xaf, 0x8a, 0x14, 0x3d, 0xf2, 0xba, + 0x59, 0xd5, 0x9b, 0x0f, 0x60, 0x74, 0x61, 0xaa, 0x0c, 0xcd, 0x63, 0xf2, 0x3f, 0xc5, 0x6c, 0x81, + 0x89, 0xb4, 0x8c, 0x01, 0x38, 0x3b, 0x5e, 0xab, 0x44, 0x1a, 0x23, 0xc3, 0x0a, 0xa6, 0xd5, 0x8f, + 0x79, 0x49, 0xda, 0x21, 0xbf, 0xc7, 0x60, 0x16, 0x94, 0x4e, 0x56, 0x7d, 0x00, 0x4e, 0xdb, 0xdd, + 0xa3, 0x7a, 0x31, 0xad, 0x16, 0xd3, 0xf1, 0x76, 0xb1, 0xd7, 0x79, 0xfa, 0x38, 0x02, 0x15, 0xf5, + 0x0c, 0xc6, 0xa8, 0x76, 0x5e, 0x9b, 0x12, 0x75, 0xaf, 0x8a, 0x0c, 0xf7, 0x49, 0xe7, 0x77, 0x2d, + 0xb3, 0x45, 0x9a, 0x93, 0x8b, 0x9b, 0xb3, 0x71, 0xb7, 0xe6, 0x1d, 0x92, 0x9e, 0xda, 0xa1, 0xa3, + 0x66, 0x77, 0xb8, 0xe0, 0x21, 0xc7, 0xcc, 0x6c, 0xbe, 0x6c, 0x56, 0x75, 0xf0, 0xba, 0x6f, 0x6b, + 0x1b, 0xde, 0xd7, 0x36, 0x7c, 0xae, 0x6d, 0xb8, 0x35, 0x72, 0x77, 0xfe, 0x4f, 0xc5, 0x9f, 0x7c, + 0x05, 0x00, 0x00, 0xff, 0xff, 0xfa, 0xf8, 0x85, 0x3b, 0xc8, 0x01, 0x00, 0x00, } diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/fault/v2/fault.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/fault/v2/fault.pb.validate.go new file mode 100644 index 00000000..851922d7 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/fault/v2/fault.pb.validate.go @@ -0,0 +1,116 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/fault/v2/fault.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on FaultDelay with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *FaultDelay) Validate() error { + if m == nil { + return nil + } + + if _, ok := FaultDelay_FaultDelayType_name[int32(m.GetType())]; !ok { + return FaultDelayValidationError{ + Field: "Type", + Reason: "value must be one of the defined enum values", + } + } + + if m.GetPercent() > 100 { + return FaultDelayValidationError{ + Field: "Percent", + Reason: "value must be less than or equal to 100", + } + } + + switch m.FaultDelaySecifier.(type) { + + case *FaultDelay_FixedDelay: + + if d := m.GetFixedDelay(); d != nil { + dur := *d + + gt := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur <= gt { + return FaultDelayValidationError{ + Field: "FixedDelay", + Reason: "value must be greater than 0s", + } + } + + } + + default: + return FaultDelayValidationError{ + Field: "FaultDelaySecifier", + Reason: "value is required", + } + + } + + return nil +} + +// FaultDelayValidationError is the validation error returned by +// FaultDelay.Validate if the designated constraints aren't met. +type FaultDelayValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e FaultDelayValidationError) 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 %sFaultDelay.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = FaultDelayValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/buffer/v2/buffer.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/buffer/v2/buffer.pb.validate.go new file mode 100644 index 00000000..bcb5210f --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/buffer/v2/buffer.pb.validate.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/buffer/v2/buffer.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Buffer with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Buffer) Validate() error { + if m == nil { + return nil + } + + if wrapper := m.GetMaxRequestBytes(); wrapper != nil { + + if wrapper.GetValue() <= 0 { + return BufferValidationError{ + Field: "MaxRequestBytes", + Reason: "value must be greater than 0", + } + } + + } + + if m.GetMaxRequestTime() == nil { + return BufferValidationError{ + Field: "MaxRequestTime", + Reason: "value is required", + } + } + + if d := m.GetMaxRequestTime(); d != nil { + dur := *d + + gt := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur <= gt { + return BufferValidationError{ + Field: "MaxRequestTime", + Reason: "value must be greater than 0s", + } + } + + } + + return nil +} + +// BufferValidationError is the validation error returned by Buffer.Validate if +// the designated constraints aren't met. +type BufferValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e BufferValidationError) 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 %sBuffer.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = BufferValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go new file mode 100644 index 00000000..623ac4dc --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go @@ -0,0 +1,88 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/ext_authz/v2/ext_authz.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on ExtAuthz with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *ExtAuthz) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtAuthzValidationError{ + Field: "GrpcService", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for FailureModeAllow + + return nil +} + +// ExtAuthzValidationError is the validation error returned by +// ExtAuthz.Validate if the designated constraints aren't met. +type ExtAuthzValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ExtAuthzValidationError) 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 %sExtAuthz.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ExtAuthzValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/fault/v2/fault.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/fault/v2/fault.pb.validate.go new file mode 100644 index 00000000..eadca125 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/fault/v2/fault.pb.validate.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/fault/v2/fault.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on FaultAbort with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *FaultAbort) Validate() error { + if m == nil { + return nil + } + + if m.GetPercent() > 100 { + return FaultAbortValidationError{ + Field: "Percent", + Reason: "value must be less than or equal to 100", + } + } + + switch m.ErrorType.(type) { + + case *FaultAbort_HttpStatus: + + if val := m.GetHttpStatus(); val < 200 || val >= 600 { + return FaultAbortValidationError{ + Field: "HttpStatus", + Reason: "value must be inside range [200, 600)", + } + } + + default: + return FaultAbortValidationError{ + Field: "ErrorType", + Reason: "value is required", + } + + } + + return nil +} + +// FaultAbortValidationError is the validation error returned by +// FaultAbort.Validate if the designated constraints aren't met. +type FaultAbortValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e FaultAbortValidationError) 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 %sFaultAbort.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = FaultAbortValidationError{} + +// Validate checks the field values on HTTPFault with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *HTTPFault) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetDelay()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HTTPFaultValidationError{ + Field: "Delay", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetAbort()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HTTPFaultValidationError{ + Field: "Abort", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for UpstreamCluster + + for idx, item := range m.GetHeaders() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HTTPFaultValidationError{ + Field: fmt.Sprintf("Headers[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// HTTPFaultValidationError is the validation error returned by +// HTTPFault.Validate if the designated constraints aren't met. +type HTTPFaultValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HTTPFaultValidationError) 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 %sHTTPFault.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HTTPFaultValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/gzip/v2/gzip.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/gzip/v2/gzip.pb.validate.go new file mode 100644 index 00000000..dc7f561a --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/gzip/v2/gzip.pb.validate.go @@ -0,0 +1,176 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/gzip/v2/gzip.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Gzip with the rules defined in the proto +// definition for this message. If any rules are violated, an error is returned. +func (m *Gzip) Validate() error { + if m == nil { + return nil + } + + if wrapper := m.GetMemoryLevel(); wrapper != nil { + + if val := wrapper.GetValue(); val < 1 || val > 9 { + return GzipValidationError{ + Field: "MemoryLevel", + Reason: "value must be inside range [1, 9]", + } + } + + } + + if wrapper := m.GetContentLength(); wrapper != nil { + + if wrapper.GetValue() < 30 { + return GzipValidationError{ + Field: "ContentLength", + Reason: "value must be greater than or equal to 30", + } + } + + } + + if _, ok := Gzip_CompressionLevel_Enum_name[int32(m.GetCompressionLevel())]; !ok { + return GzipValidationError{ + Field: "CompressionLevel", + Reason: "value must be one of the defined enum values", + } + } + + if _, ok := Gzip_CompressionStrategy_name[int32(m.GetCompressionStrategy())]; !ok { + return GzipValidationError{ + Field: "CompressionStrategy", + Reason: "value must be one of the defined enum values", + } + } + + if len(m.GetContentType()) > 50 { + return GzipValidationError{ + Field: "ContentType", + Reason: "value must contain no more than 50 item(s)", + } + } + + // no validation rules for DisableOnEtagHeader + + // no validation rules for RemoveAcceptEncodingHeader + + if wrapper := m.GetWindowBits(); wrapper != nil { + + if val := wrapper.GetValue(); val < 9 || val > 15 { + return GzipValidationError{ + Field: "WindowBits", + Reason: "value must be inside range [9, 15]", + } + } + + } + + return nil +} + +// GzipValidationError is the validation error returned by Gzip.Validate if the +// designated constraints aren't met. +type GzipValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e GzipValidationError) 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 %sGzip.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = GzipValidationError{} + +// Validate checks the field values on Gzip_CompressionLevel with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Gzip_CompressionLevel) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// Gzip_CompressionLevelValidationError is the validation error returned by +// Gzip_CompressionLevel.Validate if the designated constraints aren't met. +type Gzip_CompressionLevelValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Gzip_CompressionLevelValidationError) 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 %sGzip_CompressionLevel.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Gzip_CompressionLevelValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/health_check/v2/health_check.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/health_check/v2/health_check.pb.validate.go new file mode 100644 index 00000000..b45db6ca --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/health_check/v2/health_check.pb.validate.go @@ -0,0 +1,113 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/health_check/v2/health_check.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on HealthCheck with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *HealthCheck) Validate() error { + if m == nil { + return nil + } + + if m.GetPassThroughMode() == nil { + return HealthCheckValidationError{ + Field: "PassThroughMode", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetPassThroughMode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "PassThroughMode", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if len(m.GetEndpoint()) < 1 { + return HealthCheckValidationError{ + Field: "Endpoint", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetCacheTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckValidationError{ + Field: "CacheTime", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for ClusterMinHealthyPercentages + + return nil +} + +// HealthCheckValidationError is the validation error returned by +// HealthCheck.Validate if the designated constraints aren't met. +type HealthCheckValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheckValidationError) 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 %sHealthCheck.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheckValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/ip_tagging/v2/ip_tagging.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/ip_tagging/v2/ip_tagging.pb.validate.go new file mode 100644 index 00000000..e4d7f1c4 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/ip_tagging/v2/ip_tagging.pb.validate.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/ip_tagging/v2/ip_tagging.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on IPTagging with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *IPTagging) Validate() error { + if m == nil { + return nil + } + + if _, ok := IPTagging_RequestType_name[int32(m.GetRequestType())]; !ok { + return IPTaggingValidationError{ + Field: "RequestType", + Reason: "value must be one of the defined enum values", + } + } + + if len(m.GetIpTags()) < 1 { + return IPTaggingValidationError{ + Field: "IpTags", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetIpTags() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return IPTaggingValidationError{ + Field: fmt.Sprintf("IpTags[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// IPTaggingValidationError is the validation error returned by +// IPTagging.Validate if the designated constraints aren't met. +type IPTaggingValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e IPTaggingValidationError) 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 %sIPTagging.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = IPTaggingValidationError{} + +// Validate checks the field values on IPTagging_IPTag with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *IPTagging_IPTag) Validate() error { + if m == nil { + return nil + } + + // no validation rules for IpTagName + + for idx, item := range m.GetIpList() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return IPTagging_IPTagValidationError{ + Field: fmt.Sprintf("IpList[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// IPTagging_IPTagValidationError is the validation error returned by +// IPTagging_IPTag.Validate if the designated constraints aren't met. +type IPTagging_IPTagValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e IPTagging_IPTagValidationError) 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 %sIPTagging_IPTag.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = IPTagging_IPTagValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.go new file mode 100644 index 00000000..1b87964d --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.go @@ -0,0 +1,1578 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: envoy/config/filter/http/jwt_authn/v2alpha/config.proto + +/* + Package envoy_config_filter_http_jwt_authn_v2alpha is a generated protocol buffer package. + + It is generated from these files: + envoy/config/filter/http/jwt_authn/v2alpha/config.proto + + It has these top-level messages: + JwtRule + RemoteJwks + JwtHeader + JwtAuthentication +*/ +package envoy_config_filter_http_jwt_authn_v2alpha + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import envoy_api_v2_core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core" +import envoy_api_v2_core1 "github.com/envoyproxy/go-control-plane/envoy/api/v2/core" +import envoy_api_v2_route "github.com/envoyproxy/go-control-plane/envoy/api/v2/route" +import google_protobuf3 "github.com/gogo/protobuf/types" +import _ "github.com/lyft/protoc-gen-validate/validate" + +import io "io" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +// This message specifies how a JSON Web Token (JWT) can be verified. JWT format is defined +// `here `_. Please see `OAuth2.0 +// `_ and `OIDC1.0 `_ for +// the authentication flow. +// +// Example: +// +// .. code-block:: yaml +// +// issuer: https://example.com +// audiences: +// - bookstore_android.apps.googleusercontent.com +// bookstore_web.apps.googleusercontent.com +// remote_jwks: +// - http_uri: +// - uri: https://example.com/.well-known/jwks.json +// cluster: example_jwks_cluster +// cache_duration: +// - seconds: 300 +// +// [#not-implemented-hide:] +type JwtRule struct { + // Identifies the principal that issued the JWT. See `here + // `_. Usually a URL or an email address. + // + // Example: https://securetoken.google.com + // Example: 1234567-compute@developer.gserviceaccount.com + // + Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` + // The list of JWT `audiences `_. that are + // allowed to access. A JWT containing any of these audiences will be accepted. If not specified, + // will not check audiences in the token. + // + // Example: + // + // .. code-block:: yaml + // + // audiences: + // - bookstore_android.apps.googleusercontent.com + // bookstore_web.apps.googleusercontent.com + // + Audiences []string `protobuf:"bytes,2,rep,name=audiences" json:"audiences,omitempty"` + // `JSON Web Key Set `_ is needed. to validate + // signature of the JWT. This field specifies where to fetch JWKS. + // + // Types that are valid to be assigned to JwksSourceSpecifier: + // *JwtRule_RemoteJwks + // *JwtRule_LocalJwks + JwksSourceSpecifier isJwtRule_JwksSourceSpecifier `protobuf_oneof:"jwks_source_specifier"` + // If false, the JWT is removed in the request after a success verification. If true, the JWT is + // not removed in the request. Default value is false. + Forward bool `protobuf:"varint,5,opt,name=forward,proto3" json:"forward,omitempty"` + // Specify the HTTP headers to extract JWT token. For examples, following config: + // + // .. code-block:: yaml + // + // from_headers: + // - name: x-goog-iap-jwt-assertion + // + // can be used to extract token from header:: + // + // x-goog-iap-jwt-assertion: . + // + FromHeaders []*JwtHeader `protobuf:"bytes,6,rep,name=from_headers,json=fromHeaders" json:"from_headers,omitempty"` + // JWT is sent in a query parameter. `jwt_params` represents the query parameter names. + // + // For example, if config is: + // + // .. code-block:: yaml + // + // from_params: + // - jwt_token + // + // The JWT format in query parameter is:: + // + // /path?jwt_token= + // + FromParams []string `protobuf:"bytes,7,rep,name=from_params,json=fromParams" json:"from_params,omitempty"` + // This field specifies the header name to forward a successfully verified JWT payload to the + // backend. The forwarded data is:: + // + // base64_encoded(jwt_payload_in_JSON) + // + // If it is not specified, the payload will not be forwarded. + // Multiple JWTs in a request from different issuers will be supported. Multiple JWTs from the + // same issuer will not be supported. Each issuer can config this `forward_payload_header`. If + // multiple JWTs from different issuers want to forward their payloads, their + // `forward_payload_header` should be different. + ForwardPayloadHeader string `protobuf:"bytes,8,opt,name=forward_payload_header,json=forwardPayloadHeader,proto3" json:"forward_payload_header,omitempty"` +} + +func (m *JwtRule) Reset() { *m = JwtRule{} } +func (m *JwtRule) String() string { return proto.CompactTextString(m) } +func (*JwtRule) ProtoMessage() {} +func (*JwtRule) Descriptor() ([]byte, []int) { return fileDescriptorConfig, []int{0} } + +type isJwtRule_JwksSourceSpecifier interface { + isJwtRule_JwksSourceSpecifier() + MarshalTo([]byte) (int, error) + Size() int +} + +type JwtRule_RemoteJwks struct { + RemoteJwks *RemoteJwks `protobuf:"bytes,3,opt,name=remote_jwks,json=remoteJwks,oneof"` +} +type JwtRule_LocalJwks struct { + LocalJwks *envoy_api_v2_core.DataSource `protobuf:"bytes,4,opt,name=local_jwks,json=localJwks,oneof"` +} + +func (*JwtRule_RemoteJwks) isJwtRule_JwksSourceSpecifier() {} +func (*JwtRule_LocalJwks) isJwtRule_JwksSourceSpecifier() {} + +func (m *JwtRule) GetJwksSourceSpecifier() isJwtRule_JwksSourceSpecifier { + if m != nil { + return m.JwksSourceSpecifier + } + return nil +} + +func (m *JwtRule) GetIssuer() string { + if m != nil { + return m.Issuer + } + return "" +} + +func (m *JwtRule) GetAudiences() []string { + if m != nil { + return m.Audiences + } + return nil +} + +func (m *JwtRule) GetRemoteJwks() *RemoteJwks { + if x, ok := m.GetJwksSourceSpecifier().(*JwtRule_RemoteJwks); ok { + return x.RemoteJwks + } + return nil +} + +func (m *JwtRule) GetLocalJwks() *envoy_api_v2_core.DataSource { + if x, ok := m.GetJwksSourceSpecifier().(*JwtRule_LocalJwks); ok { + return x.LocalJwks + } + return nil +} + +func (m *JwtRule) GetForward() bool { + if m != nil { + return m.Forward + } + return false +} + +func (m *JwtRule) GetFromHeaders() []*JwtHeader { + if m != nil { + return m.FromHeaders + } + return nil +} + +func (m *JwtRule) GetFromParams() []string { + if m != nil { + return m.FromParams + } + return nil +} + +func (m *JwtRule) GetForwardPayloadHeader() string { + if m != nil { + return m.ForwardPayloadHeader + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*JwtRule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _JwtRule_OneofMarshaler, _JwtRule_OneofUnmarshaler, _JwtRule_OneofSizer, []interface{}{ + (*JwtRule_RemoteJwks)(nil), + (*JwtRule_LocalJwks)(nil), + } +} + +func _JwtRule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*JwtRule) + // jwks_source_specifier + switch x := m.JwksSourceSpecifier.(type) { + case *JwtRule_RemoteJwks: + _ = b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RemoteJwks); err != nil { + return err + } + case *JwtRule_LocalJwks: + _ = b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.LocalJwks); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("JwtRule.JwksSourceSpecifier has unexpected type %T", x) + } + return nil +} + +func _JwtRule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*JwtRule) + switch tag { + case 3: // jwks_source_specifier.remote_jwks + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RemoteJwks) + err := b.DecodeMessage(msg) + m.JwksSourceSpecifier = &JwtRule_RemoteJwks{msg} + return true, err + case 4: // jwks_source_specifier.local_jwks + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(envoy_api_v2_core.DataSource) + err := b.DecodeMessage(msg) + m.JwksSourceSpecifier = &JwtRule_LocalJwks{msg} + return true, err + default: + return false, nil + } +} + +func _JwtRule_OneofSizer(msg proto.Message) (n int) { + m := msg.(*JwtRule) + // jwks_source_specifier + switch x := m.JwksSourceSpecifier.(type) { + case *JwtRule_RemoteJwks: + s := proto.Size(x.RemoteJwks) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *JwtRule_LocalJwks: + s := proto.Size(x.LocalJwks) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// This message specifies how to fetch JWKS from remote and how to cache it. +type RemoteJwks struct { + // The HTTP URI to fetch the JWKS. For example: + // + // .. code-block:: yaml + // + // http_uri: + // - uri: https://www.googleapis.com/oauth2/v1/certs + // cluster: jwt.www.googleapis.com|443 + // + HttpUri *envoy_api_v2_core1.HttpUri `protobuf:"bytes,1,opt,name=http_uri,json=httpUri" json:"http_uri,omitempty"` + // Duration after which the cached JWKS should be expired. If not specified, default cache + // duration is 5 minutes. + CacheDuration *google_protobuf3.Duration `protobuf:"bytes,2,opt,name=cache_duration,json=cacheDuration" json:"cache_duration,omitempty"` +} + +func (m *RemoteJwks) Reset() { *m = RemoteJwks{} } +func (m *RemoteJwks) String() string { return proto.CompactTextString(m) } +func (*RemoteJwks) ProtoMessage() {} +func (*RemoteJwks) Descriptor() ([]byte, []int) { return fileDescriptorConfig, []int{1} } + +func (m *RemoteJwks) GetHttpUri() *envoy_api_v2_core1.HttpUri { + if m != nil { + return m.HttpUri + } + return nil +} + +func (m *RemoteJwks) GetCacheDuration() *google_protobuf3.Duration { + if m != nil { + return m.CacheDuration + } + return nil +} + +// This message specifies a header location to extract JWT token. +type JwtHeader struct { + // The HTTP header name. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The value prefix. The value format is "value_prefix" + // For example, for "Authorization: Bearer ", value_prefix="Bearer " with a space at the + // end. + ValuePrefix string `protobuf:"bytes,2,opt,name=value_prefix,json=valuePrefix,proto3" json:"value_prefix,omitempty"` +} + +func (m *JwtHeader) Reset() { *m = JwtHeader{} } +func (m *JwtHeader) String() string { return proto.CompactTextString(m) } +func (*JwtHeader) ProtoMessage() {} +func (*JwtHeader) Descriptor() ([]byte, []int) { return fileDescriptorConfig, []int{2} } + +func (m *JwtHeader) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *JwtHeader) GetValuePrefix() string { + if m != nil { + return m.ValuePrefix + } + return "" +} + +// This is the Envoy HTTP filter config for JWT authentication. +// [#not-implemented-hide:] +type JwtAuthentication struct { + // List of JWT rules to valide. + Rules []*JwtRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"` + // If true, the request is allowed if JWT is missing or JWT verification fails. + // Default is false, a request without JWT or failed JWT verification is not allowed. + AllowMissingOrFailed bool `protobuf:"varint,2,opt,name=allow_missing_or_failed,json=allowMissingOrFailed,proto3" json:"allow_missing_or_failed,omitempty"` + // This field lists the patterns allowed to bypass JWT verification. This only applies when + // `allow_missing_or_failed_jwt` is false. Under this config, if a request doesn't have JWT, it + // will be rejected. But some requests still needed to be forwarded without JWT, such as OPTIONS + // for CORS and some health checking paths. + // + // Examples: bypass all CORS options requests + // + // .. code-block:: yaml + // + // bypass: + // - headers: + // - name: :method + // value: OPTIONS + // - headers: + // - name: :path + // regex_match: /.* + // + // Examples: bypass /healthz check + // + // .. code-block:: yaml + // + // bypass: + // - headers: + // - name: :method + // value: GET + // - headers: + // - name: :path + // exact_match: /healthz + // + Bypass []*envoy_api_v2_route.RouteMatch `protobuf:"bytes,3,rep,name=bypass" json:"bypass,omitempty"` +} + +func (m *JwtAuthentication) Reset() { *m = JwtAuthentication{} } +func (m *JwtAuthentication) String() string { return proto.CompactTextString(m) } +func (*JwtAuthentication) ProtoMessage() {} +func (*JwtAuthentication) Descriptor() ([]byte, []int) { return fileDescriptorConfig, []int{3} } + +func (m *JwtAuthentication) GetRules() []*JwtRule { + if m != nil { + return m.Rules + } + return nil +} + +func (m *JwtAuthentication) GetAllowMissingOrFailed() bool { + if m != nil { + return m.AllowMissingOrFailed + } + return false +} + +func (m *JwtAuthentication) GetBypass() []*envoy_api_v2_route.RouteMatch { + if m != nil { + return m.Bypass + } + return nil +} + +func init() { + proto.RegisterType((*JwtRule)(nil), "envoy.config.filter.http.jwt_authn.v2alpha.JwtRule") + proto.RegisterType((*RemoteJwks)(nil), "envoy.config.filter.http.jwt_authn.v2alpha.RemoteJwks") + proto.RegisterType((*JwtHeader)(nil), "envoy.config.filter.http.jwt_authn.v2alpha.JwtHeader") + proto.RegisterType((*JwtAuthentication)(nil), "envoy.config.filter.http.jwt_authn.v2alpha.JwtAuthentication") +} +func (m *JwtRule) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JwtRule) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Issuer) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintConfig(dAtA, i, uint64(len(m.Issuer))) + i += copy(dAtA[i:], m.Issuer) + } + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + dAtA[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if m.JwksSourceSpecifier != nil { + nn1, err := m.JwksSourceSpecifier.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += nn1 + } + if m.Forward { + dAtA[i] = 0x28 + i++ + if m.Forward { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if len(m.FromHeaders) > 0 { + for _, msg := range m.FromHeaders { + dAtA[i] = 0x32 + i++ + i = encodeVarintConfig(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.FromParams) > 0 { + for _, s := range m.FromParams { + dAtA[i] = 0x3a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if len(m.ForwardPayloadHeader) > 0 { + dAtA[i] = 0x42 + i++ + i = encodeVarintConfig(dAtA, i, uint64(len(m.ForwardPayloadHeader))) + i += copy(dAtA[i:], m.ForwardPayloadHeader) + } + return i, nil +} + +func (m *JwtRule_RemoteJwks) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.RemoteJwks != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintConfig(dAtA, i, uint64(m.RemoteJwks.Size())) + n2, err := m.RemoteJwks.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + return i, nil +} +func (m *JwtRule_LocalJwks) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.LocalJwks != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintConfig(dAtA, i, uint64(m.LocalJwks.Size())) + n3, err := m.LocalJwks.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + } + return i, nil +} +func (m *RemoteJwks) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoteJwks) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.HttpUri != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintConfig(dAtA, i, uint64(m.HttpUri.Size())) + n4, err := m.HttpUri.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + } + if m.CacheDuration != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintConfig(dAtA, i, uint64(m.CacheDuration.Size())) + n5, err := m.CacheDuration.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + } + return i, nil +} + +func (m *JwtHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JwtHeader) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Name) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintConfig(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.ValuePrefix) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintConfig(dAtA, i, uint64(len(m.ValuePrefix))) + i += copy(dAtA[i:], m.ValuePrefix) + } + return i, nil +} + +func (m *JwtAuthentication) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JwtAuthentication) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Rules) > 0 { + for _, msg := range m.Rules { + dAtA[i] = 0xa + i++ + i = encodeVarintConfig(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.AllowMissingOrFailed { + dAtA[i] = 0x10 + i++ + if m.AllowMissingOrFailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if len(m.Bypass) > 0 { + for _, msg := range m.Bypass { + dAtA[i] = 0x1a + i++ + i = encodeVarintConfig(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *JwtRule) Size() (n int) { + var l int + _ = l + l = len(m.Issuer) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + l = len(s) + n += 1 + l + sovConfig(uint64(l)) + } + } + if m.JwksSourceSpecifier != nil { + n += m.JwksSourceSpecifier.Size() + } + if m.Forward { + n += 2 + } + if len(m.FromHeaders) > 0 { + for _, e := range m.FromHeaders { + l = e.Size() + n += 1 + l + sovConfig(uint64(l)) + } + } + if len(m.FromParams) > 0 { + for _, s := range m.FromParams { + l = len(s) + n += 1 + l + sovConfig(uint64(l)) + } + } + l = len(m.ForwardPayloadHeader) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + return n +} + +func (m *JwtRule_RemoteJwks) Size() (n int) { + var l int + _ = l + if m.RemoteJwks != nil { + l = m.RemoteJwks.Size() + n += 1 + l + sovConfig(uint64(l)) + } + return n +} +func (m *JwtRule_LocalJwks) Size() (n int) { + var l int + _ = l + if m.LocalJwks != nil { + l = m.LocalJwks.Size() + n += 1 + l + sovConfig(uint64(l)) + } + return n +} +func (m *RemoteJwks) Size() (n int) { + var l int + _ = l + if m.HttpUri != nil { + l = m.HttpUri.Size() + n += 1 + l + sovConfig(uint64(l)) + } + if m.CacheDuration != nil { + l = m.CacheDuration.Size() + n += 1 + l + sovConfig(uint64(l)) + } + return n +} + +func (m *JwtHeader) Size() (n int) { + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.ValuePrefix) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + return n +} + +func (m *JwtAuthentication) Size() (n int) { + var l int + _ = l + if len(m.Rules) > 0 { + for _, e := range m.Rules { + l = e.Size() + n += 1 + l + sovConfig(uint64(l)) + } + } + if m.AllowMissingOrFailed { + n += 2 + } + if len(m.Bypass) > 0 { + for _, e := range m.Bypass { + l = e.Size() + n += 1 + l + sovConfig(uint64(l)) + } + } + return n +} + +func sovConfig(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozConfig(x uint64) (n int) { + return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *JwtRule) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JwtRule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JwtRule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Issuer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Audiences", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Audiences = append(m.Audiences, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemoteJwks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &RemoteJwks{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.JwksSourceSpecifier = &JwtRule_RemoteJwks{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalJwks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &envoy_api_v2_core.DataSource{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.JwksSourceSpecifier = &JwtRule_LocalJwks{v} + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Forward", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Forward = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FromHeaders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FromHeaders = append(m.FromHeaders, &JwtHeader{}) + if err := m.FromHeaders[len(m.FromHeaders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FromParams", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FromParams = append(m.FromParams, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForwardPayloadHeader", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ForwardPayloadHeader = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoteJwks) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoteJwks: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoteJwks: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpUri", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HttpUri == nil { + m.HttpUri = &envoy_api_v2_core1.HttpUri{} + } + if err := m.HttpUri.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CacheDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CacheDuration == nil { + m.CacheDuration = &google_protobuf3.Duration{} + } + if err := m.CacheDuration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JwtHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JwtHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JwtHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValuePrefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValuePrefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *JwtAuthentication) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JwtAuthentication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JwtAuthentication: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rules = append(m.Rules, &JwtRule{}) + if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowMissingOrFailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowMissingOrFailed = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bypass", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bypass = append(m.Bypass, &envoy_api_v2_route.RouteMatch{}) + if err := m.Bypass[len(m.Bypass)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipConfig(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthConfig + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipConfig(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowConfig = fmt.Errorf("proto: integer overflow") +) + +func init() { + proto.RegisterFile("envoy/config/filter/http/jwt_authn/v2alpha/config.proto", fileDescriptorConfig) +} + +var fileDescriptorConfig = []byte{ + // 641 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0xad, 0x9b, 0x36, 0x89, 0x37, 0x05, 0x89, 0x55, 0xa1, 0xa6, 0x6a, 0x83, 0x9b, 0x53, 0xc4, + 0xc1, 0x96, 0x52, 0x5a, 0x6e, 0x08, 0xaa, 0x0a, 0x85, 0x48, 0x15, 0xd5, 0x22, 0x24, 0x38, 0x59, + 0x13, 0x7b, 0x1d, 0x6f, 0xeb, 0x78, 0xad, 0xdd, 0x75, 0x4c, 0x3f, 0x80, 0x7f, 0x42, 0x9c, 0x7a, + 0xe4, 0x82, 0xd4, 0x4f, 0x40, 0xbd, 0xf5, 0x2f, 0x90, 0x77, 0xed, 0x54, 0x55, 0x39, 0xd0, 0xcb, + 0x6a, 0x67, 0xde, 0xbc, 0xb7, 0xe3, 0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, 0x9e, 0xa4, 0x21, 0xaf, 0x8e, 0x04, 0x00, + 0x00, +} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go new file mode 100644 index 00000000..310e9d40 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/jwt_authn/v2alpha/config.proto +// DO NOT EDIT!!! + +package envoy_config_filter_http_jwt_authn_v2alpha + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on JwtRule with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *JwtRule) Validate() error { + if m == nil { + return nil + } + + if len(m.GetIssuer()) < 1 { + return JwtRuleValidationError{ + Field: "Issuer", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Forward + + for idx, item := range m.GetFromHeaders() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return JwtRuleValidationError{ + Field: fmt.Sprintf("FromHeaders[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for ForwardPayloadHeader + + switch m.JwksSourceSpecifier.(type) { + + case *JwtRule_RemoteJwks: + + if v, ok := interface{}(m.GetRemoteJwks()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return JwtRuleValidationError{ + Field: "RemoteJwks", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *JwtRule_LocalJwks: + + if v, ok := interface{}(m.GetLocalJwks()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return JwtRuleValidationError{ + Field: "LocalJwks", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return JwtRuleValidationError{ + Field: "JwksSourceSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// JwtRuleValidationError is the validation error returned by JwtRule.Validate +// if the designated constraints aren't met. +type JwtRuleValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e JwtRuleValidationError) 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 %sJwtRule.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = JwtRuleValidationError{} + +// Validate checks the field values on RemoteJwks with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *RemoteJwks) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetHttpUri()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteJwksValidationError{ + Field: "HttpUri", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetCacheDuration()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RemoteJwksValidationError{ + Field: "CacheDuration", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// RemoteJwksValidationError is the validation error returned by +// RemoteJwks.Validate if the designated constraints aren't met. +type RemoteJwksValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RemoteJwksValidationError) 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 %sRemoteJwks.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RemoteJwksValidationError{} + +// Validate checks the field values on JwtHeader with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *JwtHeader) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return JwtHeaderValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for ValuePrefix + + return nil +} + +// JwtHeaderValidationError is the validation error returned by +// JwtHeader.Validate if the designated constraints aren't met. +type JwtHeaderValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e JwtHeaderValidationError) 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 %sJwtHeader.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = JwtHeaderValidationError{} + +// Validate checks the field values on JwtAuthentication with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *JwtAuthentication) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetRules() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return JwtAuthenticationValidationError{ + Field: fmt.Sprintf("Rules[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for AllowMissingOrFailed + + for idx, item := range m.GetBypass() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return JwtAuthenticationValidationError{ + Field: fmt.Sprintf("Bypass[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// JwtAuthenticationValidationError is the validation error returned by +// JwtAuthentication.Validate if the designated constraints aren't met. +type JwtAuthenticationValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e JwtAuthenticationValidationError) 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 %sJwtAuthentication.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = JwtAuthenticationValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/lua/v2/lua.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/lua/v2/lua.pb.validate.go new file mode 100644 index 00000000..67616959 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/lua/v2/lua.pb.validate.go @@ -0,0 +1,83 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/lua/v2/lua.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Lua with the rules defined in the proto +// definition for this message. If any rules are violated, an error is returned. +func (m *Lua) Validate() error { + if m == nil { + return nil + } + + if len(m.GetInlineCode()) < 1 { + return LuaValidationError{ + Field: "InlineCode", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// LuaValidationError is the validation error returned by Lua.Validate if the +// designated constraints aren't met. +type LuaValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e LuaValidationError) 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 %sLua.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = LuaValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/rate_limit/v2/rate_limit.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/rate_limit/v2/rate_limit.pb.validate.go new file mode 100644 index 00000000..9f5b73bf --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/rate_limit/v2/rate_limit.pb.validate.go @@ -0,0 +1,102 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/rate_limit/v2/rate_limit.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on RateLimit with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *RateLimit) Validate() error { + if m == nil { + return nil + } + + if len(m.GetDomain()) < 1 { + return RateLimitValidationError{ + Field: "Domain", + Reason: "value length must be at least 1 bytes", + } + } + + if m.GetStage() > 10 { + return RateLimitValidationError{ + Field: "Stage", + Reason: "value must be less than or equal to 10", + } + } + + // no validation rules for RequestType + + if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimitValidationError{ + Field: "Timeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// RateLimitValidationError is the validation error returned by +// RateLimit.Validate if the designated constraints aren't met. +type RateLimitValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitValidationError) 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 %sRateLimit.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/router/v2/router.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/router/v2/router.pb.validate.go new file mode 100644 index 00000000..75642c06 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/router/v2/router.pb.validate.go @@ -0,0 +1,103 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/router/v2/router.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Router with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Router) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetDynamicStats()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouterValidationError{ + Field: "DynamicStats", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for StartChildSpan + + for idx, item := range m.GetUpstreamLog() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RouterValidationError{ + Field: fmt.Sprintf("UpstreamLog[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// RouterValidationError is the validation error returned by Router.Validate if +// the designated constraints aren't met. +type RouterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RouterValidationError) 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 %sRouter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RouterValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/squash/v2/squash.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/squash/v2/squash.pb.validate.go new file mode 100644 index 00000000..6add8bed --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/squash/v2/squash.pb.validate.go @@ -0,0 +1,123 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/squash/v2/squash.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Squash with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Squash) Validate() error { + if m == nil { + return nil + } + + if len(m.GetCluster()) < 1 { + return SquashValidationError{ + Field: "Cluster", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetAttachmentTemplate()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SquashValidationError{ + Field: "AttachmentTemplate", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRequestTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SquashValidationError{ + Field: "RequestTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetAttachmentTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SquashValidationError{ + Field: "AttachmentTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetAttachmentPollPeriod()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SquashValidationError{ + Field: "AttachmentPollPeriod", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// SquashValidationError is the validation error returned by Squash.Validate if +// the designated constraints aren't met. +type SquashValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e SquashValidationError) 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 %sSquash.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = SquashValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/transcoder/v2/transcoder.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/transcoder/v2/transcoder.pb.validate.go new file mode 100644 index 00000000..e78cd7a5 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/http/transcoder/v2/transcoder.pb.validate.go @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/http/transcoder/v2/transcoder.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on GrpcJsonTranscoder with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GrpcJsonTranscoder) Validate() error { + if m == nil { + return nil + } + + if len(m.GetServices()) < 1 { + return GrpcJsonTranscoderValidationError{ + Field: "Services", + Reason: "value must contain at least 1 item(s)", + } + } + + if v, ok := interface{}(m.GetPrintOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrpcJsonTranscoderValidationError{ + Field: "PrintOptions", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + switch m.DescriptorSet.(type) { + + case *GrpcJsonTranscoder_ProtoDescriptor: + // no validation rules for ProtoDescriptor + + case *GrpcJsonTranscoder_ProtoDescriptorBin: + // no validation rules for ProtoDescriptorBin + + default: + return GrpcJsonTranscoderValidationError{ + Field: "DescriptorSet", + Reason: "value is required", + } + + } + + return nil +} + +// GrpcJsonTranscoderValidationError is the validation error returned by +// GrpcJsonTranscoder.Validate if the designated constraints aren't met. +type GrpcJsonTranscoderValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e GrpcJsonTranscoderValidationError) 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 %sGrpcJsonTranscoder.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = GrpcJsonTranscoderValidationError{} + +// Validate checks the field values on GrpcJsonTranscoder_PrintOptions with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *GrpcJsonTranscoder_PrintOptions) Validate() error { + if m == nil { + return nil + } + + // no validation rules for AddWhitespace + + // no validation rules for AlwaysPrintPrimitiveFields + + // no validation rules for AlwaysPrintEnumsAsInts + + // no validation rules for PreserveProtoFieldNames + + return nil +} + +// GrpcJsonTranscoder_PrintOptionsValidationError is the validation error +// returned by GrpcJsonTranscoder_PrintOptions.Validate if the designated +// constraints aren't met. +type GrpcJsonTranscoder_PrintOptionsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e GrpcJsonTranscoder_PrintOptionsValidationError) 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 %sGrpcJsonTranscoder_PrintOptions.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = GrpcJsonTranscoder_PrintOptionsValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/client_ssl_auth/v2/client_ssl_auth.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/client_ssl_auth/v2/client_ssl_auth.pb.validate.go new file mode 100644 index 00000000..3aa1f73e --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/client_ssl_auth/v2/client_ssl_auth.pb.validate.go @@ -0,0 +1,116 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/network/client_ssl_auth/v2/client_ssl_auth.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on ClientSSLAuth with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ClientSSLAuth) Validate() error { + if m == nil { + return nil + } + + if len(m.GetAuthApiCluster()) < 1 { + return ClientSSLAuthValidationError{ + Field: "AuthApiCluster", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetStatPrefix()) < 1 { + return ClientSSLAuthValidationError{ + Field: "StatPrefix", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetRefreshDelay()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClientSSLAuthValidationError{ + Field: "RefreshDelay", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetIpWhiteList() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClientSSLAuthValidationError{ + Field: fmt.Sprintf("IpWhiteList[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// ClientSSLAuthValidationError is the validation error returned by +// ClientSSLAuth.Validate if the designated constraints aren't met. +type ClientSSLAuthValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ClientSSLAuthValidationError) 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 %sClientSSLAuth.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ClientSSLAuthValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/ext_authz/v2/ext_authz.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/ext_authz/v2/ext_authz.pb.validate.go new file mode 100644 index 00000000..7546a8ca --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/ext_authz/v2/ext_authz.pb.validate.go @@ -0,0 +1,95 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/network/ext_authz/v2/ext_authz.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on ExtAuthz with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *ExtAuthz) Validate() error { + if m == nil { + return nil + } + + if len(m.GetStatPrefix()) < 1 { + return ExtAuthzValidationError{ + Field: "StatPrefix", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ExtAuthzValidationError{ + Field: "GrpcService", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for FailureModeAllow + + return nil +} + +// ExtAuthzValidationError is the validation error returned by +// ExtAuthz.Validate if the designated constraints aren't met. +type ExtAuthzValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ExtAuthzValidationError) 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 %sExtAuthz.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ExtAuthzValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.pb.validate.go new file mode 100644 index 00000000..d0f2be33 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.pb.validate.go @@ -0,0 +1,577 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on HttpConnectionManager with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HttpConnectionManager) Validate() error { + if m == nil { + return nil + } + + if _, ok := HttpConnectionManager_CodecType_name[int32(m.GetCodecType())]; !ok { + return HttpConnectionManagerValidationError{ + Field: "CodecType", + Reason: "value must be one of the defined enum values", + } + } + + if len(m.GetStatPrefix()) < 1 { + return HttpConnectionManagerValidationError{ + Field: "StatPrefix", + Reason: "value length must be at least 1 bytes", + } + } + + for idx, item := range m.GetHttpFilters() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: fmt.Sprintf("HttpFilters[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetAddUserAgent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "AddUserAgent", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "Tracing", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetHttpProtocolOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "HttpProtocolOptions", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "Http2ProtocolOptions", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for ServerName + + if v, ok := interface{}(m.GetIdleTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "IdleTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDrainTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "DrainTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetAccessLog() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: fmt.Sprintf("AccessLog[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetUseRemoteAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "UseRemoteAddress", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for XffNumTrustedHops + + if v, ok := interface{}(m.GetGenerateRequestId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "GenerateRequestId", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if _, ok := HttpConnectionManager_ForwardClientCertDetails_name[int32(m.GetForwardClientCertDetails())]; !ok { + return HttpConnectionManagerValidationError{ + Field: "ForwardClientCertDetails", + Reason: "value must be one of the defined enum values", + } + } + + if v, ok := interface{}(m.GetSetCurrentClientCertDetails()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "SetCurrentClientCertDetails", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for Proxy_100Continue + + // no validation rules for RepresentIpv4RemoteAddressAsIpv4MappedIpv6 + + switch m.RouteSpecifier.(type) { + + case *HttpConnectionManager_Rds: + + if v, ok := interface{}(m.GetRds()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "Rds", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *HttpConnectionManager_RouteConfig: + + if v, ok := interface{}(m.GetRouteConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManagerValidationError{ + Field: "RouteConfig", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return HttpConnectionManagerValidationError{ + Field: "RouteSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// HttpConnectionManagerValidationError is the validation error returned by +// HttpConnectionManager.Validate if the designated constraints aren't met. +type HttpConnectionManagerValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HttpConnectionManagerValidationError) 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 %sHttpConnectionManager.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HttpConnectionManagerValidationError{} + +// Validate checks the field values on Rds with the rules defined in the proto +// definition for this message. If any rules are violated, an error is returned. +func (m *Rds) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetConfigSource()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RdsValidationError{ + Field: "ConfigSource", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if len(m.GetRouteConfigName()) < 1 { + return RdsValidationError{ + Field: "RouteConfigName", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// RdsValidationError is the validation error returned by Rds.Validate if the +// designated constraints aren't met. +type RdsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RdsValidationError) 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 %sRds.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RdsValidationError{} + +// Validate checks the field values on HttpFilter with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *HttpFilter) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return HttpFilterValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpFilterValidationError{ + Field: "Config", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDeprecatedV1()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpFilterValidationError{ + Field: "DeprecatedV1", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// HttpFilterValidationError is the validation error returned by +// HttpFilter.Validate if the designated constraints aren't met. +type HttpFilterValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HttpFilterValidationError) 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 %sHttpFilter.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HttpFilterValidationError{} + +// Validate checks the field values on HttpConnectionManager_Tracing with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HttpConnectionManager_Tracing) Validate() error { + if m == nil { + return nil + } + + if _, ok := HttpConnectionManager_Tracing_OperationName_name[int32(m.GetOperationName())]; !ok { + return HttpConnectionManager_TracingValidationError{ + Field: "OperationName", + Reason: "value must be one of the defined enum values", + } + } + + if v, ok := interface{}(m.GetClientSampling()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManager_TracingValidationError{ + Field: "ClientSampling", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRandomSampling()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManager_TracingValidationError{ + Field: "RandomSampling", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetOverallSampling()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManager_TracingValidationError{ + Field: "OverallSampling", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// HttpConnectionManager_TracingValidationError is the validation error +// returned by HttpConnectionManager_Tracing.Validate if the designated +// constraints aren't met. +type HttpConnectionManager_TracingValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HttpConnectionManager_TracingValidationError) 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 %sHttpConnectionManager_Tracing.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HttpConnectionManager_TracingValidationError{} + +// Validate checks the field values on +// HttpConnectionManager_SetCurrentClientCertDetails with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *HttpConnectionManager_SetCurrentClientCertDetails) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManager_SetCurrentClientCertDetailsValidationError{ + Field: "Subject", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetSan()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HttpConnectionManager_SetCurrentClientCertDetailsValidationError{ + Field: "San", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for Cert + + return nil +} + +// HttpConnectionManager_SetCurrentClientCertDetailsValidationError is the +// validation error returned by +// HttpConnectionManager_SetCurrentClientCertDetails.Validate if the +// designated constraints aren't met. +type HttpConnectionManager_SetCurrentClientCertDetailsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) 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 %sHttpConnectionManager_SetCurrentClientCertDetails.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HttpConnectionManager_SetCurrentClientCertDetailsValidationError{} + +// Validate checks the field values on HttpFilter_DeprecatedV1 with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HttpFilter_DeprecatedV1) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Type + + return nil +} + +// HttpFilter_DeprecatedV1ValidationError is the validation error returned by +// HttpFilter_DeprecatedV1.Validate if the designated constraints aren't met. +type HttpFilter_DeprecatedV1ValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HttpFilter_DeprecatedV1ValidationError) 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 %sHttpFilter_DeprecatedV1.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HttpFilter_DeprecatedV1ValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/mongo_proxy/v2/mongo_proxy.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/mongo_proxy/v2/mongo_proxy.pb.validate.go new file mode 100644 index 00000000..41f01a8b --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/mongo_proxy/v2/mongo_proxy.pb.validate.go @@ -0,0 +1,95 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/network/mongo_proxy/v2/mongo_proxy.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on MongoProxy with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *MongoProxy) Validate() error { + if m == nil { + return nil + } + + if len(m.GetStatPrefix()) < 1 { + return MongoProxyValidationError{ + Field: "StatPrefix", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for AccessLog + + if v, ok := interface{}(m.GetDelay()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MongoProxyValidationError{ + Field: "Delay", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// MongoProxyValidationError is the validation error returned by +// MongoProxy.Validate if the designated constraints aren't met. +type MongoProxyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e MongoProxyValidationError) 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 %sMongoProxy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = MongoProxyValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/rate_limit/v2/rate_limit.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/rate_limit/v2/rate_limit.pb.validate.go new file mode 100644 index 00000000..ad98bffa --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/rate_limit/v2/rate_limit.pb.validate.go @@ -0,0 +1,122 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/network/rate_limit/v2/rate_limit.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on RateLimit with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *RateLimit) Validate() error { + if m == nil { + return nil + } + + if len(m.GetStatPrefix()) < 1 { + return RateLimitValidationError{ + Field: "StatPrefix", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetDomain()) < 1 { + return RateLimitValidationError{ + Field: "Domain", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetDescriptors()) < 1 { + return RateLimitValidationError{ + Field: "Descriptors", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetDescriptors() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimitValidationError{ + Field: fmt.Sprintf("Descriptors[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimitValidationError{ + Field: "Timeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// RateLimitValidationError is the validation error returned by +// RateLimit.Validate if the designated constraints aren't met. +type RateLimitValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitValidationError) 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 %sRateLimit.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/redis_proxy/v2/redis_proxy.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/redis_proxy/v2/redis_proxy.pb.validate.go new file mode 100644 index 00000000..d7c21652 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/redis_proxy/v2/redis_proxy.pb.validate.go @@ -0,0 +1,157 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/network/redis_proxy/v2/redis_proxy.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on RedisProxy with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *RedisProxy) Validate() error { + if m == nil { + return nil + } + + if len(m.GetStatPrefix()) < 1 { + return RedisProxyValidationError{ + Field: "StatPrefix", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetCluster()) < 1 { + return RedisProxyValidationError{ + Field: "Cluster", + Reason: "value length must be at least 1 bytes", + } + } + + if m.GetSettings() == nil { + return RedisProxyValidationError{ + Field: "Settings", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetSettings()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RedisProxyValidationError{ + Field: "Settings", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// RedisProxyValidationError is the validation error returned by +// RedisProxy.Validate if the designated constraints aren't met. +type RedisProxyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RedisProxyValidationError) 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 %sRedisProxy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RedisProxyValidationError{} + +// Validate checks the field values on RedisProxy_ConnPoolSettings with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RedisProxy_ConnPoolSettings) Validate() error { + if m == nil { + return nil + } + + if m.GetOpTimeout() == nil { + return RedisProxy_ConnPoolSettingsValidationError{ + Field: "OpTimeout", + Reason: "value is required", + } + } + + return nil +} + +// RedisProxy_ConnPoolSettingsValidationError is the validation error returned +// by RedisProxy_ConnPoolSettings.Validate if the designated constraints +// aren't met. +type RedisProxy_ConnPoolSettingsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RedisProxy_ConnPoolSettingsValidationError) 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 %sRedisProxy_ConnPoolSettings.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RedisProxy_ConnPoolSettingsValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go new file mode 100644 index 00000000..720b0414 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go @@ -0,0 +1,313 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on TcpProxy with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *TcpProxy) Validate() error { + if m == nil { + return nil + } + + if len(m.GetStatPrefix()) < 1 { + return TcpProxyValidationError{ + Field: "StatPrefix", + Reason: "value length must be at least 1 bytes", + } + } + + // no validation rules for Cluster + + if v, ok := interface{}(m.GetMetadataMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TcpProxyValidationError{ + Field: "MetadataMatch", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if d := m.GetIdleTimeout(); d != nil { + dur := *d + + gt := time.Duration(0*time.Second + 0*time.Nanosecond) + + if dur <= gt { + return TcpProxyValidationError{ + Field: "IdleTimeout", + Reason: "value must be greater than 0s", + } + } + + } + + if v, ok := interface{}(m.GetDownstreamIdleTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TcpProxyValidationError{ + Field: "DownstreamIdleTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetUpstreamIdleTimeout()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TcpProxyValidationError{ + Field: "UpstreamIdleTimeout", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetAccessLog() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TcpProxyValidationError{ + Field: fmt.Sprintf("AccessLog[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetDeprecatedV1()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TcpProxyValidationError{ + Field: "DeprecatedV1", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if wrapper := m.GetMaxConnectAttempts(); wrapper != nil { + + if wrapper.GetValue() < 1 { + return TcpProxyValidationError{ + Field: "MaxConnectAttempts", + Reason: "value must be greater than or equal to 1", + } + } + + } + + return nil +} + +// TcpProxyValidationError is the validation error returned by +// TcpProxy.Validate if the designated constraints aren't met. +type TcpProxyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TcpProxyValidationError) 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 %sTcpProxy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TcpProxyValidationError{} + +// Validate checks the field values on TcpProxy_DeprecatedV1 with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *TcpProxy_DeprecatedV1) Validate() error { + if m == nil { + return nil + } + + if len(m.GetRoutes()) < 1 { + return TcpProxy_DeprecatedV1ValidationError{ + Field: "Routes", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetRoutes() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TcpProxy_DeprecatedV1ValidationError{ + Field: fmt.Sprintf("Routes[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// TcpProxy_DeprecatedV1ValidationError is the validation error returned by +// TcpProxy_DeprecatedV1.Validate if the designated constraints aren't met. +type TcpProxy_DeprecatedV1ValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TcpProxy_DeprecatedV1ValidationError) 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 %sTcpProxy_DeprecatedV1.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TcpProxy_DeprecatedV1ValidationError{} + +// Validate checks the field values on TcpProxy_DeprecatedV1_TCPRoute with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *TcpProxy_DeprecatedV1_TCPRoute) Validate() error { + if m == nil { + return nil + } + + if len(m.GetCluster()) < 1 { + return TcpProxy_DeprecatedV1_TCPRouteValidationError{ + Field: "Cluster", + Reason: "value length must be at least 1 bytes", + } + } + + for idx, item := range m.GetDestinationIpList() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TcpProxy_DeprecatedV1_TCPRouteValidationError{ + Field: fmt.Sprintf("DestinationIpList[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for DestinationPorts + + for idx, item := range m.GetSourceIpList() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TcpProxy_DeprecatedV1_TCPRouteValidationError{ + Field: fmt.Sprintf("SourceIpList[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for SourcePorts + + return nil +} + +// TcpProxy_DeprecatedV1_TCPRouteValidationError is the validation error +// returned by TcpProxy_DeprecatedV1_TCPRoute.Validate if the designated +// constraints aren't met. +type TcpProxy_DeprecatedV1_TCPRouteValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TcpProxy_DeprecatedV1_TCPRouteValidationError) 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 %sTcpProxy_DeprecatedV1_TCPRoute.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TcpProxy_DeprecatedV1_TCPRouteValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/metrics_service.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/metrics_service.pb.validate.go new file mode 100644 index 00000000..49d93b47 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/metrics_service.pb.validate.go @@ -0,0 +1,94 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/metrics/v2/metrics_service.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on MetricsServiceConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *MetricsServiceConfig) Validate() error { + if m == nil { + return nil + } + + if m.GetGrpcService() == nil { + return MetricsServiceConfigValidationError{ + Field: "GrpcService", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return MetricsServiceConfigValidationError{ + Field: "GrpcService", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// MetricsServiceConfigValidationError is the validation error returned by +// MetricsServiceConfig.Validate if the designated constraints aren't met. +type MetricsServiceConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e MetricsServiceConfigValidationError) 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 %sMetricsServiceConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = MetricsServiceConfigValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/stats.pb.go b/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/stats.pb.go index 54cffb6f..965bc78f 100644 --- a/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/stats.pb.go +++ b/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/stats.pb.go @@ -26,6 +26,8 @@ type StatsSink struct { // * :ref:`envoy.statsd ` // * :ref:`envoy.dog_statsd ` // * :ref:`envoy.metrics_service ` + // + // Sinks optionally support tagged/multiple dimensional metrics. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Stats sink specific configuration which depends on the sink being // instantiated. See :ref:`StatsdSink ` for an @@ -236,7 +238,8 @@ func _TagSpecifier_OneofSizer(msg proto.Message) (n int) { return n } -// Stats configuration proto schema for built-in *envoy.statsd* sink. +// Stats configuration proto schema for built-in *envoy.statsd* sink. This sink does not support +// tagged metrics. type StatsdSink struct { // Types that are valid to be assigned to StatsdSpecifier: // *StatsdSink_Address diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/stats.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/stats.pb.validate.go new file mode 100644 index 00000000..7e211fb6 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/metrics/v2/stats.pb.validate.go @@ -0,0 +1,339 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/metrics/v2/stats.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on StatsSink with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *StatsSink) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Name + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StatsSinkValidationError{ + Field: "Config", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// StatsSinkValidationError is the validation error returned by +// StatsSink.Validate if the designated constraints aren't met. +type StatsSinkValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StatsSinkValidationError) 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 %sStatsSink.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StatsSinkValidationError{} + +// Validate checks the field values on StatsConfig with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *StatsConfig) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetStatsTags() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StatsConfigValidationError{ + Field: fmt.Sprintf("StatsTags[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetUseAllDefaultTags()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StatsConfigValidationError{ + Field: "UseAllDefaultTags", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// StatsConfigValidationError is the validation error returned by +// StatsConfig.Validate if the designated constraints aren't met. +type StatsConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StatsConfigValidationError) 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 %sStatsConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StatsConfigValidationError{} + +// Validate checks the field values on TagSpecifier with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *TagSpecifier) Validate() error { + if m == nil { + return nil + } + + // no validation rules for TagName + + switch m.TagValue.(type) { + + case *TagSpecifier_Regex: + // no validation rules for Regex + + case *TagSpecifier_FixedValue: + // no validation rules for FixedValue + + } + + return nil +} + +// TagSpecifierValidationError is the validation error returned by +// TagSpecifier.Validate if the designated constraints aren't met. +type TagSpecifierValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TagSpecifierValidationError) 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 %sTagSpecifier.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TagSpecifierValidationError{} + +// Validate checks the field values on StatsdSink with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *StatsdSink) Validate() error { + if m == nil { + return nil + } + + switch m.StatsdSpecifier.(type) { + + case *StatsdSink_Address: + + if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StatsdSinkValidationError{ + Field: "Address", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *StatsdSink_TcpClusterName: + // no validation rules for TcpClusterName + + default: + return StatsdSinkValidationError{ + Field: "StatsdSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// StatsdSinkValidationError is the validation error returned by +// StatsdSink.Validate if the designated constraints aren't met. +type StatsdSinkValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StatsdSinkValidationError) 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 %sStatsdSink.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StatsdSinkValidationError{} + +// Validate checks the field values on DogStatsdSink with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *DogStatsdSink) Validate() error { + if m == nil { + return nil + } + + switch m.DogStatsdSpecifier.(type) { + + case *DogStatsdSink_Address: + + if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DogStatsdSinkValidationError{ + Field: "Address", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return DogStatsdSinkValidationError{ + Field: "DogStatsdSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// DogStatsdSinkValidationError is the validation error returned by +// DogStatsdSink.Validate if the designated constraints aren't met. +type DogStatsdSinkValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e DogStatsdSinkValidationError) 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 %sDogStatsdSink.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = DogStatsdSinkValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/ratelimit/v2/rls.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/ratelimit/v2/rls.pb.validate.go new file mode 100644 index 00000000..65cf3a74 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/ratelimit/v2/rls.pb.validate.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/ratelimit/v2/rls.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on RateLimitServiceConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RateLimitServiceConfig) Validate() error { + if m == nil { + return nil + } + + switch m.ServiceSpecifier.(type) { + + case *RateLimitServiceConfig_ClusterName: + + if len(m.GetClusterName()) < 1 { + return RateLimitServiceConfigValidationError{ + Field: "ClusterName", + Reason: "value length must be at least 1 bytes", + } + } + + case *RateLimitServiceConfig_GrpcService: + + if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimitServiceConfigValidationError{ + Field: "GrpcService", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return RateLimitServiceConfigValidationError{ + Field: "ServiceSpecifier", + Reason: "value is required", + } + + } + + return nil +} + +// RateLimitServiceConfigValidationError is the validation error returned by +// RateLimitServiceConfig.Validate if the designated constraints aren't met. +type RateLimitServiceConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitServiceConfigValidationError) 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 %sRateLimitServiceConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitServiceConfigValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/config/trace/v2/trace.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/config/trace/v2/trace.pb.validate.go new file mode 100644 index 00000000..06926b58 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/config/trace/v2/trace.pb.validate.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-validate +// source: envoy/config/trace/v2/trace.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Tracing with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Tracing) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetHttp()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TracingValidationError{ + Field: "Http", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// TracingValidationError is the validation error returned by Tracing.Validate +// if the designated constraints aren't met. +type TracingValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TracingValidationError) 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 %sTracing.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TracingValidationError{} + +// Validate checks the field values on LightstepConfig with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *LightstepConfig) Validate() error { + if m == nil { + return nil + } + + if len(m.GetCollectorCluster()) < 1 { + return LightstepConfigValidationError{ + Field: "CollectorCluster", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetAccessTokenFile()) < 1 { + return LightstepConfigValidationError{ + Field: "AccessTokenFile", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// LightstepConfigValidationError is the validation error returned by +// LightstepConfig.Validate if the designated constraints aren't met. +type LightstepConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e LightstepConfigValidationError) 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 %sLightstepConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = LightstepConfigValidationError{} + +// Validate checks the field values on ZipkinConfig with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *ZipkinConfig) Validate() error { + if m == nil { + return nil + } + + if len(m.GetCollectorCluster()) < 1 { + return ZipkinConfigValidationError{ + Field: "CollectorCluster", + Reason: "value length must be at least 1 bytes", + } + } + + if len(m.GetCollectorEndpoint()) < 1 { + return ZipkinConfigValidationError{ + Field: "CollectorEndpoint", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// ZipkinConfigValidationError is the validation error returned by +// ZipkinConfig.Validate if the designated constraints aren't met. +type ZipkinConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ZipkinConfigValidationError) 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 %sZipkinConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ZipkinConfigValidationError{} + +// Validate checks the field values on DynamicOtConfig with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *DynamicOtConfig) Validate() error { + if m == nil { + return nil + } + + if len(m.GetLibrary()) < 1 { + return DynamicOtConfigValidationError{ + Field: "Library", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DynamicOtConfigValidationError{ + Field: "Config", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// DynamicOtConfigValidationError is the validation error returned by +// DynamicOtConfig.Validate if the designated constraints aren't met. +type DynamicOtConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e DynamicOtConfigValidationError) 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 %sDynamicOtConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = DynamicOtConfigValidationError{} + +// Validate checks the field values on TraceServiceConfig with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *TraceServiceConfig) Validate() error { + if m == nil { + return nil + } + + if m.GetGrpcService() == nil { + return TraceServiceConfigValidationError{ + Field: "GrpcService", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return TraceServiceConfigValidationError{ + Field: "GrpcService", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// TraceServiceConfigValidationError is the validation error returned by +// TraceServiceConfig.Validate if the designated constraints aren't met. +type TraceServiceConfigValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e TraceServiceConfigValidationError) 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 %sTraceServiceConfig.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = TraceServiceConfigValidationError{} + +// Validate checks the field values on Tracing_Http with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *Tracing_Http) Validate() error { + if m == nil { + return nil + } + + if len(m.GetName()) < 1 { + return Tracing_HttpValidationError{ + Field: "Name", + Reason: "value length must be at least 1 bytes", + } + } + + if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Tracing_HttpValidationError{ + Field: "Config", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// Tracing_HttpValidationError is the validation error returned by +// Tracing_Http.Validate if the designated constraints aren't met. +type Tracing_HttpValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Tracing_HttpValidationError) 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 %sTracing_Http.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Tracing_HttpValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/accesslog/v2/als.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/accesslog/v2/als.pb.validate.go new file mode 100644 index 00000000..2a6db864 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/accesslog/v2/als.pb.validate.go @@ -0,0 +1,361 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/accesslog/v2/als.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on StreamAccessLogsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *StreamAccessLogsResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// StreamAccessLogsResponseValidationError is the validation error returned by +// StreamAccessLogsResponse.Validate if the designated constraints aren't met. +type StreamAccessLogsResponseValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamAccessLogsResponseValidationError) 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 %sStreamAccessLogsResponse.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamAccessLogsResponseValidationError{} + +// Validate checks the field values on StreamAccessLogsMessage with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *StreamAccessLogsMessage) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetIdentifier()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamAccessLogsMessageValidationError{ + Field: "Identifier", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + switch m.LogEntries.(type) { + + case *StreamAccessLogsMessage_HttpLogs: + + if v, ok := interface{}(m.GetHttpLogs()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamAccessLogsMessageValidationError{ + Field: "HttpLogs", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *StreamAccessLogsMessage_TcpLogs: + + if v, ok := interface{}(m.GetTcpLogs()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamAccessLogsMessageValidationError{ + Field: "TcpLogs", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + default: + return StreamAccessLogsMessageValidationError{ + Field: "LogEntries", + Reason: "value is required", + } + + } + + return nil +} + +// StreamAccessLogsMessageValidationError is the validation error returned by +// StreamAccessLogsMessage.Validate if the designated constraints aren't met. +type StreamAccessLogsMessageValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamAccessLogsMessageValidationError) 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 %sStreamAccessLogsMessage.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamAccessLogsMessageValidationError{} + +// Validate checks the field values on StreamAccessLogsMessage_Identifier with +// the rules defined in the proto definition for this message. If any rules +// are violated, an error is returned. +func (m *StreamAccessLogsMessage_Identifier) Validate() error { + if m == nil { + return nil + } + + if m.GetNode() == nil { + return StreamAccessLogsMessage_IdentifierValidationError{ + Field: "Node", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamAccessLogsMessage_IdentifierValidationError{ + Field: "Node", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if len(m.GetLogName()) < 1 { + return StreamAccessLogsMessage_IdentifierValidationError{ + Field: "LogName", + Reason: "value length must be at least 1 bytes", + } + } + + return nil +} + +// StreamAccessLogsMessage_IdentifierValidationError is the validation error +// returned by StreamAccessLogsMessage_Identifier.Validate if the designated +// constraints aren't met. +type StreamAccessLogsMessage_IdentifierValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamAccessLogsMessage_IdentifierValidationError) 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 %sStreamAccessLogsMessage_Identifier.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamAccessLogsMessage_IdentifierValidationError{} + +// Validate checks the field values on +// StreamAccessLogsMessage_HTTPAccessLogEntries with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *StreamAccessLogsMessage_HTTPAccessLogEntries) Validate() error { + if m == nil { + return nil + } + + if len(m.GetLogEntry()) < 1 { + return StreamAccessLogsMessage_HTTPAccessLogEntriesValidationError{ + Field: "LogEntry", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetLogEntry() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamAccessLogsMessage_HTTPAccessLogEntriesValidationError{ + Field: fmt.Sprintf("LogEntry[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// StreamAccessLogsMessage_HTTPAccessLogEntriesValidationError is the +// validation error returned by +// StreamAccessLogsMessage_HTTPAccessLogEntries.Validate if the designated +// constraints aren't met. +type StreamAccessLogsMessage_HTTPAccessLogEntriesValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamAccessLogsMessage_HTTPAccessLogEntriesValidationError) 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 %sStreamAccessLogsMessage_HTTPAccessLogEntries.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamAccessLogsMessage_HTTPAccessLogEntriesValidationError{} + +// Validate checks the field values on +// StreamAccessLogsMessage_TCPAccessLogEntries with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *StreamAccessLogsMessage_TCPAccessLogEntries) Validate() error { + if m == nil { + return nil + } + + if len(m.GetLogEntry()) < 1 { + return StreamAccessLogsMessage_TCPAccessLogEntriesValidationError{ + Field: "LogEntry", + Reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetLogEntry() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamAccessLogsMessage_TCPAccessLogEntriesValidationError{ + Field: fmt.Sprintf("LogEntry[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// StreamAccessLogsMessage_TCPAccessLogEntriesValidationError is the validation +// error returned by StreamAccessLogsMessage_TCPAccessLogEntries.Validate if +// the designated constraints aren't met. +type StreamAccessLogsMessage_TCPAccessLogEntriesValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamAccessLogsMessage_TCPAccessLogEntriesValidationError) 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 %sStreamAccessLogsMessage_TCPAccessLogEntries.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamAccessLogsMessage_TCPAccessLogEntriesValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/auth/v2/attribute_context.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/auth/v2/attribute_context.pb.validate.go new file mode 100644 index 00000000..be5582a2 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/auth/v2/attribute_context.pb.validate.go @@ -0,0 +1,292 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/auth/v2/attribute_context.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on AttributeContext with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *AttributeContext) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetSource()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AttributeContextValidationError{ + Field: "Source", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetDestination()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AttributeContextValidationError{ + Field: "Destination", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetRequest()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AttributeContextValidationError{ + Field: "Request", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for ContextExtensions + + return nil +} + +// AttributeContextValidationError is the validation error returned by +// AttributeContext.Validate if the designated constraints aren't met. +type AttributeContextValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AttributeContextValidationError) 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 %sAttributeContext.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AttributeContextValidationError{} + +// Validate checks the field values on AttributeContext_Peer with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *AttributeContext_Peer) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AttributeContext_PeerValidationError{ + Field: "Address", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for Service + + // no validation rules for Labels + + // no validation rules for Principal + + return nil +} + +// AttributeContext_PeerValidationError is the validation error returned by +// AttributeContext_Peer.Validate if the designated constraints aren't met. +type AttributeContext_PeerValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AttributeContext_PeerValidationError) 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 %sAttributeContext_Peer.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AttributeContext_PeerValidationError{} + +// Validate checks the field values on AttributeContext_Request with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *AttributeContext_Request) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AttributeContext_RequestValidationError{ + Field: "Time", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetHttp()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AttributeContext_RequestValidationError{ + Field: "Http", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// AttributeContext_RequestValidationError is the validation error returned by +// AttributeContext_Request.Validate if the designated constraints aren't met. +type AttributeContext_RequestValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AttributeContext_RequestValidationError) 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 %sAttributeContext_Request.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AttributeContext_RequestValidationError{} + +// Validate checks the field values on AttributeContext_HttpRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *AttributeContext_HttpRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Id + + // no validation rules for Method + + // no validation rules for Headers + + // no validation rules for Path + + // no validation rules for Host + + // no validation rules for Scheme + + // no validation rules for Query + + // no validation rules for Fragment + + // no validation rules for Size + + // no validation rules for Protocol + + return nil +} + +// AttributeContext_HttpRequestValidationError is the validation error returned +// by AttributeContext_HttpRequest.Validate if the designated constraints +// aren't met. +type AttributeContext_HttpRequestValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AttributeContext_HttpRequestValidationError) 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 %sAttributeContext_HttpRequest.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AttributeContext_HttpRequestValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/auth/v2/external_auth.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/auth/v2/external_auth.pb.validate.go new file mode 100644 index 00000000..b5ac9dc2 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/auth/v2/external_auth.pb.validate.go @@ -0,0 +1,139 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/auth/v2/external_auth.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on CheckRequest with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *CheckRequest) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetAttributes()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CheckRequestValidationError{ + Field: "Attributes", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// CheckRequestValidationError is the validation error returned by +// CheckRequest.Validate if the designated constraints aren't met. +type CheckRequestValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CheckRequestValidationError) 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 %sCheckRequest.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CheckRequestValidationError{} + +// Validate checks the field values on CheckResponse with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *CheckResponse) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CheckResponseValidationError{ + Field: "Status", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// CheckResponseValidationError is the validation error returned by +// CheckResponse.Validate if the designated constraints aren't met. +type CheckResponseValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CheckResponseValidationError) 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 %sCheckResponse.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CheckResponseValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/ads.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/ads.pb.validate.go new file mode 100644 index 00000000..2ad4e6d6 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/ads.pb.validate.go @@ -0,0 +1,76 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/discovery/v2/ads.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on AdsDummy with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *AdsDummy) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// AdsDummyValidationError is the validation error returned by +// AdsDummy.Validate if the designated constraints aren't met. +type AdsDummyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e AdsDummyValidationError) 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 %sAdsDummy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = AdsDummyValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/hds.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/hds.pb.validate.go new file mode 100644 index 00000000..f3419224 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/hds.pb.validate.go @@ -0,0 +1,528 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/discovery/v2/hds.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Capability with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Capability) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// CapabilityValidationError is the validation error returned by +// Capability.Validate if the designated constraints aren't met. +type CapabilityValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e CapabilityValidationError) 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 %sCapability.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = CapabilityValidationError{} + +// Validate checks the field values on HealthCheckRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HealthCheckRequest) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckRequestValidationError{ + Field: "Node", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + if v, ok := interface{}(m.GetCapability()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckRequestValidationError{ + Field: "Capability", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// HealthCheckRequestValidationError is the validation error returned by +// HealthCheckRequest.Validate if the designated constraints aren't met. +type HealthCheckRequestValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheckRequestValidationError) 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 %sHealthCheckRequest.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheckRequestValidationError{} + +// Validate checks the field values on EndpointHealth with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *EndpointHealth) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetEndpoint()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EndpointHealthValidationError{ + Field: "Endpoint", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for HealthStatus + + return nil +} + +// EndpointHealthValidationError is the validation error returned by +// EndpointHealth.Validate if the designated constraints aren't met. +type EndpointHealthValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e EndpointHealthValidationError) 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 %sEndpointHealth.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = EndpointHealthValidationError{} + +// Validate checks the field values on EndpointHealthResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *EndpointHealthResponse) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetEndpointsHealth() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EndpointHealthResponseValidationError{ + Field: fmt.Sprintf("EndpointsHealth[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// EndpointHealthResponseValidationError is the validation error returned by +// EndpointHealthResponse.Validate if the designated constraints aren't met. +type EndpointHealthResponseValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e EndpointHealthResponseValidationError) 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 %sEndpointHealthResponse.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = EndpointHealthResponseValidationError{} + +// Validate checks the field values on +// HealthCheckRequestOrEndpointHealthResponse with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *HealthCheckRequestOrEndpointHealthResponse) Validate() error { + if m == nil { + return nil + } + + switch m.RequestType.(type) { + + case *HealthCheckRequestOrEndpointHealthResponse_HealthCheckRequest: + + if v, ok := interface{}(m.GetHealthCheckRequest()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckRequestOrEndpointHealthResponseValidationError{ + Field: "HealthCheckRequest", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + case *HealthCheckRequestOrEndpointHealthResponse_EndpointHealthResponse: + + if v, ok := interface{}(m.GetEndpointHealthResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckRequestOrEndpointHealthResponseValidationError{ + Field: "EndpointHealthResponse", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// HealthCheckRequestOrEndpointHealthResponseValidationError is the validation +// error returned by HealthCheckRequestOrEndpointHealthResponse.Validate if +// the designated constraints aren't met. +type HealthCheckRequestOrEndpointHealthResponseValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheckRequestOrEndpointHealthResponseValidationError) 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 %sHealthCheckRequestOrEndpointHealthResponse.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheckRequestOrEndpointHealthResponseValidationError{} + +// Validate checks the field values on LocalityEndpoints with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *LocalityEndpoints) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalityEndpointsValidationError{ + Field: "Locality", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetEndpoints() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LocalityEndpointsValidationError{ + Field: fmt.Sprintf("Endpoints[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// LocalityEndpointsValidationError is the validation error returned by +// LocalityEndpoints.Validate if the designated constraints aren't met. +type LocalityEndpointsValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e LocalityEndpointsValidationError) 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 %sLocalityEndpoints.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = LocalityEndpointsValidationError{} + +// Validate checks the field values on ClusterHealthCheck with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *ClusterHealthCheck) Validate() error { + if m == nil { + return nil + } + + // no validation rules for ClusterName + + for idx, item := range m.GetHealthChecks() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterHealthCheckValidationError{ + Field: fmt.Sprintf("HealthChecks[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + for idx, item := range m.GetEndpoints() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ClusterHealthCheckValidationError{ + Field: fmt.Sprintf("Endpoints[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// ClusterHealthCheckValidationError is the validation error returned by +// ClusterHealthCheck.Validate if the designated constraints aren't met. +type ClusterHealthCheckValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e ClusterHealthCheckValidationError) 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 %sClusterHealthCheck.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = ClusterHealthCheckValidationError{} + +// Validate checks the field values on HealthCheckSpecifier with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *HealthCheckSpecifier) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetHealthCheck() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckSpecifierValidationError{ + Field: fmt.Sprintf("HealthCheck[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return HealthCheckSpecifierValidationError{ + Field: "Interval", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// HealthCheckSpecifierValidationError is the validation error returned by +// HealthCheckSpecifier.Validate if the designated constraints aren't met. +type HealthCheckSpecifierValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e HealthCheckSpecifierValidationError) 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 %sHealthCheckSpecifier.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = HealthCheckSpecifierValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/sds.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/sds.pb.validate.go new file mode 100644 index 00000000..3aab8d5a --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2/sds.pb.validate.go @@ -0,0 +1,76 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/discovery/v2/sds.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on SdsDummy with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *SdsDummy) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// SdsDummyValidationError is the validation error returned by +// SdsDummy.Validate if the designated constraints aren't met. +type SdsDummyValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e SdsDummyValidationError) 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 %sSdsDummy.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = SdsDummyValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/load_stats/v2/lrs.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/load_stats/v2/lrs.pb.validate.go new file mode 100644 index 00000000..8c955b86 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/load_stats/v2/lrs.pb.validate.go @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/load_stats/v2/lrs.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on LoadStatsRequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *LoadStatsRequest) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoadStatsRequestValidationError{ + Field: "Node", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetClusterStats() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoadStatsRequestValidationError{ + Field: fmt.Sprintf("ClusterStats[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// LoadStatsRequestValidationError is the validation error returned by +// LoadStatsRequest.Validate if the designated constraints aren't met. +type LoadStatsRequestValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e LoadStatsRequestValidationError) 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 %sLoadStatsRequest.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = LoadStatsRequestValidationError{} + +// Validate checks the field values on LoadStatsResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *LoadStatsResponse) Validate() error { + if m == nil { + return nil + } + + if len(m.GetClusters()) < 1 { + return LoadStatsResponseValidationError{ + Field: "Clusters", + Reason: "value must contain at least 1 item(s)", + } + } + + if v, ok := interface{}(m.GetLoadReportingInterval()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return LoadStatsResponseValidationError{ + Field: "LoadReportingInterval", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// LoadStatsResponseValidationError is the validation error returned by +// LoadStatsResponse.Validate if the designated constraints aren't met. +type LoadStatsResponseValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e LoadStatsResponseValidationError) 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 %sLoadStatsResponse.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = LoadStatsResponseValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/metrics/v2/metrics_service.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/metrics/v2/metrics_service.pb.validate.go new file mode 100644 index 00000000..5f5a28d9 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/metrics/v2/metrics_service.pb.validate.go @@ -0,0 +1,204 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/metrics/v2/metrics_service.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on StreamMetricsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *StreamMetricsResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// StreamMetricsResponseValidationError is the validation error returned by +// StreamMetricsResponse.Validate if the designated constraints aren't met. +type StreamMetricsResponseValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamMetricsResponseValidationError) 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 %sStreamMetricsResponse.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamMetricsResponseValidationError{} + +// Validate checks the field values on StreamMetricsMessage with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *StreamMetricsMessage) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetIdentifier()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamMetricsMessageValidationError{ + Field: "Identifier", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetEnvoyMetrics() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamMetricsMessageValidationError{ + Field: fmt.Sprintf("EnvoyMetrics[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// StreamMetricsMessageValidationError is the validation error returned by +// StreamMetricsMessage.Validate if the designated constraints aren't met. +type StreamMetricsMessageValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamMetricsMessageValidationError) 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 %sStreamMetricsMessage.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamMetricsMessageValidationError{} + +// Validate checks the field values on StreamMetricsMessage_Identifier with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *StreamMetricsMessage_Identifier) Validate() error { + if m == nil { + return nil + } + + if m.GetNode() == nil { + return StreamMetricsMessage_IdentifierValidationError{ + Field: "Node", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamMetricsMessage_IdentifierValidationError{ + Field: "Node", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// StreamMetricsMessage_IdentifierValidationError is the validation error +// returned by StreamMetricsMessage_Identifier.Validate if the designated +// constraints aren't met. +type StreamMetricsMessage_IdentifierValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamMetricsMessage_IdentifierValidationError) 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 %sStreamMetricsMessage_Identifier.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamMetricsMessage_IdentifierValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2/rls.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2/rls.pb.validate.go new file mode 100644 index 00000000..bdac1545 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/ratelimit/v2/rls.pb.validate.go @@ -0,0 +1,259 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/ratelimit/v2/rls.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on RateLimitRequest with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *RateLimitRequest) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Domain + + for idx, item := range m.GetDescriptors() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimitRequestValidationError{ + Field: fmt.Sprintf("Descriptors[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + // no validation rules for HitsAddend + + return nil +} + +// RateLimitRequestValidationError is the validation error returned by +// RateLimitRequest.Validate if the designated constraints aren't met. +type RateLimitRequestValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitRequestValidationError) 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 %sRateLimitRequest.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitRequestValidationError{} + +// Validate checks the field values on RateLimitResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *RateLimitResponse) Validate() error { + if m == nil { + return nil + } + + // no validation rules for OverallCode + + for idx, item := range m.GetStatuses() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimitResponseValidationError{ + Field: fmt.Sprintf("Statuses[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// RateLimitResponseValidationError is the validation error returned by +// RateLimitResponse.Validate if the designated constraints aren't met. +type RateLimitResponseValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitResponseValidationError) 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 %sRateLimitResponse.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitResponseValidationError{} + +// Validate checks the field values on RateLimitResponse_RateLimit with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *RateLimitResponse_RateLimit) Validate() error { + if m == nil { + return nil + } + + // no validation rules for RequestsPerUnit + + // no validation rules for Unit + + return nil +} + +// RateLimitResponse_RateLimitValidationError is the validation error returned +// by RateLimitResponse_RateLimit.Validate if the designated constraints +// aren't met. +type RateLimitResponse_RateLimitValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitResponse_RateLimitValidationError) 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 %sRateLimitResponse_RateLimit.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitResponse_RateLimitValidationError{} + +// Validate checks the field values on RateLimitResponse_DescriptorStatus with +// the rules defined in the proto definition for this message. If any rules +// are violated, an error is returned. +func (m *RateLimitResponse_DescriptorStatus) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Code + + if v, ok := interface{}(m.GetCurrentLimit()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RateLimitResponse_DescriptorStatusValidationError{ + Field: "CurrentLimit", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + // no validation rules for LimitRemaining + + return nil +} + +// RateLimitResponse_DescriptorStatusValidationError is the validation error +// returned by RateLimitResponse_DescriptorStatus.Validate if the designated +// constraints aren't met. +type RateLimitResponse_DescriptorStatusValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e RateLimitResponse_DescriptorStatusValidationError) 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 %sRateLimitResponse_DescriptorStatus.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = RateLimitResponse_DescriptorStatusValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/service/trace/v2/trace_service.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/service/trace/v2/trace_service.pb.validate.go new file mode 100644 index 00000000..3210ffce --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/service/trace/v2/trace_service.pb.validate.go @@ -0,0 +1,204 @@ +// Code generated by protoc-gen-validate +// source: envoy/service/trace/v2/trace_service.proto +// DO NOT EDIT!!! + +package v2 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on StreamTracesResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *StreamTracesResponse) Validate() error { + if m == nil { + return nil + } + + return nil +} + +// StreamTracesResponseValidationError is the validation error returned by +// StreamTracesResponse.Validate if the designated constraints aren't met. +type StreamTracesResponseValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamTracesResponseValidationError) 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 %sStreamTracesResponse.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamTracesResponseValidationError{} + +// Validate checks the field values on StreamTracesMessage with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *StreamTracesMessage) Validate() error { + if m == nil { + return nil + } + + if v, ok := interface{}(m.GetIdentifier()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamTracesMessageValidationError{ + Field: "Identifier", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + for idx, item := range m.GetSpans() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamTracesMessageValidationError{ + Field: fmt.Sprintf("Spans[%v]", idx), + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + } + + return nil +} + +// StreamTracesMessageValidationError is the validation error returned by +// StreamTracesMessage.Validate if the designated constraints aren't met. +type StreamTracesMessageValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamTracesMessageValidationError) 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 %sStreamTracesMessage.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamTracesMessageValidationError{} + +// Validate checks the field values on StreamTracesMessage_Identifier with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *StreamTracesMessage_Identifier) Validate() error { + if m == nil { + return nil + } + + if m.GetNode() == nil { + return StreamTracesMessage_IdentifierValidationError{ + Field: "Node", + Reason: "value is required", + } + } + + if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamTracesMessage_IdentifierValidationError{ + Field: "Node", + Reason: "embedded message failed validation", + Cause: err, + } + } + } + + return nil +} + +// StreamTracesMessage_IdentifierValidationError is the validation error +// returned by StreamTracesMessage_Identifier.Validate if the designated +// constraints aren't met. +type StreamTracesMessage_IdentifierValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e StreamTracesMessage_IdentifierValidationError) 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 %sStreamTracesMessage_Identifier.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = StreamTracesMessage_IdentifierValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/type/percent.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/type/percent.pb.validate.go new file mode 100644 index 00000000..38fa3def --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/type/percent.pb.validate.go @@ -0,0 +1,134 @@ +// Code generated by protoc-gen-validate +// source: envoy/type/percent.proto +// DO NOT EDIT!!! + +package envoy_type + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Percent with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Percent) Validate() error { + if m == nil { + return nil + } + + if val := m.GetValue(); val < 0 || val > 100 { + return PercentValidationError{ + Field: "Value", + Reason: "value must be inside range [0, 100]", + } + } + + return nil +} + +// PercentValidationError is the validation error returned by Percent.Validate +// if the designated constraints aren't met. +type PercentValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e PercentValidationError) 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 %sPercent.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = PercentValidationError{} + +// Validate checks the field values on FractionalPercent with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *FractionalPercent) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Numerator + + if _, ok := FractionalPercent_DenominatorType_name[int32(m.GetDenominator())]; !ok { + return FractionalPercentValidationError{ + Field: "Denominator", + Reason: "value must be one of the defined enum values", + } + } + + return nil +} + +// FractionalPercentValidationError is the validation error returned by +// FractionalPercent.Validate if the designated constraints aren't met. +type FractionalPercentValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e FractionalPercentValidationError) 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 %sFractionalPercent.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = FractionalPercentValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/envoy/type/range.pb.validate.go b/github.com/envoyproxy/go-control-plane/envoy/type/range.pb.validate.go new file mode 100644 index 00000000..e558e9e4 --- /dev/null +++ b/github.com/envoyproxy/go-control-plane/envoy/type/range.pb.validate.go @@ -0,0 +1,80 @@ +// Code generated by protoc-gen-validate +// source: envoy/type/range.proto +// DO NOT EDIT!!! + +package envoy_type + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/gogo/protobuf/types" +) + +// 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) + _ = types.DynamicAny{} +) + +// Validate checks the field values on Int64Range with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Int64Range) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Start + + // no validation rules for End + + return nil +} + +// Int64RangeValidationError is the validation error returned by +// Int64Range.Validate if the designated constraints aren't met. +type Int64RangeValidationError struct { + Field string + Reason string + Cause error + Key bool +} + +// Error satisfies the builtin error interface +func (e Int64RangeValidationError) 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 %sInt64Range.%s: %s%s", + key, + e.Field, + e.Reason, + cause) +} + +var _ error = Int64RangeValidationError{} diff --git a/github.com/envoyproxy/go-control-plane/glide.lock b/github.com/envoyproxy/go-control-plane/glide.lock index 7c2879cd..c6af00d7 100644 --- a/github.com/envoyproxy/go-control-plane/glide.lock +++ b/github.com/envoyproxy/go-control-plane/glide.lock @@ -1,8 +1,8 @@ -hash: a952717853c3a38033a035acd2e5b089d33bd759d6464abb53b78a03c848deff -updated: 2018-03-15T10:55:09.93521862-07:00 +hash: 2b24134f468a3e0ddb72640328224a3fded06fa4eee6b62991979ae2fadc25c9 +updated: 2018-03-27T19:44:21.991981981-07:00 imports: - name: github.com/envoyproxy/data-plane-api - version: 47e11810c1af88fdd3cb5fe1aeee139cc67497e0 + version: ec157d3d8b359a1bd65c22116ba4387a459cc53a - name: github.com/gogo/googleapis version: 0cd9801be74a10d5ac39d69626eac8255ffcd502 subpackages: @@ -28,7 +28,7 @@ imports: - ptypes/duration - ptypes/timestamp - name: github.com/lyft/protoc-gen-validate - version: 6cd364ac742e088e22c2d04e90358ce48e1e33e5 + version: cae364899cd8c08b83bfdcabf4ce4dd4a68ca6da subpackages: - validate - name: github.com/sirupsen/logrus @@ -66,7 +66,7 @@ imports: - googleapis/rpc/status - opencensus - name: google.golang.org/grpc - version: 8e4536a86ab602859c20df5ebfd0bd4228d08655 + version: afc05b9e1d36f289ea16ba294894486a3e458246 subpackages: - balancer - balancer/base diff --git a/github.com/envoyproxy/go-control-plane/glide.yaml b/github.com/envoyproxy/go-control-plane/glide.yaml index 7b1c03b0..b505eb76 100644 --- a/github.com/envoyproxy/go-control-plane/glide.yaml +++ b/github.com/envoyproxy/go-control-plane/glide.yaml @@ -14,9 +14,10 @@ import: - package: google.golang.org/grpc version: ^1.7.2 - package: github.com/lyft/protoc-gen-validate + version: cae364899cd8c08b83bfdcabf4ce4dd4a68ca6da - package: istio.io/gogo-genproto - package: github.com/gogo/googleapis - package: github.com/envoyproxy/data-plane-api - version: 47e11810c1af88fdd3cb5fe1aeee139cc67497e0 + version: ec157d3d8b359a1bd65c22116ba4387a459cc53a - package: github.com/sirupsen/logrus version: ^1.0.4 diff --git a/github.com/envoyproxy/go-control-plane/pkg/test/resource/resource.go b/github.com/envoyproxy/go-control-plane/pkg/test/resource/resource.go index 6d258c6e..77f36512 100644 --- a/github.com/envoyproxy/go-control-plane/pkg/test/resource/resource.go +++ b/github.com/envoyproxy/go-control-plane/pkg/test/resource/resource.go @@ -33,8 +33,7 @@ import ( ) const ( - localhost = "127.0.0.1" - httpAccessLog = "envoy.http_grpc_access_log" + localhost = "127.0.0.1" // XdsCluster is the cluster name for the control server (used by non-ADS set-up) XdsCluster = "xds_cluster" @@ -202,7 +201,7 @@ func MakeHTTPListener(mode string, listenerName string, port uint32, route strin Name: util.Router, }}, AccessLog: []*alf.AccessLog{{ - Name: httpAccessLog, + Name: util.HTTPGRPCAccessLog, Config: alsConfigPbst, }}, } diff --git a/github.com/envoyproxy/go-control-plane/pkg/util/wellknown.go b/github.com/envoyproxy/go-control-plane/pkg/util/wellknown.go index 9c4c1325..ab6dc188 100644 --- a/github.com/envoyproxy/go-control-plane/pkg/util/wellknown.go +++ b/github.com/envoyproxy/go-control-plane/pkg/util/wellknown.go @@ -14,7 +14,7 @@ package util -// Common names for Envoy filters. +// HTTP filter names const ( // Buffer HTTP filter Buffer = "envoy.buffer" @@ -46,7 +46,12 @@ const ( Squash = "envoy.squash" // HTTPExternalAuthorization HTTP filter HTTPExternalAuthorization = "envoy.ext_authz" +) +// Network filter names +const ( + // ClientSSLAuth network filter + ClientSSLAuth = "envoy.client_ssl_auth" // Echo network filter Echo = "envoy.echo" // HTTPConnectionManager network filter @@ -62,3 +67,39 @@ const ( // ExternalAuthorization network filter ExternalAuthorization = "envoy.ext_authz" ) + +// Listener filter names +const ( + // OriginalDestination listener filter + OriginalDestination = "envoy.listener.original_dst" + // ProxyProtocol listener filter + ProxyProtocol = "envoy.listener.proxy_protocol" +) + +// Tracing provider names +const ( + // Lightstep tracer name + Lightstep = "envoy.lightstep" + // Zipkin tracer name + Zipkin = "envoy.zipkin" + // DynamicOT tracer name + DynamicOT = "envoy.dynamic.ot" +) + +// Stats sink names +const ( + // Statsd sink + Statsd = "envoy.statsd" + // DogStatsD compatible stastsd sink + DogStatsd = "envoy.dog_statsd" + // MetricsService sink + MetricsService = "envoy.metrics_service" +) + +// Access log sink names +const ( + // FileAccessLog sink name + FileAccessLog = "envoy.file_access_log" + // HTTPGRPCAccessLog sink for the HTTP gRPC access log service + HTTPGRPCAccessLog = "envoy.http_grpc_access_log" +) diff --git a/istio.io/api/envoy/config/filter/http/authn/v2alpha1/config.pb.go b/istio.io/api/envoy/config/filter/http/authn/v2alpha1/config.pb.go new file mode 100644 index 00000000..fa0449ec --- /dev/null +++ b/istio.io/api/envoy/config/filter/http/authn/v2alpha1/config.pb.go @@ -0,0 +1,482 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: envoy/config/filter/http/authn/v2alpha1/config.proto + +/* + Package v2alpha1 is a generated protocol buffer package. + + It is generated from these files: + envoy/config/filter/http/authn/v2alpha1/config.proto + + It has these top-level messages: + FilterConfig +*/ +package v2alpha1 + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import istio_authentication_v1alpha1 "istio.io/api/authentication/v1alpha1" + +import io "io" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +// FilterConfig is the config for Istio-specific filter that is used to enforce +// authentication policy on Envoy. +type FilterConfig struct { + // Policy is the original copy of the policy. + Policy *istio_authentication_v1alpha1.Policy `protobuf:"bytes,1,opt,name=policy" json:"policy,omitempty"` + // Map from issuer to location of the payload that is emitted by Jwt filter. + // This information is added by pilot when construct and add Jwt and + // authN filters. + JwtOutputPayloadLocations map[string]string `protobuf:"bytes,2,rep,name=jwt_output_payload_locations,json=jwtOutputPayloadLocations" json:"jwt_output_payload_locations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *FilterConfig) Reset() { *m = FilterConfig{} } +func (m *FilterConfig) String() string { return proto.CompactTextString(m) } +func (*FilterConfig) ProtoMessage() {} +func (*FilterConfig) Descriptor() ([]byte, []int) { return fileDescriptorConfig, []int{0} } + +func (m *FilterConfig) GetPolicy() *istio_authentication_v1alpha1.Policy { + if m != nil { + return m.Policy + } + return nil +} + +func (m *FilterConfig) GetJwtOutputPayloadLocations() map[string]string { + if m != nil { + return m.JwtOutputPayloadLocations + } + return nil +} + +func init() { + proto.RegisterType((*FilterConfig)(nil), "istio.envoy.config.filter.http.authn.v2alpha1.FilterConfig") +} +func (m *FilterConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FilterConfig) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Policy != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintConfig(dAtA, i, uint64(m.Policy.Size())) + n1, err := m.Policy.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if len(m.JwtOutputPayloadLocations) > 0 { + for k, _ := range m.JwtOutputPayloadLocations { + dAtA[i] = 0x12 + i++ + v := m.JwtOutputPayloadLocations[k] + mapSize := 1 + len(k) + sovConfig(uint64(len(k))) + 1 + len(v) + sovConfig(uint64(len(v))) + i = encodeVarintConfig(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintConfig(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintConfig(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + return i, nil +} + +func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *FilterConfig) Size() (n int) { + var l int + _ = l + if m.Policy != nil { + l = m.Policy.Size() + n += 1 + l + sovConfig(uint64(l)) + } + if len(m.JwtOutputPayloadLocations) > 0 { + for k, v := range m.JwtOutputPayloadLocations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovConfig(uint64(len(k))) + 1 + len(v) + sovConfig(uint64(len(v))) + n += mapEntrySize + 1 + sovConfig(uint64(mapEntrySize)) + } + } + return n +} + +func sovConfig(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozConfig(x uint64) (n int) { + return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *FilterConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FilterConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FilterConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Policy == nil { + m.Policy = &istio_authentication_v1alpha1.Policy{} + } + if err := m.Policy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JwtOutputPayloadLocations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.JwtOutputPayloadLocations == nil { + m.JwtOutputPayloadLocations = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthConfig + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthConfig + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.JwtOutputPayloadLocations[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipConfig(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthConfig + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipConfig(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowConfig = fmt.Errorf("proto: integer overflow") +) + +func init() { + proto.RegisterFile("envoy/config/filter/http/authn/v2alpha1/config.proto", fileDescriptorConfig) +} + +var fileDescriptorConfig = []byte{ + // 302 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x41, 0x4b, 0xc3, 0x30, + 0x14, 0xc7, 0x49, 0x87, 0x03, 0x33, 0x0f, 0x52, 0x3c, 0xcc, 0x21, 0x65, 0x88, 0xc2, 0x2e, 0xbe, + 0xb0, 0xb9, 0x83, 0x08, 0x5e, 0x26, 0x7a, 0x90, 0x81, 0xa3, 0xc7, 0x5d, 0x4a, 0xac, 0x9d, 0xcd, + 0x0c, 0x49, 0xe8, 0x5e, 0x3b, 0xfa, 0x59, 0xfc, 0x24, 0x7e, 0x03, 0x8f, 0x7e, 0x04, 0xe9, 0x27, + 0x91, 0x26, 0x2d, 0xe8, 0x41, 0xd1, 0x5b, 0x5e, 0xde, 0xfb, 0xfd, 0x92, 0x3f, 0x8f, 0x4e, 0x13, + 0x55, 0xe8, 0x92, 0xc5, 0x5a, 0xad, 0xc4, 0x13, 0x5b, 0x09, 0x89, 0x49, 0xc6, 0x52, 0x44, 0xc3, + 0x78, 0x8e, 0xa9, 0x62, 0xc5, 0x84, 0x4b, 0x93, 0xf2, 0x71, 0x33, 0x01, 0x26, 0xd3, 0xa8, 0xfd, + 0x33, 0xb1, 0x41, 0xa1, 0xc1, 0xb2, 0xd0, 0x74, 0x1c, 0x0b, 0x35, 0x0b, 0x96, 0x85, 0x96, 0x1d, + 0x9c, 0xd4, 0x75, 0xa2, 0x50, 0xc4, 0x1c, 0x85, 0x56, 0xac, 0x18, 0x37, 0x52, 0xa3, 0xa5, 0x88, + 0x4b, 0x27, 0x3d, 0x7e, 0xf5, 0xe8, 0xde, 0xad, 0x95, 0x5c, 0x5b, 0xa3, 0x7f, 0x45, 0xbb, 0x6e, + 0xa0, 0x4f, 0x86, 0x64, 0xd4, 0x9b, 0x9c, 0x82, 0x7b, 0xf6, 0xbb, 0x0d, 0x5a, 0x1b, 0x2c, 0xec, + 0x70, 0xd8, 0x40, 0xfe, 0x0b, 0xa1, 0x47, 0xeb, 0x2d, 0x46, 0x3a, 0x47, 0x93, 0x63, 0x64, 0x78, + 0x29, 0x35, 0x7f, 0x8c, 0xa4, 0x76, 0xdc, 0xa6, 0xef, 0x0d, 0x3b, 0xa3, 0xde, 0x64, 0x09, 0xff, + 0x0a, 0x03, 0x5f, 0xbf, 0x08, 0x77, 0x5b, 0xbc, 0xb7, 0xfa, 0x85, 0xb3, 0xcf, 0x5b, 0xf9, 0x8d, + 0xc2, 0xac, 0x0c, 0x0f, 0xd7, 0x3f, 0xf5, 0x07, 0x73, 0x1a, 0xfc, 0x0e, 0xfb, 0xfb, 0xb4, 0xf3, + 0x9c, 0xb8, 0xec, 0xbb, 0x61, 0x7d, 0xf4, 0x0f, 0xe8, 0x4e, 0xc1, 0x65, 0x9e, 0xf4, 0x3d, 0x7b, + 0xe7, 0x8a, 0x4b, 0xef, 0x82, 0xcc, 0x66, 0x6f, 0x55, 0x40, 0xde, 0xab, 0x80, 0x7c, 0x54, 0x01, + 0x59, 0x4e, 0x5d, 0x22, 0xa1, 0x19, 0x37, 0x82, 0xfd, 0x71, 0xc3, 0x0f, 0x5d, 0xbb, 0x86, 0xf3, + 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xce, 0x7c, 0xfe, 0x70, 0x13, 0x02, 0x00, 0x00, +} diff --git a/istio.io/api/envoy/config/filter/http/authn/v2alpha1/config.proto b/istio.io/api/envoy/config/filter/http/authn/v2alpha1/config.proto new file mode 100644 index 00000000..293f4bad --- /dev/null +++ b/istio.io/api/envoy/config/filter/http/authn/v2alpha1/config.proto @@ -0,0 +1,36 @@ +// Copyright 2018 Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "authentication/v1alpha1/policy.proto"; + +// $title: Internal API for authentication implementation on Envoy. + +package istio.envoy.config.filter.http.authn.v2alpha1; + + +option go_package = "istio.io/api/envoy/config/filter/http/authn/v2alpha1"; + +// FilterConfig is the config for Istio-specific filter that is used to enforce +// authentication policy on Envoy. +message FilterConfig { + // Policy is the original copy of the policy. + istio.authentication.v1alpha1.Policy policy = 1; + + // Map from issuer to location of the payload that is emitted by Jwt filter. + // This information is added by pilot when construct and add Jwt and + // authN filters. + map jwt_output_payload_locations = 2; +} diff --git a/istio.io/api/networking/v1alpha3/gateway.pb.go b/istio.io/api/networking/v1alpha3/gateway.pb.go index 9c23f6e9..ea5a5b85 100644 --- a/istio.io/api/networking/v1alpha3/gateway.pb.go +++ b/istio.io/api/networking/v1alpha3/gateway.pb.go @@ -18,14 +18,14 @@ var _ = math.Inf type Server_TLSOptions_TLSmode int32 const ( - // If set to "passthrough", the proxy will forward the connection + // If set to "PASSTHROUGH", the proxy will forward the connection // to the upstream server selected based on the SNI string presented // by the client. Server_TLSOptions_PASSTHROUGH Server_TLSOptions_TLSmode = 0 - // If set to "simple", the proxy will secure connections with + // If set to "SIMPLE", the proxy will secure connections with // standard TLS semantics. Server_TLSOptions_SIMPLE Server_TLSOptions_TLSmode = 1 - // If set to "mutual", the proxy will secure connections to the + // If set to "MUTUAL", the proxy will secure connections to the // upstream using mutual TLS by presenting client certificates for // authentication. Server_TLSOptions_MUTUAL Server_TLSOptions_TLSmode = 2 @@ -72,6 +72,7 @@ func (Server_TLSOptions_TLSmode) EnumDescriptor() ([]byte, []int) { // - port: // number: 80 // name: http +// protocol: HTTP // hosts: // - uk.bookinfo.com // - eu.bookinfo.com @@ -80,20 +81,22 @@ func (Server_TLSOptions_TLSmode) EnumDescriptor() ([]byte, []int) { // - port: // number: 443 // name: https +// protocol: HTTPS // hosts: // - uk.bookinfo.com // - eu.bookinfo.com // tls: -// mode: simple #enables HTTPS on this port +// mode: SIMPLE #enables HTTPS on this port // serverCertificate: /etc/certs/servercert.pem // privateKey: /etc/certs/privatekey.pem // - port: // number: 9080 // name: http-wildcard +// protocol: HTTP // # no hosts implies wildcard match // - port: // number: 2379 #to expose internal service via external port 2379 -// name: Mongo +// name: mongo // protocol: MONGO // // The gateway specification above describes the L4-L6 properties of a load @@ -157,7 +160,7 @@ func (Server_TLSOptions_TLSmode) EnumDescriptor() ([]byte, []int) { // name: bookinfo-Mongo // spec: // hosts: -// - Mongosvr #name of Mongo service +// - mongosvr #name of Mongo service // gateways: // - my-gateway // tcp: @@ -211,6 +214,7 @@ func (m *Gateway) GetSelector() map[string]string { // servers: // - port: // number: 80 +// name: http2 // protocol: HTTP2 // // Another example @@ -225,6 +229,7 @@ func (m *Gateway) GetSelector() map[string]string { // servers: // - port: // number: 27018 +// name: mongo // protocol: MONGO // // The following is an example of TLS configuration for port 443 @@ -239,9 +244,10 @@ func (m *Gateway) GetSelector() map[string]string { // servers: // - port: // number: 443 -// protocol: HTTP +// name: https +// protocol: HTTPS // tls: -// mode: simple +// mode: SIMPLE // serverCertificate: /etc/certs/server.pem // privateKey: /etc/certs/privatekey.pem // @@ -299,13 +305,13 @@ type Server_TLSOptions struct { // secured using TLS. The value of this field determines how TLS is // enforced. Mode Server_TLSOptions_TLSmode `protobuf:"varint,2,opt,name=mode,proto3,enum=istio.networking.v1alpha3.Server_TLSOptions_TLSmode" json:"mode,omitempty"` - // REQUIRED if mode is "simple" or "mutual". The path to the file + // REQUIRED if mode is "SIMPLE" or "MUTUAL". The path to the file // holding the server-side TLS certificate to use. ServerCertificate string `protobuf:"bytes,3,opt,name=server_certificate,json=serverCertificate,proto3" json:"server_certificate,omitempty"` - // REQUIRED if mode is "simple" or "mutual". The path to the file + // REQUIRED if mode is "SIMPLE" or "MUTUAL". The path to the file // holding the server's private key. PrivateKey string `protobuf:"bytes,4,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` - // REQUIRED if mode is "mutual". The path to a file containing + // REQUIRED if mode is "MUTUAL". The path to a file containing // certificate authority certificates to use in verifying a presented // client side certificate. CaCertificates string `protobuf:"bytes,5,opt,name=ca_certificates,json=caCertificates,proto3" json:"ca_certificates,omitempty"` @@ -365,7 +371,7 @@ func (m *Server_TLSOptions) GetSubjectAltNames() []string { type Port struct { // REQUIRED: A valid non-negative integer port number. Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` - // The protocol exposed on the port. + // REQUIRED: The protocol exposed on the port. // MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP. Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"` // Label assigned to the port. diff --git a/istio.io/api/networking/v1alpha3/gateway.proto b/istio.io/api/networking/v1alpha3/gateway.proto index a16bad6f..05f73a9b 100644 --- a/istio.io/api/networking/v1alpha3/gateway.proto +++ b/istio.io/api/networking/v1alpha3/gateway.proto @@ -41,6 +41,7 @@ option go_package = "istio.io/api/networking/v1alpha3"; // - port: // number: 80 // name: http +// protocol: HTTP // hosts: // - uk.bookinfo.com // - eu.bookinfo.com @@ -49,20 +50,22 @@ option go_package = "istio.io/api/networking/v1alpha3"; // - port: // number: 443 // name: https +// protocol: HTTPS // hosts: // - uk.bookinfo.com // - eu.bookinfo.com // tls: -// mode: simple #enables HTTPS on this port +// mode: SIMPLE #enables HTTPS on this port // serverCertificate: /etc/certs/servercert.pem // privateKey: /etc/certs/privatekey.pem // - port: // number: 9080 // name: http-wildcard +// protocol: HTTP // # no hosts implies wildcard match // - port: // number: 2379 #to expose internal service via external port 2379 -// name: Mongo +// name: mongo // protocol: MONGO // // The gateway specification above describes the L4-L6 properties of a load @@ -126,7 +129,7 @@ option go_package = "istio.io/api/networking/v1alpha3"; // name: bookinfo-Mongo // spec: // hosts: -// - Mongosvr #name of Mongo service +// - mongosvr #name of Mongo service // gateways: // - my-gateway // tcp: @@ -162,6 +165,7 @@ message Gateway { // servers: // - port: // number: 80 +// name: http2 // protocol: HTTP2 // // Another example @@ -176,6 +180,7 @@ message Gateway { // servers: // - port: // number: 27018 +// name: mongo // protocol: MONGO // // The following is an example of TLS configuration for port 443 @@ -190,9 +195,10 @@ message Gateway { // servers: // - port: // number: 443 -// protocol: HTTP +// name: https +// protocol: HTTPS // tls: -// mode: simple +// mode: SIMPLE // serverCertificate: /etc/certs/server.pem // privateKey: /etc/certs/privatekey.pem // @@ -219,16 +225,16 @@ message Server { // TLS modes enforced by the proxy enum TLSmode { - // If set to "passthrough", the proxy will forward the connection + // If set to "PASSTHROUGH", the proxy will forward the connection // to the upstream server selected based on the SNI string presented // by the client. PASSTHROUGH = 0; - // If set to "simple", the proxy will secure connections with + // If set to "SIMPLE", the proxy will secure connections with // standard TLS semantics. SIMPLE = 1; - // If set to "mutual", the proxy will secure connections to the + // If set to "MUTUAL", the proxy will secure connections to the // upstream using mutual TLS by presenting client certificates for // authentication. MUTUAL = 2; @@ -239,15 +245,15 @@ message Server { // enforced. TLSmode mode = 2; - // REQUIRED if mode is "simple" or "mutual". The path to the file + // REQUIRED if mode is "SIMPLE" or "MUTUAL". The path to the file // holding the server-side TLS certificate to use. string server_certificate = 3; - // REQUIRED if mode is "simple" or "mutual". The path to the file + // REQUIRED if mode is "SIMPLE" or "MUTUAL". The path to the file // holding the server's private key. string private_key = 4; - // REQUIRED if mode is "mutual". The path to a file containing + // REQUIRED if mode is "MUTUAL". The path to a file containing // certificate authority certificates to use in verifying a presented // client side certificate. string ca_certificates = 5; @@ -268,7 +274,7 @@ message Port { // REQUIRED: A valid non-negative integer port number. uint32 number = 1; - // The protocol exposed on the port. + // REQUIRED: The protocol exposed on the port. // MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP. string protocol = 2; diff --git a/istio.io/api/networking/v1alpha3/istio.networking.v1alpha3.pb.html b/istio.io/api/networking/v1alpha3/istio.networking.v1alpha3.pb.html index 71b55cf6..0cd73f0a 100644 --- a/istio.io/api/networking/v1alpha3/istio.networking.v1alpha3.pb.html +++ b/istio.io/api/networking/v1alpha3/istio.networking.v1alpha3.pb.html @@ -945,6 +945,7 @@

Gateway

- port: number: 80 name: http + protocol: HTTP hosts: - uk.bookinfo.com - eu.bookinfo.com @@ -953,20 +954,22 @@

Gateway

- port: number: 443 name: https + protocol: HTTPS hosts: - uk.bookinfo.com - eu.bookinfo.com tls: - mode: simple #enables HTTPS on this port + mode: SIMPLE #enables HTTPS on this port serverCertificate: /etc/certs/servercert.pem privateKey: /etc/certs/privatekey.pem - port: number: 9080 name: http-wildcard + protocol: HTTP # no hosts implies wildcard match - port: number: 2379 #to expose internal service via external port 2379 - name: Mongo + name: mongo protocol: MONGO @@ -1032,7 +1035,7 @@

Gateway

name: bookinfo-Mongo spec: hosts: - - Mongosvr #name of Mongo service + - mongosvr #name of Mongo service gateways: - my-gateway tcp: @@ -2028,7 +2031,7 @@

Port

protocol string -

The protocol exposed on the port. +

REQUIRED: The protocol exposed on the port. MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP.

@@ -2092,6 +2095,7 @@

Server

servers: - port: number: 80 + name: http2 protocol: HTTP2 @@ -2107,6 +2111,7 @@

Server

servers: - port: number: 27018 + name: mongo protocol: MONGO @@ -2122,9 +2127,10 @@

Server

servers: - port: number: 443 - protocol: HTTP + name: https + protocol: HTTPS tls: - mode: simple + mode: SIMPLE serverCertificate: /etc/certs/server.pem privateKey: /etc/certs/privatekey.pem @@ -2210,7 +2216,7 @@

Server.TLSOptions

serverCertificate string -

REQUIRED if mode is “simple” or “mutual”. The path to the file +

REQUIRED if mode is “SIMPLE” or “MUTUAL”. The path to the file holding the server-side TLS certificate to use.

@@ -2219,7 +2225,7 @@

Server.TLSOptions

privateKey string -

REQUIRED if mode is “simple” or “mutual”. The path to the file +

REQUIRED if mode is “SIMPLE” or “MUTUAL”. The path to the file holding the server’s private key.

@@ -2228,7 +2234,7 @@

Server.TLSOptions

caCertificates string -

REQUIRED if mode is “mutual”. The path to a file containing +

REQUIRED if mode is “MUTUAL”. The path to a file containing certificate authority certificates to use in verifying a presented client side certificate.

@@ -2261,7 +2267,7 @@

Server.TLSOptions.TLSmode

PASSTHROUGH -

If set to “passthrough”, the proxy will forward the connection +

If set to “PASSTHROUGH”, the proxy will forward the connection to the upstream server selected based on the SNI string presented by the client.

@@ -2270,7 +2276,7 @@

Server.TLSOptions.TLSmode

SIMPLE -

If set to “simple”, the proxy will secure connections with +

If set to “SIMPLE”, the proxy will secure connections with standard TLS semantics.

@@ -2278,7 +2284,7 @@

Server.TLSOptions.TLSmode

MUTUAL -

If set to “mutual”, the proxy will secure connections to the +

If set to “MUTUAL”, the proxy will secure connections to the upstream using mutual TLS by presenting client certificates for authentication.