Skip to content

Commit

Permalink
添加jres_proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangji36680 authored and zhangji36680 committed Sep 22, 2021
1 parent 77d7cec commit a01dc87
Show file tree
Hide file tree
Showing 94 changed files with 7,110 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ extensions/filters/common/original_src @snowp @klarose
/*/extensions/filters/http/ext_proc @gbrail @htuch
# jwt_authn http filter extension
/*/extensions/filters/http/jwt_authn @qiwzhang @lizan
# jres_proxy extension
/*/extensions/filters/network/jres_proxy @zyfjeff @lizan
# grpc_http1_reverse_bridge http filter extension
/*/extensions/filters/http/grpc_http1_reverse_bridge @snowp @zuercher
# header_to_metadata extension
Expand Down
4 changes: 4 additions & 0 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ proto_library(
"//envoy/config/filter/http/squash/v2:pkg",
"//envoy/config/filter/http/tap/v2alpha:pkg",
"//envoy/config/filter/http/transcoder/v2:pkg",
"//envoy/config/filter/jres/router/v2alpha1:pkg",
"//envoy/config/filter/listener/http_inspector/v2:pkg",
"//envoy/config/filter/listener/original_dst/v2:pkg",
"//envoy/config/filter/listener/original_src/v2alpha1:pkg",
Expand All @@ -68,6 +69,7 @@ proto_library(
"//envoy/config/filter/network/echo/v2:pkg",
"//envoy/config/filter/network/ext_authz/v2:pkg",
"//envoy/config/filter/network/http_connection_manager/v2:pkg",
"//envoy/config/filter/network/jres_proxy/v2alpha1:pkg",
"//envoy/config/filter/network/kafka_broker/v2alpha1:pkg",
"//envoy/config/filter/network/local_rate_limit/v2alpha:pkg",
"//envoy/config/filter/network/mongo_proxy/v2:pkg",
Expand Down Expand Up @@ -218,6 +220,8 @@ proto_library(
"//envoy/extensions/filters/network/echo/v3:pkg",
"//envoy/extensions/filters/network/ext_authz/v3:pkg",
"//envoy/extensions/filters/network/http_connection_manager/v3:pkg",
"//envoy/extensions/filters/network/jres_proxy/router/v3:pkg",
"//envoy/extensions/filters/network/jres_proxy/v3:pkg",
"//envoy/extensions/filters/network/kafka_broker/v3:pkg",
"//envoy/extensions/filters/network/local_ratelimit/v3:pkg",
"//envoy/extensions/filters/network/mongo_proxy/v3:pkg",
Expand Down
9 changes: 9 additions & 0 deletions api/envoy/config/filter/jres/router/v2alpha1/BUILD
Original file line number Diff line number Diff line change
@@ -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"],
)
19 changes: 19 additions & 0 deletions api/envoy/config/filter/jres/router/v2alpha1/router.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

package envoy.config.filter.jres.router.v2alpha1;

import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";

option java_package = "io.envoyproxy.envoy.config.filter.jres.router.v2alpha1";
option java_outer_classname = "RouterProto";
option java_multiple_files = true;
option (udpa.annotations.file_migrate).move_to_package =
"envoy.extensions.filters.network.jres_proxy.router.v3";
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Router]
// Jres router :ref:`configuration overview <config_jres_filters_router>`.

message Router {
}
14 changes: 14 additions & 0 deletions api/envoy/config/filter/network/jres_proxy/v2alpha1/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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/v2/route:pkg",
"//envoy/type:pkg",
"//envoy/type/matcher:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Protocol buffer definitions for the Jres proxy.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
syntax = "proto3";

package envoy.config.filter.network.jres_proxy.v2alpha1;

import "envoy/config/filter/network/jres_proxy/v2alpha1/route.proto";

import "google/protobuf/any.proto";

import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.config.filter.network.jres_proxy.v2alpha1";
option java_outer_classname = "JresProxyProto";
option java_multiple_files = true;
option (udpa.annotations.file_migrate).move_to_package =
"envoy.extensions.filters.network.jres_proxy.v3";
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Jres Proxy]
// Jres Proxy :ref:`configuration overview <config_network_filters_jres_proxy>`.
// [#extension: envoy.filters.network.jres_proxy]

// Jres Protocol types supported by Envoy.
enum ProtocolType {
// the default protocol.
Jres = 0;
}

// Jres Serialization types supported by Envoy.
enum SerializationType {
// the default serialization protocol.
Hessian2 = 0;
}

// [#next-free-field: 6]
message JresProxy {
// The human readable prefix to use when emitting statistics.
string stat_prefix = 1 [(validate.rules).string = {min_bytes: 1}];

// Configure the protocol used.
ProtocolType protocol_type = 2 [(validate.rules).enum = {defined_only: true}];

// Configure the serialization protocol used.
SerializationType serialization_type = 3 [(validate.rules).enum = {defined_only: true}];

// The route table for the connection manager is static and is specified in this property.
repeated RouteConfiguration route_config = 4;

// A list of individual Jres filters that make up the filter chain for requests made to the
// Jres proxy. Order matters as the filters are processed sequentially. For backwards
// compatibility, if no jres_filters are specified, a default Jres router filter
// (`envoy.filters.jres.router`) is used.
repeated JresFilter jres_filters = 5;
}

// JresFilter configures a Jres filter.
message JresFilter {
// The name of the filter to instantiate. The name must match a supported
// filter.
string name = 1 [(validate.rules).string = {min_bytes: 1}];

// Filter specific configuration which depends on the filter being
// instantiated. See the supported filters for further documentation.
google.protobuf.Any config = 2;
}
105 changes: 105 additions & 0 deletions api/envoy/config/filter/network/jres_proxy/v2alpha1/route.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
syntax = "proto3";

package envoy.config.filter.network.jres_proxy.v2alpha1;

import "envoy/api/v2/route/route_components.proto";
import "envoy/type/matcher/string.proto";
import "envoy/type/range.proto";

import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.config.filter.network.jres_proxy.v2alpha1";
option java_outer_classname = "RouteProto";
option java_multiple_files = true;
option (udpa.annotations.file_migrate).move_to_package =
"envoy.extensions.filters.network.jres_proxy.v3";
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Jres Proxy Route Configuration]
// Jres Proxy :ref:`configuration overview <config_network_filters_jres_proxy>`.

// [#next-free-field: 6]
message RouteConfiguration {
// The name of the route configuration. Reserved for future use in asynchronous route discovery.
string name = 1;

// The interface name of the service.
string interface = 2;

// Which group does the interface belong to.
string group = 3;

// The version number of the interface.
string version = 4;

// The list of routes that will be matched, in order, against incoming requests. The first route
// that matches will be used.
repeated Route routes = 5;
}

message Route {
// Route matching parameters.
RouteMatch match = 1 [(validate.rules).message = {required: true}];

// Route request to some upstream cluster.
RouteAction route = 2 [(validate.rules).message = {required: true}];
}

message RouteMatch {
// Method level routing matching.
MethodMatch method = 1;

// Specifies a set of headers that the route should match on. The router will check the request’s
// headers against all the specified headers in the route config. A match will happen if all the
// headers in the route are present in the request with the same values (or based on presence if
// the value field is not in the config).
repeated api.v2.route.HeaderMatcher headers = 2;
}

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.
api.v2.route.WeightedCluster weighted_clusters = 2;
}
}

message MethodMatch {
// The parameter matching type.
message ParameterMatchSpecifier {
oneof parameter_match_specifier {
// If specified, header match will be performed based on the value of the header.
string exact_match = 3;

// If specified, header match will be performed based on range.
// The rule will match if the request header value is within this range.
// The entire request header value must represent an integer in base 10 notation: consisting
// of an optional plus or minus sign followed by a sequence of digits. The rule will not match
// if the header value does not represent an integer. Match will fail for empty values,
// floating point numbers or if only a subsequence of the header value is an integer.
//
// Examples:
//
// * For range [-10,0), route will match for header value -1, but not for 0,
// "somestring", 10.9, "-1somestring"
type.Int64Range range_match = 4;
}
}

// The name of the method.
type.matcher.StringMatcher name = 1;

// Method parameter definition.
// The key is the parameter index, starting from 0.
// The value is the parameter matching type.
map<uint32, ParameterMatchSpecifier> params_match = 2;
}
12 changes: 12 additions & 0 deletions api/envoy/extensions/filters/network/jres_proxy/router/v3/BUILD
Original file line number Diff line number Diff line change
@@ -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 = [
"//envoy/config/filter/jres/router/v2alpha1:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

package envoy.extensions.filters.network.jres_proxy.router.v3;

import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";

option java_package = "io.envoyproxy.envoy.extensions.filters.network.jres_proxy.router.v3";
option java_outer_classname = "RouterProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Router]
// Jres router :ref:`configuration overview <config_jres_filters_router>`.

message Router {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.jres.router.v2alpha1.Router";
}
15 changes: 15 additions & 0 deletions api/envoy/extensions/filters/network/jres_proxy/v3/BUILD
Original file line number Diff line number Diff line change
@@ -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/config/filter/network/jres_proxy/v2alpha1:pkg",
"//envoy/config/route/v3:pkg",
"//envoy/type/matcher/v3:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Protocol buffer definitions for the Jres proxy.
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
syntax = "proto3";

package envoy.extensions.filters.network.jres_proxy.v3;

import "envoy/extensions/filters/network/jres_proxy/v3/route.proto";

import "google/protobuf/any.proto";

import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.extensions.filters.network.jres_proxy.v3";
option java_outer_classname = "JresProxyProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Jres Proxy]
// Jres Proxy :ref:`configuration overview <config_network_filters_jres_proxy>`.
// [#extension: envoy.filters.network.jres_proxy]

// Jres Protocol types supported by Envoy.
enum ProtocolType {
// the default protocol.
Jres = 0;
}

// Jres Serialization types supported by Envoy.
enum SerializationType {
// the default serialization protocol.
Hessian2 = 0;
}

// [#next-free-field: 6]
message JresProxy {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.network.jres_proxy.v2alpha1.JresProxy";

// The human readable prefix to use when emitting statistics.
string stat_prefix = 1 [(validate.rules).string = {min_len: 1}];

// Configure the protocol used.
ProtocolType protocol_type = 2 [(validate.rules).enum = {defined_only: true}];

// Configure the serialization protocol used.
SerializationType serialization_type = 3 [(validate.rules).enum = {defined_only: true}];

// The route table for the connection manager is static and is specified in this property.
repeated RouteConfiguration route_config = 4;

// A list of individual Jres filters that make up the filter chain for requests made to the
// Jres proxy. Order matters as the filters are processed sequentially. For backwards
// compatibility, if no jres_filters are specified, a default Jres router filter
// (`envoy.filters.jres.router`) is used.
repeated JresFilter jres_filters = 5;
}

// JresFilter configures a Jres filter.
message JresFilter {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.network.jres_proxy.v2alpha1.JresFilter";

// 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;
}
Loading

0 comments on commit a01dc87

Please sign in to comment.