From 2a14562cebf80bcea0c135834602ae1981269c2a Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Fri, 1 Sep 2023 06:46:30 +0000 Subject: [PATCH] golang: L4 network extension (#26173) Signed-off-by: yongjie.yyj Mirrored from https://github.com/envoyproxy/envoy @ 63d4fb0c442d6362bcf5101fc2a5279aeaef31bb --- BUILD | 1 + .../filters/http/golang/v3alpha/golang.proto | 8 +-- .../filters/network/golang/v3alpha/BUILD | 12 +++++ .../network/golang/v3alpha/golang.proto | 54 +++++++++++++++++++ versioning/BUILD | 1 + 5 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 contrib/envoy/extensions/filters/network/golang/v3alpha/BUILD create mode 100644 contrib/envoy/extensions/filters/network/golang/v3alpha/golang.proto diff --git a/BUILD b/BUILD index 915c7bce..d384bf90 100644 --- a/BUILD +++ b/BUILD @@ -83,6 +83,7 @@ proto_library( "//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/golang/v3alpha: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", diff --git a/contrib/envoy/extensions/filters/http/golang/v3alpha/golang.proto b/contrib/envoy/extensions/filters/http/golang/v3alpha/golang.proto index 01aa4cec..ee1268a2 100644 --- a/contrib/envoy/extensions/filters/http/golang/v3alpha/golang.proto +++ b/contrib/envoy/extensions/filters/http/golang/v3alpha/golang.proto @@ -16,9 +16,9 @@ option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/fil option (udpa.annotations.file_status).package_version_status = ACTIVE; option (xds.annotations.v3.file_status).work_in_progress = true; -// [#protodoc-title: Golang] +// [#protodoc-title: Golang HTTP filter] // -// For an overview of the Golang filter please see the :ref:`configuration reference documentation `. +// For an overview of the Golang HTTP filter please see the :ref:`configuration reference documentation `. // [#extension: envoy.filters.http.golang] // [#next-free-field: 6] @@ -40,7 +40,7 @@ message Config { string library_id = 1 [(validate.rules).string = {min_len: 1}]; // Path to a dynamic library implementing the - // :repo:`StreamFilter API ` + // :repo:`StreamFilter API ` // interface. // [#comment:TODO(wangfakang): Support for downloading libraries from remote repositories.] string library_path = 2 [(validate.rules).string = {min_len: 1}]; @@ -59,7 +59,7 @@ message Config { // This configuration is only parsed in the go plugin, and is therefore not validated // by Envoy. // - // See the :repo:`StreamFilter API ` + // See the :repo:`StreamFilter API ` // for more information about how the plugin's configuration data can be accessed. // google.protobuf.Any plugin_config = 4; diff --git a/contrib/envoy/extensions/filters/network/golang/v3alpha/BUILD b/contrib/envoy/extensions/filters/network/golang/v3alpha/BUILD new file mode 100644 index 00000000..ec1e778e --- /dev/null +++ b/contrib/envoy/extensions/filters/network/golang/v3alpha/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/golang/v3alpha/golang.proto b/contrib/envoy/extensions/filters/network/golang/v3alpha/golang.proto new file mode 100644 index 00000000..f1051bc1 --- /dev/null +++ b/contrib/envoy/extensions/filters/network/golang/v3alpha/golang.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.golang.v3alpha; + +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.golang.v3alpha"; +option java_outer_classname = "GolangProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/golang/v3alpha"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; +option (xds.annotations.v3.file_status).work_in_progress = true; + +// [#protodoc-title: Golang network filter] +// +// Golang network filter :ref:`configuration overview `. +// [#extension: envoy.filters.network.golang] + +// [#next-free-field: 6] +message Config { + // Bool ``true`` if this filter must be the last filter in a filter chain, ``false`` otherwise. + bool is_terminal_filter = 1; + + // Globally unique ID for a dynamic library file. + string library_id = 2 [(validate.rules).string = {min_len: 1}]; + + // Path to a dynamic library implementing the + // :repo:`DownstreamFilter API ` + // interface. + // [#comment:TODO(wangfakang): Support for downloading libraries from remote repositories.] + string library_path = 3 [(validate.rules).string = {min_len: 1}]; + + // Globally unique name of the Go plugin. + // + // This name **must** be consistent with the name registered in ``network::RegisterNetworkFilterConfigFactory`` + // + string plugin_name = 4 [(validate.rules).string = {min_len: 1}]; + + // Configuration for the Go plugin. + // + // .. note:: + // This configuration is only parsed in the go plugin, and is therefore not validated + // by Envoy. + // + // See the :repo:`DownstreamFilter API ` + // for more information about how the plugin's configuration data can be accessed. + // + google.protobuf.Any plugin_config = 5; +} diff --git a/versioning/BUILD b/versioning/BUILD index 58405a71..250fb3bf 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -21,6 +21,7 @@ proto_library( "//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/golang/v3alpha: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",