diff --git a/api/envoy/extensions/filters/network/meta_protocol_proxy/router/v3alpha/BUILD b/api/envoy/extensions/filters/network/meta_protocol_proxy/router/v3alpha/BUILD new file mode 100644 index 000000000000..ee92fb652582 --- /dev/null +++ b/api/envoy/extensions/filters/network/meta_protocol_proxy/router/v3alpha/BUILD @@ -0,0 +1,9 @@ +# 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"], +) diff --git a/api/envoy/extensions/filters/network/meta_protocol_proxy/router/v3alpha/router.proto b/api/envoy/extensions/filters/network/meta_protocol_proxy/router/v3alpha/router.proto new file mode 100644 index 000000000000..3fad63066e6d --- /dev/null +++ b/api/envoy/extensions/filters/network/meta_protocol_proxy/router/v3alpha/router.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package aeraki.meta_protocol_proxy.filters.router.v1alpha; + +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.meta_protocol_proxy.router.v1alpha"; +option java_outer_classname = "RouterProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Router] +// MetaProtocol router :ref:`configuration overview `. + +message Router { +} diff --git a/api/envoy/extensions/filters/network/meta_protocol_proxy/v3alpha/BUILD b/api/envoy/extensions/filters/network/meta_protocol_proxy/v3alpha/BUILD new file mode 100644 index 000000000000..c06bb7bc9a2f --- /dev/null +++ b/api/envoy/extensions/filters/network/meta_protocol_proxy/v3alpha/BUILD @@ -0,0 +1,15 @@ +# 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 = [ + "@envoy_api//envoy/config/core/v3:pkg", + "@envoy_api//envoy/config/route/v3:pkg", + "@envoy_api//envoy/type/matcher/v3:pkg", + "@envoy_api//envoy/type/v3:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/api/envoy/extensions/filters/network/meta_protocol_proxy/v3alpha/meta_protocol_proxy.proto b/api/envoy/extensions/filters/network/meta_protocol_proxy/v3alpha/meta_protocol_proxy.proto new file mode 100644 index 000000000000..fc51f1060a2a --- /dev/null +++ b/api/envoy/extensions/filters/network/meta_protocol_proxy/v3alpha/meta_protocol_proxy.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.meta_protocol_proxy.v3alpha; + +import "envoy/config/core/v3/config_source.proto"; + +import "envoy/extensions/filters/network/meta_protocol_proxy/route/v3alpha/route.proto"; + +import "google/protobuf/any.proto"; + +import "udpa/annotations/status.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.meta_protocol_proxy.v3alpha"; +option java_outer_classname = "MetaProtocolProxyProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Meta Protocol proxy] +// Meta Protocol proxy :ref:`configuration overview `. +// [#extension: envoy.filters.network.meta_protocol_proxy] + +// [#next-free-field: 7] +message MetaProtocolProxy { + // The human readable prefix to use when emitting statistics. + string stat_prefix = 1 [(validate.rules).string = {min_len: 1}]; + + // The name of the application protocol built on top of meta protocol. + string application_protocol = 2 [(validate.rules).string = {min_len: 1}]; + + oneof route_specifier { + option (validate.required) = true; + + // The meta protocol proxy’s route table will be dynamically loaded via the RDS API. + Rds rds = 3; + + // The route table for the meta protocol proxy is static and is specified in this property. + config.route.v1alpha.RouteConfiguration route_config = 4; + } + + // The codec which encodes and decodes the application protocol. + Codec codec = 5; + + // 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. If no meta_protocol_filters are specified, a default router filter + // (`aeraki.meta_protocol.filters.router`) is used. + repeated MetaProtocolFilter meta_protocol_filters = 6; +} + +message Rds { + // Configuration source specifier for RDS. + envoy.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 HTTP listeners (and + // associated HTTP connection manager filters) to use different route + // configurations. + string route_config_name = 2; +} + +// MetaProtocolFilter configures a MetaProtocol filter. +message MetaProtocolFilter { + // The name of the filter to instantiate. The name must match a supported filter. + string name = 1 [(validate.rules).string = {min_len: 1}]; + + // Filter specific configuration which depends on the filter being + // instantiated. See the supported filters for further documentation. + google.protobuf.Any config = 2; +} + +message Codec { + // The name of the codec configuration. + string name = 1 [(validate.rules).string = {min_len: 1}]; + + // Codec specific configuration which depends on the codec being instantiated. + google.protobuf.Any config = 2; +} diff --git a/api/envoy/extensions/filters/network/meta_protocol_proxy/v3alpha/route.proto b/api/envoy/extensions/filters/network/meta_protocol_proxy/v3alpha/route.proto new file mode 100644 index 000000000000..b241d87dc945 --- /dev/null +++ b/api/envoy/extensions/filters/network/meta_protocol_proxy/v3alpha/route.proto @@ -0,0 +1,101 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.meta_protocol_proxy.v3alpha; + +import "envoy/config/core/v3/base.proto"; +import "envoy/config/route/v3/route_components.proto"; + +import "google/protobuf/wrappers.proto" + +import "udpa/annotations/status.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.meta_protocol_proxy.v3alpha"; +option java_outer_classname = "MetaRouteConfigurationProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Meta Protocol Proxy Route Configuration] +// Meta Protocol proxy :ref:`configuration overview `. + +// [#next-free-field: 3] +message RouteConfiguration { + //The name of the route configuration. For example, it might match route_config_name in envoy.extensions.filters.network.meta_protocol_proxy.v1alpha.Rds. + string name = 1; + + // The list of routes that will be matched, in order, against incoming requests. The first route + // that matches will be used. + repeated Route routes = 2; +} + +message RetryPolicy { + // When certain conditions are met, the upstream request is retried. Supports retry when a + // network error occurs or when the response status is a specific status. + string retry_on = 1; + + // Maximum number of retries. For a downstream request, envoy may issue `1 + may_retry` + // upstream requests. + uint32 max_retry = 2; + + // If not specified, then Route.timeout will be used. + google.protobuf.Duration per_try_timeout = 3; +} + +message Route { + // Name for the route. + string name = 1; + + // Route matching parameters. + RouteMatch match = 2; + + // Route request to some upstream cluster. + RouteAction route = 3 [(validate.rules).message = {required: true}]; + + // [#not-implemented-hide:] + // Downstream request timeout. + google.protobuf.Duration timeout = 4; + + // [#not-implemented-hide:] + // Retry policy used by current route. + RetryPolicy retry = 5; + + // Route level config for L7 generic filters. The key should always be the generic filter name. + map per_filter_config = 6; + + // Route metadata. + config.core.v3.Metadata metadata = 7; +} + +message RouteMatch { + // Traget service name of downstream request. + google.protobuf.StringValue service = 2; + + // Used to match request path of downstream request. If request path does not match + // this rule, the entire request does not match the current route. + type.matcher.v3.StringMatcher path = 3; + + // Used to match request method of downstream request. If request method does not match + // this rule, the entire request does not match the current route. + type.matcher.v3.StringMatcher method = 4; + + // Specifies a set of key:value pairs in th metadata that the route should match on. The router will check the metadata + // populated by the codec plugin against all the specified key:value pairs in the route config. A match will happen if all the + // key:value pairs in the route are present in the request metadata with the same values (or based on presence if + // the value field is not in the config). + repeated envoy.config.route.v3.HeaderMatcher metadata = 1; +} + +message RouteAction { + oneof cluster_specifier { + option (validate.required) = true; + + // Indicates the upstream cluster to which the request should be routed. + string cluster = 1; + + // 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. + envoy.config.route.v3.WeightedCluster weighted_clusters = 2; + } +}