diff --git a/BUILD b/BUILD index bb4f5931..52c4178f 100644 --- a/BUILD +++ b/BUILD @@ -77,6 +77,9 @@ proto_library( "//contrib/envoy/extensions/filters/http/squash/v3:pkg", "//contrib/envoy/extensions/filters/http/sxg/v3alpha:pkg", "//contrib/envoy/extensions/filters/network/client_ssl_auth/v3:pkg", + "//contrib/envoy/extensions/filters/network/generic_proxy/action/v3:pkg", + "//contrib/envoy/extensions/filters/network/generic_proxy/matcher/v3:pkg", + "//contrib/envoy/extensions/filters/network/generic_proxy/v3:pkg", "//contrib/envoy/extensions/filters/network/kafka_broker/v3:pkg", "//contrib/envoy/extensions/filters/network/kafka_mesh/v3alpha:pkg", "//contrib/envoy/extensions/filters/network/mysql_proxy/v3:pkg", @@ -204,9 +207,6 @@ proto_library( "//envoy/extensions/filters/network/ext_authz/v3:pkg", "//envoy/extensions/filters/network/http_connection_manager/v3:pkg", "//envoy/extensions/filters/network/local_ratelimit/v3:pkg", - "//envoy/extensions/filters/network/meta_protocol_proxy/matcher/action/v3:pkg", - "//envoy/extensions/filters/network/meta_protocol_proxy/matcher/v3:pkg", - "//envoy/extensions/filters/network/meta_protocol_proxy/v3:pkg", "//envoy/extensions/filters/network/mongo_proxy/v3:pkg", "//envoy/extensions/filters/network/ratelimit/v3:pkg", "//envoy/extensions/filters/network/rbac/v3:pkg", diff --git a/envoy/extensions/filters/network/meta_protocol_proxy/matcher/action/v3/BUILD b/contrib/envoy/extensions/filters/network/generic_proxy/action/v3/BUILD similarity index 90% rename from envoy/extensions/filters/network/meta_protocol_proxy/matcher/action/v3/BUILD rename to contrib/envoy/extensions/filters/network/generic_proxy/action/v3/BUILD index 8b8b7177..d0a7c688 100644 --- a/envoy/extensions/filters/network/meta_protocol_proxy/matcher/action/v3/BUILD +++ b/contrib/envoy/extensions/filters/network/generic_proxy/action/v3/BUILD @@ -6,6 +6,7 @@ licenses(["notice"]) # Apache 2 api_proto_package( deps = [ + "//envoy/config/core/v3:pkg", "//envoy/config/route/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", "@com_github_cncf_udpa//xds/annotations/v3:pkg", diff --git a/envoy/extensions/filters/network/meta_protocol_proxy/matcher/action/v3/action.proto b/contrib/envoy/extensions/filters/network/generic_proxy/action/v3/action.proto similarity index 66% rename from envoy/extensions/filters/network/meta_protocol_proxy/matcher/action/v3/action.proto rename to contrib/envoy/extensions/filters/network/generic_proxy/action/v3/action.proto index 1d831c9f..b00cabfd 100644 --- a/envoy/extensions/filters/network/meta_protocol_proxy/matcher/action/v3/action.proto +++ b/contrib/envoy/extensions/filters/network/generic_proxy/action/v3/action.proto @@ -1,25 +1,27 @@ syntax = "proto3"; -package envoy.extensions.filters.network.meta_protocol_proxy.matcher.action.v3; +package envoy.extensions.filters.network.generic_proxy.action.v3; +import "envoy/config/core/v3/base.proto"; import "envoy/config/route/v3/route_components.proto"; +import "google/protobuf/any.proto"; + import "xds/annotations/v3/status.proto"; import "udpa/annotations/status.proto"; import "validate/validate.proto"; -option java_package = "io.envoyproxy.envoy.extensions.filters.network.meta_protocol_proxy.matcher.action.v3"; +option java_package = "io.envoyproxy.envoy.extensions.filters.network.generic_proxy.action.v3"; option java_outer_classname = "ActionProto"; option java_multiple_files = true; -option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/meta_protocol_proxy/matcher/action/v3;actionv3"; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/generic_proxy/action/v3;actionv3"; option (udpa.annotations.file_status).package_version_status = ACTIVE; option (xds.annotations.v3.file_status).work_in_progress = true; -// [#protodoc-title: Meta Protocol Proxy Route Action Configuration] +// [#protodoc-title: Generic Proxy Route Action Configuration] // Configuration for the route match action. -// [#not-implemented-hide:] message RouteAction { oneof cluster_specifier { option (validate.required) = true; @@ -27,9 +29,17 @@ message RouteAction { // Indicates the upstream cluster to which the request should be routed. string cluster = 1; + // [#not-implemented-hide:] // Multiple upstream clusters can be specified for a given route. The request is routed to one // of the upstream clusters based on weights assigned to each cluster. // Currently ClusterWeight only supports the name and weight fields. config.route.v3.WeightedCluster weighted_clusters = 2; } + + // Route metadata. + config.core.v3.Metadata metadata = 3; + + // Route level config for L7 generic filters. The key should always be the generic + // filter name. + map per_filter_config = 4; } diff --git a/envoy/extensions/filters/network/meta_protocol_proxy/matcher/v3/BUILD b/contrib/envoy/extensions/filters/network/generic_proxy/matcher/v3/BUILD similarity index 100% rename from envoy/extensions/filters/network/meta_protocol_proxy/matcher/v3/BUILD rename to contrib/envoy/extensions/filters/network/generic_proxy/matcher/v3/BUILD diff --git a/envoy/extensions/filters/network/meta_protocol_proxy/matcher/v3/matcher.proto b/contrib/envoy/extensions/filters/network/generic_proxy/matcher/v3/matcher.proto similarity index 76% rename from envoy/extensions/filters/network/meta_protocol_proxy/matcher/v3/matcher.proto rename to contrib/envoy/extensions/filters/network/generic_proxy/matcher/v3/matcher.proto index 60679639..b03a6088 100644 --- a/envoy/extensions/filters/network/meta_protocol_proxy/matcher/v3/matcher.proto +++ b/contrib/envoy/extensions/filters/network/generic_proxy/matcher/v3/matcher.proto @@ -1,36 +1,33 @@ syntax = "proto3"; -package envoy.extensions.filters.network.meta_protocol_proxy.matcher.v3; +package envoy.extensions.filters.network.generic_proxy.matcher.v3; import "xds/annotations/v3/status.proto"; import "udpa/annotations/status.proto"; import "validate/validate.proto"; -option java_package = "io.envoyproxy.envoy.extensions.filters.network.meta_protocol_proxy.matcher.v3"; +option java_package = "io.envoyproxy.envoy.extensions.filters.network.generic_proxy.matcher.v3"; option java_outer_classname = "MatcherProto"; option java_multiple_files = true; -option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/meta_protocol_proxy/matcher/v3;matcherv3"; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/generic_proxy/matcher/v3;matcherv3"; option (udpa.annotations.file_status).package_version_status = ACTIVE; option (xds.annotations.v3.file_status).work_in_progress = true; -// [#protodoc-title: Meta Protocol Proxy Route Matcher Configuration] +// [#protodoc-title: Generic Proxy Route Matcher Configuration] // Used to match request service of the downstream request. Only applicable if a service provided // by the application protocol. -// [#not-implemented-hide:] message ServiceMatchInput { } // Used to match request method of the downstream request. Only applicable if a method provided // by the application protocol. -// [#not-implemented-hide:] message MethodMatchInput { } // Used to match an arbitrary property of the downstream request. // These properties are populated by the codecs of application protocols. -// [#not-implemented-hide:] message PropertyMatchInput { // The property name to match on. string property_name = 1 [(validate.rules).string = {min_len: 1}]; diff --git a/contrib/envoy/extensions/filters/network/generic_proxy/router/v3/BUILD b/contrib/envoy/extensions/filters/network/generic_proxy/router/v3/BUILD new file mode 100644 index 00000000..ec1e778e --- /dev/null +++ b/contrib/envoy/extensions/filters/network/generic_proxy/router/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "@com_github_cncf_udpa//udpa/annotations:pkg", + "@com_github_cncf_udpa//xds/annotations/v3:pkg", + ], +) diff --git a/contrib/envoy/extensions/filters/network/generic_proxy/router/v3/router.proto b/contrib/envoy/extensions/filters/network/generic_proxy/router/v3/router.proto new file mode 100644 index 00000000..4f891be0 --- /dev/null +++ b/contrib/envoy/extensions/filters/network/generic_proxy/router/v3/router.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.generic_proxy.router.v3; + +import "xds/annotations/v3/status.proto"; + +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.generic_proxy.router.v3"; +option java_outer_classname = "RouterProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/generic_proxy/router/v3;routerv3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; +option (xds.annotations.v3.file_status).work_in_progress = true; + +// [#protodoc-title: Router for generic proxy] + +message Router { +} diff --git a/envoy/extensions/filters/network/meta_protocol_proxy/v3/BUILD b/contrib/envoy/extensions/filters/network/generic_proxy/v3/BUILD similarity index 100% rename from envoy/extensions/filters/network/meta_protocol_proxy/v3/BUILD rename to contrib/envoy/extensions/filters/network/generic_proxy/v3/BUILD diff --git a/contrib/envoy/extensions/filters/network/generic_proxy/v3/generic_proxy.proto b/contrib/envoy/extensions/filters/network/generic_proxy/v3/generic_proxy.proto new file mode 100644 index 00000000..bc60e326 --- /dev/null +++ b/contrib/envoy/extensions/filters/network/generic_proxy/v3/generic_proxy.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.generic_proxy.v3; + +import "contrib/envoy/extensions/filters/network/generic_proxy/v3/route.proto"; +import "envoy/config/core/v3/config_source.proto"; +import "envoy/config/core/v3/extension.proto"; + +import "xds/annotations/v3/status.proto"; + +import "udpa/annotations/status.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.generic_proxy.v3"; +option java_outer_classname = "GenericProxyProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/generic_proxy/v3;generic_proxyv3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; +option (xds.annotations.v3.file_status).work_in_progress = true; + +// [#protodoc-title: Generic Proxy] +// Generic proxy. +// [#extension: envoy.filters.network.generic_proxy] + +// [#next-free-field: 6] +message GenericProxy { + // The human readable prefix to use when emitting statistics. + string stat_prefix = 1 [(validate.rules).string = {min_len: 1}]; + + // The codec which encodes and decodes the application protocol. + config.core.v3.TypedExtensionConfig codec_config = 2 + [(validate.rules).message = {required: true}]; + + oneof route_specifier { + option (validate.required) = true; + + // [#not-implemented-hide:] + // The generic proxies route table will be dynamically loaded via the meta RDS API. + GenericRds generic_rds = 3; + + // The route table for the generic proxy is static and is specified in this property. + RouteConfiguration route_config = 4; + } + + // A list of individual Layer-7 filters that make up the filter chain for requests made to the + // proxy. Order matters as the filters are processed sequentially as request events + // happen. + repeated config.core.v3.TypedExtensionConfig filters = 5; +} + +// [#not-implemented-hide:] +message GenericRds { + // Configuration source specifier for RDS. + config.core.v3.ConfigSource config_source = 1 [(validate.rules).message = {required: true}]; + + // The name of the route configuration. This name will be passed to the RDS API. This allows an + // Envoy configuration with multiple generic proxies to use different route configurations. + string route_config_name = 2 [(validate.rules).string = {min_len: 1}]; +} diff --git a/contrib/envoy/extensions/filters/network/generic_proxy/v3/route.proto b/contrib/envoy/extensions/filters/network/generic_proxy/v3/route.proto new file mode 100644 index 00000000..62985047 --- /dev/null +++ b/contrib/envoy/extensions/filters/network/generic_proxy/v3/route.proto @@ -0,0 +1,72 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.generic_proxy.v3; + +import "xds/annotations/v3/status.proto"; +import "xds/type/matcher/v3/matcher.proto"; + +import "udpa/annotations/status.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.generic_proxy.v3"; +option java_outer_classname = "RouteProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/generic_proxy/v3;generic_proxyv3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; +option (xds.annotations.v3.file_status).work_in_progress = true; + +// [#protodoc-title: Generic Proxy Route Configuration] + +// The generic proxy makes use of the `xds matching API` for routing configurations. +// +// In the below example, we combine a top level tree matcher with a linear matcher to match +// the incoming requests, and send the matching requests to v1 of the upstream service. +// +// .. code-block:: yaml +// +// name: example +// routes: +// matcher_tree: +// input: +// name: request-service +// typed_config: +// "@type": type.googleapis.com/envoy.extensions.filters.network.generic_proxy.matcher.v3.ServiceMatchInput +// exact_match_map: +// map: +// service_name_0: +// matcher: +// matcher_list: +// matchers: +// - predicate: +// and_matcher: +// predicate: +// - single_predicate: +// input: +// name: request-properties +// typed_config: +// "@type": type.googleapis.com/envoy.extensions.filters.network.generic_proxy.matcher.v3.PropertyMatchInput +// property_name: version +// value_match: +// exact: v1 +// - single_predicate: +// input: +// name: request-properties +// typed_config: +// "@type": type.googleapis.com/envoy.extensions.filters.network.generic_proxy.matcher.v3.PropertyMatchInput +// property_name: user +// value_match: +// exact: john +// on_match: +// action: +// name: route +// typed_config: +// "@type": type.googleapis.com/envoy.extensions.filters.network.generic_proxy.action.v3.routeAction +// cluster: cluster_0 +message RouteConfiguration { + // The name of the route configuration. For example, it might match route_config_name in + // envoy.extensions.filters.network.generic_proxy.v3.Rds. + string name = 1 [(validate.rules).string = {min_len: 1}]; + + // The match tree to use when resolving route actions for incoming requests. + xds.type.matcher.v3.Matcher routes = 2 [(validate.rules).message = {required: true}]; +} diff --git a/envoy/extensions/filters/network/meta_protocol_proxy/v3/meta_protocol_proxy.proto b/envoy/extensions/filters/network/meta_protocol_proxy/v3/meta_protocol_proxy.proto deleted file mode 100644 index 7ab09b16..00000000 --- a/envoy/extensions/filters/network/meta_protocol_proxy/v3/meta_protocol_proxy.proto +++ /dev/null @@ -1,66 +0,0 @@ -syntax = "proto3"; - -package envoy.extensions.filters.network.meta_protocol_proxy.v3; - -import "envoy/config/core/v3/config_source.proto"; -import "envoy/config/core/v3/extension.proto"; -import "envoy/extensions/filters/network/meta_protocol_proxy/v3/route.proto"; - -import "xds/annotations/v3/status.proto"; - -import "udpa/annotations/status.proto"; -import "validate/validate.proto"; - -option java_package = "io.envoyproxy.envoy.extensions.filters.network.meta_protocol_proxy.v3"; -option java_outer_classname = "MetaProtocolProxyProto"; -option java_multiple_files = true; -option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/meta_protocol_proxy/v3;meta_protocol_proxyv3"; -option (udpa.annotations.file_status).package_version_status = ACTIVE; -option (xds.annotations.v3.file_status).work_in_progress = true; - -// [#protodoc-title: Meta Protocol Proxy] -// Meta Protocol proxy. - -// [#not-implemented-hide:] -// [#next-free-field: 6] -message MetaProtocolProxy { - // The human readable prefix to use when emitting statistics. - string stat_prefix = 1 [(validate.rules).string = {min_len: 1}]; - - // The application protocol built on top of the meta protocol proxy. - ApplicationProtocol application_protocol = 2 [(validate.rules).message = {required: true}]; - - oneof route_specifier { - option (validate.required) = true; - - // The meta protocol proxies route table will be dynamically loaded via the meta RDS API. - MetaRds rds = 3; - - // The route table for the meta protocol proxy is static and is specified in this property. - RouteConfiguration route_config = 4; - } - - // A list of individual Layer-7 filters that make up the filter chain for requests made to the - // meta protocol proxy. Order matters as the filters are processed sequentially as request events - // happen. - repeated config.core.v3.TypedExtensionConfig meta_protocol_filters = 5; -} - -// [#not-implemented-hide:] -message ApplicationProtocol { - // The name of the application protocol. - string name = 1 [(validate.rules).string = {min_len: 1}]; - - // The codec which encodes and decodes the application protocol. - config.core.v3.TypedExtensionConfig codec = 2 [(validate.rules).message = {required: true}]; -} - -// [#not-implemented-hide:] -message MetaRds { - // Configuration source specifier for RDS. - config.core.v3.ConfigSource config_source = 1 [(validate.rules).message = {required: true}]; - - // The name of the route configuration. This name will be passed to the RDS API. This allows an - // Envoy configuration with multiple meta protocol proxies to use different route configurations. - string route_config_name = 2 [(validate.rules).string = {min_len: 1}]; -} diff --git a/envoy/extensions/filters/network/meta_protocol_proxy/v3/route.proto b/envoy/extensions/filters/network/meta_protocol_proxy/v3/route.proto deleted file mode 100644 index f254886e..00000000 --- a/envoy/extensions/filters/network/meta_protocol_proxy/v3/route.proto +++ /dev/null @@ -1,70 +0,0 @@ -syntax = "proto3"; - -package envoy.extensions.filters.network.meta_protocol_proxy.v3; - -import "xds/annotations/v3/status.proto"; -import "xds/type/matcher/v3/matcher.proto"; - -import "udpa/annotations/status.proto"; -import "validate/validate.proto"; - -option java_package = "io.envoyproxy.envoy.extensions.filters.network.meta_protocol_proxy.v3"; -option java_outer_classname = "RouteProto"; -option java_multiple_files = true; -option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/meta_protocol_proxy/v3;meta_protocol_proxyv3"; -option (udpa.annotations.file_status).package_version_status = ACTIVE; -option (xds.annotations.v3.file_status).work_in_progress = true; - -// [#protodoc-title: Meta Protocol Proxy Route Configuration] -// The meta protocol proxy makes use of the `xds matching API` for routing configurations. -// -// In the below example, we combine a top level tree matcher with a linear matcher to match -// the incoming requests, and send the matching requests to v1 of the upstream service. -// -// name: demo-v1 -// route: -// matcher_tree: -// input: -// name: request-service -// typed_config: -// "@type": type.googleapis.com/envoy.extensions.filters.network.meta_protocol_proxy.matcher.v3.ServiceMatchInput -// exact_match_map: -// map: -// org.apache.dubbo.samples.basic.api.DemoService: -// matcher: -// matcher_list: -// matchers: -// - predicate: -// and_matcher: -// predicate: -// - single_predicate: -// input: -// name: request-properties -// typed_config: -// "@type": type.googleapis.com/envoy.extensions.filters.network.meta_protocol_proxy.matcher.v3.PropertyMatchInput -// property_name: version -// value_match: -// exact: v1 -// - single_predicate: -// input: -// name: request-properties -// typed_config: -// "@type": type.googleapis.com/envoy.extensions.filters.network.meta_protocol_proxy.matcher.v3.PropertyMatchInput -// property_name: user -// value_match: -// exact: john -// on_match: -// action: -// name: route -// typed_config: -// "@type": type.googleapis.com/envoy.extensions.filters.network.meta_protocol_proxy.matcher.action.v3.routeAction -// cluster: outbound|20880|v1|org.apache.dubbo.samples.basic.api.demoservice -// [#not-implemented-hide:] -message RouteConfiguration { - // The name of the route configuration. For example, it might match route_config_name in - // envoy.extensions.filters.network.meta_protocol_proxy.v3.Rds. - string name = 1 [(validate.rules).string = {min_len: 1}]; - - // The match tree to use when resolving route actions for incoming requests. - xds.type.matcher.v3.Matcher route = 2 [(validate.rules).message = {required: true}]; -} diff --git a/versioning/BUILD b/versioning/BUILD index 14e95db7..69f18bb8 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -14,6 +14,10 @@ proto_library( "//contrib/envoy/extensions/filters/http/squash/v3:pkg", "//contrib/envoy/extensions/filters/http/sxg/v3alpha:pkg", "//contrib/envoy/extensions/filters/network/client_ssl_auth/v3:pkg", + "//contrib/envoy/extensions/filters/network/generic_proxy/action/v3:pkg", + "//contrib/envoy/extensions/filters/network/generic_proxy/matcher/v3:pkg", + "//contrib/envoy/extensions/filters/network/generic_proxy/router/v3:pkg", + "//contrib/envoy/extensions/filters/network/generic_proxy/v3:pkg", "//contrib/envoy/extensions/filters/network/kafka_broker/v3:pkg", "//contrib/envoy/extensions/filters/network/kafka_mesh/v3alpha:pkg", "//contrib/envoy/extensions/filters/network/mysql_proxy/v3:pkg", @@ -142,9 +146,6 @@ proto_library( "//envoy/extensions/filters/network/ext_authz/v3:pkg", "//envoy/extensions/filters/network/http_connection_manager/v3:pkg", "//envoy/extensions/filters/network/local_ratelimit/v3:pkg", - "//envoy/extensions/filters/network/meta_protocol_proxy/matcher/action/v3:pkg", - "//envoy/extensions/filters/network/meta_protocol_proxy/matcher/v3:pkg", - "//envoy/extensions/filters/network/meta_protocol_proxy/v3:pkg", "//envoy/extensions/filters/network/mongo_proxy/v3:pkg", "//envoy/extensions/filters/network/ratelimit/v3:pkg", "//envoy/extensions/filters/network/rbac/v3:pkg",