Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Envoy's L7 Go extension API #22573

Merged
merged 119 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
7a45ea5
Merge pull request #1 from envoyproxy/master
wangfakang Apr 22, 2020
1335354
Merge pull request #2 from envoyproxy/master
wangfakang Aug 11, 2020
446c4b1
Merge pull request #3 from envoyproxy/master
wangfakang Sep 5, 2020
8e7d66a
Merge pull request #4 from envoyproxy/master
wangfakang Sep 11, 2020
7d72ab9
Merge pull request #5 from envoyproxy/master
wangfakang Oct 20, 2020
dd0dba9
Merge pull request #6 from envoyproxy/master
wangfakang Jan 10, 2021
091fd77
Merge pull request #7 from envoyproxy/main
wangfakang Jan 30, 2021
d9dcf64
Merge pull request #8 from envoyproxy/main
wangfakang Jan 31, 2021
95c509b
Merge pull request #9 from envoyproxy/main
wangfakang Mar 31, 2021
1c5859a
Merge pull request #20 from envoyproxy/main
wangfakang Apr 14, 2021
e272f6a
Merge pull request #59 from envoyproxy/main
wangfakang May 17, 2021
0f77a38
Merge pull request #71 from envoyproxy/main
wangfakang May 19, 2021
d05e4cf
Merge pull request #72 from envoyproxy/main
wangfakang May 21, 2021
023d3a9
Merge pull request #74 from envoyproxy/main
wangfakang May 24, 2021
d091174
Merge pull request #83 from envoyproxy/main
wangfakang May 28, 2021
4c88aad
Merge pull request #93 from envoyproxy/main
wangfakang Jun 2, 2021
1d788fe
Merge pull request #97 from envoyproxy/main
wangfakang Jun 8, 2021
4c68eb0
Merge branch 'envoyproxy:main' into master
wangfakang Jun 18, 2021
4dc847b
Merge pull request #108 from envoyproxy/main
wangfakang Jul 5, 2021
1a620b6
Merge pull request #117 from envoyproxy/main
wangfakang Jul 9, 2021
4bd041e
Merge branch 'envoyproxy:main' into master
wangfakang Jul 17, 2021
5318196
Merge pull request #133 from envoyproxy/main
wangfakang Jul 28, 2021
88d279f
Merge pull request #154 from envoyproxy/main
wangfakang Sep 6, 2021
0c677c3
Merge pull request #166 from envoyproxy/main
wangfakang Sep 9, 2021
23a9ba3
Merge pull request #169 from envoyproxy/main
wangfakang Sep 10, 2021
ce02fd8
Merge pull request #170 from envoyproxy/main
wangfakang Sep 13, 2021
755b023
Merge pull request #194 from envoyproxy/main
wangfakang Oct 11, 2021
df47643
Merge pull request #216 from envoyproxy/main
wangfakang Nov 2, 2021
0886f78
Merge pull request #229 from envoyproxy/main
wangfakang Nov 19, 2021
6bb0267
Merge pull request #237 from envoyproxy/main
wangfakang Dec 3, 2021
68ee9d3
Merge pull request #240 from envoyproxy/main
wangfakang Dec 9, 2021
b99b024
Merge branch 'envoyproxy:main' into master
wangfakang Dec 20, 2021
2569f89
Merge pull request #256 from envoyproxy/main
wangfakang Dec 28, 2021
743011e
Merge branch 'envoyproxy:main' into master
wangfakang Jan 11, 2022
ab72745
Merge pull request #277 from envoyproxy/main
wangfakang Jan 25, 2022
84955d8
Merge pull request #289 from envoyproxy/main
wangfakang Feb 8, 2022
74e0878
Merge pull request #296 from envoyproxy/main
wangfakang Feb 15, 2022
0859ead
Merge pull request #371 from envoyproxy/main
wangfakang May 30, 2022
f995b29
Merge pull request #395 from envoyproxy/main
wangfakang Jun 27, 2022
d4ab8e7
Merge branch 'envoyproxy:main' into master
wangfakang Jul 6, 2022
2f4343f
Merge branch 'envoyproxy:main' into master
wangfakang Jul 11, 2022
edd4cfe
Merge branch 'envoyproxy:main' into master
wangfakang Jul 21, 2022
02f2d17
add dso api for specialized functionality into Envoy dynamically at r…
wangfakang Aug 5, 2022
121aec7
add go extension filter config api.
wangfakang Aug 5, 2022
c003e89
add go plugin api.
wangfakang Aug 5, 2022
097a360
moved go plugin api to contrib dirctory.
wangfakang Aug 6, 2022
9499dbb
fix format typo.
wangfakang Aug 6, 2022
d24f1d0
Merge branch 'main' into golang-extension-api
wangfakang Sep 15, 2022
ba8b068
add some doc for dso api.
wangfakang Sep 21, 2022
2918b79
Merge the DSO functionality into the Go filter.
wangfakang Oct 31, 2022
8107dbd
add samples go filter ref.
wangfakang Oct 31, 2022
be380d3
modify api version from v3 to v3alpha.
wangfakang Nov 1, 2022
eeda2e9
Adds a golang filter example.
wangfakang Nov 10, 2022
8490425
fix Permission issue.
wangfakang Nov 10, 2022
0c00e27
remove some useless files.
wangfakang Nov 10, 2022
6c3c20f
Use vendor mode to compile the examples and avoid pulling external co…
wangfakang Nov 11, 2022
95a40db
fix modernize-use-using issue.
wangfakang Nov 11, 2022
57ffc1c
remove vendor and make it completely self contained.
wangfakang Nov 14, 2022
137f150
add golang filter.
wangfakang Nov 16, 2022
74fe365
Merge branch 'envoyproxy:main' into master
wangfakang Nov 17, 2022
5c4f719
add go extension filter implementation.
wangfakang Nov 22, 2022
6533a5a
update go extension examples.
wangfakang Nov 22, 2022
8b33b9e
update some comment for go extension proto.
wangfakang Nov 22, 2022
82f9753
remove useless files.
wangfakang Nov 22, 2022
deea158
fix envoy yaml for golang example.
wangfakang Nov 22, 2022
6aea9da
update bazel files for build golang extension.
wangfakang Nov 22, 2022
9b10755
add docs for golang extension filter.
wangfakang Nov 22, 2022
95ebef5
Merge branch 'envoyproxy:main' into master
wangfakang Nov 23, 2022
8cee369
fix build typo.
wangfakang Nov 23, 2022
1b8bd75
fix style.
wangfakang Nov 23, 2022
a250351
fix code typo.
wangfakang Nov 23, 2022
2fac8bb
delete golang sandboxes temporarily, later it will be submitted in an…
wangfakang Nov 23, 2022
96ab6c4
fix doc typo.
wangfakang Nov 23, 2022
621b9bd
fix typo by bazel.clang_tidy.
wangfakang Nov 23, 2022
17fd6c2
fix typo.
wangfakang Nov 23, 2022
181d00e
clear route cache when headers changed.
wangfakang Nov 24, 2022
2236944
Merge branch 'envoyproxy:main' into master
wangfakang Nov 29, 2022
48920e4
Merge branch 'envoyproxy:main' into master
wangfakang Nov 30, 2022
9312170
update some files for clean.
wangfakang Nov 30, 2022
f44ca44
add integration tests for golang filter.
wangfakang Nov 30, 2022
a2f78ef
add integration tests for passthrough go filter.
wangfakang Nov 30, 2022
b36a902
add example for extension_plugin_options.
wangfakang Dec 2, 2022
1d0c509
add some comments and avoid use raw memeroy etc, thanks @mattklein123.
wangfakang Dec 2, 2022
b29b4a8
Merge branch 'envoyproxy:main' into master
wangfakang Dec 2, 2022
1b03764
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang Dec 2, 2022
a126daa
fix Filter1XXHeaderStatus for golang extension.
wangfakang Dec 2, 2022
31e210b
fix example path of echo.
wangfakang Dec 3, 2022
cfd5ce3
make go extension api fully typed, thanks @mattklein123.
wangfakang Dec 3, 2022
8bd8b93
Merge branch 'envoyproxy:main' into master
wangfakang Dec 3, 2022
29a8b5c
remove unused struct.proto for golang.proto.
wangfakang Dec 3, 2022
66258bb
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang Dec 3, 2022
7cc9391
Update contrib/golang/filters/http/source/common/dso/dso.h
wangfakang Dec 6, 2022
41186b7
Update contrib/golang/filters/http/source/common/dso/dso.h
wangfakang Dec 6, 2022
2ea7100
improve the code via ABSL_EXCLUSIVE_LOCKS and MUTABLE_CONSTRUCT_ON_FI…
wangfakang Dec 6, 2022
c063d61
fix typo and resolve some todo.
wangfakang Dec 6, 2022
a186eba
use NonCopyable instead of delete operation.
wangfakang Dec 7, 2022
ea51e0b
use struct to encapsulate dso and add ABSL_EXCLUSIVE_LOCKS_REQUIRED. …
wangfakang Dec 7, 2022
e0ecfc9
fix typo.
wangfakang Dec 7, 2022
1592489
Merge branch 'envoyproxy:main' into master
wangfakang Dec 7, 2022
1ca4641
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang Dec 7, 2022
5567bd5
add ABSL_GUARDED_BY for the members.thanks @mattklein123
wangfakang Dec 7, 2022
cef804a
cleanup useless code and add some comments for memcpy safe. thanks @m…
wangfakang Dec 9, 2022
e6b8ff4
Merge branch 'envoyproxy:main' into master
wangfakang Dec 9, 2022
9718071
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang Dec 9, 2022
d6c8ddb
Merge branch 'envoyproxy:main' into master
wangfakang Dec 9, 2022
babd11f
Merge branch 'envoyproxy:main' into master
wangfakang Dec 9, 2022
5cd3277
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang Dec 9, 2022
659e4a0
Update contrib/golang/filters/http/source/golang_filter.cc
wangfakang Dec 13, 2022
0060264
make code clear and update log level. thanks @mattklein123
wangfakang Dec 13, 2022
13766aa
update current.yaml for golang extension.
wangfakang Dec 13, 2022
b444671
Merge branch 'envoyproxy:main' into master
wangfakang Dec 13, 2022
95e9a1a
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang Dec 13, 2022
eb4d845
Merge branch 'envoyproxy:main' into master
wangfakang Dec 13, 2022
d047583
make code clear and update log level to debug. thanks @mattklein123
wangfakang Dec 13, 2022
91243de
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang Dec 13, 2022
cb4c14b
Merge branch 'envoyproxy:main' into master
wangfakang Dec 15, 2022
7b8a618
use assert to make the code clearer. thanks @mattklein123
wangfakang Dec 15, 2022
1a12ad8
Merge remote-tracking branch 'origin/master' into golang-extension-ap…
wangfakang Dec 15, 2022
6dbdb3a
remove all unused code. thanks @mattklein123
wangfakang Jan 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ proto_library(
visibility = ["//visibility:public"],
deps = [
"//contrib/envoy/extensions/filters/http/dynamo/v3:pkg",
"//contrib/envoy/extensions/filters/http/golang/v3alpha:pkg",
"//contrib/envoy/extensions/filters/http/language/v3alpha:pkg",
"//contrib/envoy/extensions/filters/http/squash/v3:pkg",
"//contrib/envoy/extensions/filters/http/sxg/v3alpha:pkg",
Expand Down
12 changes: 12 additions & 0 deletions api/contrib/envoy/extensions/filters/http/golang/v3alpha/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 = [
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@com_github_cncf_udpa//xds/annotations/v3:pkg",
],
)
214 changes: 214 additions & 0 deletions api/contrib/envoy/extensions/filters/http/golang/v3alpha/golang.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
syntax = "proto3";

package envoy.extensions.filters.http.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.http.golang.v3alpha";
option java_outer_classname = "GolangProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/golang/v3alpha";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (xds.annotations.v3.file_status).work_in_progress = true;

// [#protodoc-title: golang extension filter]
// Golang :ref:`configuration overview <config_http_filters_golang>`.
// [#extension: envoy.filters.http.golang]
//
// In the below example, we configured the go plugin 'auth' and 'limit' dynamic libraries into
// Envoy, which can avoid rebuilding Envoy.
//
// * Develop go-plugin
//
// We can implement the interface of ``StreamFilter <contrib/golang/filters/http/source/go/pkg/api.StreamFilter>``
// API by the GO language to achieve the effects of Envoy native filter.
//
// The filter based on the APIs implementation ``StreamFilter <contrib/golang/filters/http/source/go/pkg/api.StreamFilter>``
// For details, take a look at the :repo:`/contrib/golang/filters/http/test/test_data/echo`.
//
// Then put the GO plugin source code into the ${OUTPUT}/src/ directory with the name of the plugin
// for GO plugin builds.
// The following examples implement limit and auth GO plugins.
//
// .. code-block:: bash
//
// $ tree /home/admin/envoy/go-plugins/src/
// |--auth
// | |--config.go
// | |--filter.go
// ---limit
// |--config.go
// |--filter.go
//
// * Build go-plugin
//
// Build the Go plugin so by `go_plugin_generate.sh` script, below example the `liblimit.so` and
// `libauth.so` will be generated in the `/home/admin/envoy/go-plugins/` directory.
//
// .. code-block:: bash
//
// #!/bin/bash
// if [ $# != 2 ]; then
// echo "need input the go plugin name"
// exit 1
// fi
//
// PLUGINNAME=$1
// OUTPUT=/home/admin/envoy/go-plugins/
// PLUGINSRCDIR=${OUTPUT}/src/${PLUGINNAME}
// go build --buildmode=c-shared -v -o $OUTPUT/lib${PLUGINNAME}.so $PLUGINSRCDIR
//
// .. code-block:: bash
//
// $ go_plugin_generate.sh limit
// $ go_plugin_generate.sh auth
//
// * Configure go-plugin
//
// Use the http filter of :ref: `golang <envoy.filters.http.golang>` to specify
// :ref: `library` <envoy.filters.http.golang> in ingress and egress to enable the plugin.
//
// Example:
//
// .. code-block:: yaml
//
// static_resources:
// listeners:
// - name: ingress
// address:
// socket_address:
// protocol: TCP
// address: 0.0.0.0
// port_value: 8080
// filter_chains:
// - filters:
// - name: envoy.filters.network.http_connection_manager
// ......
// http_filters:
// - name: envoy.filters.http.golang
// typed_config:
// "@type": type.googleapis.com/envoy.extensions.filters.http.golang.v3alpha.Config
// library_id: limit-id
// library_path: "/home/admin/envoy/go-plugins/liblimit.so"
// plugine_name: limit
// plugin_config:
// "@type": type.googleapis.com/envoy.extensions.filters.http.golang.plugins.limit.v3.Config
// xxx1: xx1
// xxx2: xx2
// - name: envoy.filters.http.header_to_metadata
// - name: envoy.filters.http.golang
// typed_config:
// "@type": type.googleapis.com/envoy.extensions.filters.http.golang.v3alpha.Config
// library_id: auth-id
// library_path: "/home/admin/envoy/go-plugins/libauth.so"
// plugine_name: auth
// plugin_config:
// "@type": type.googleapis.com/envoy.extensions.filters.http.golang.plugins.auth.v3.Config
// xxx1: xx1
// xxx2: xx2
// - name: envoy.filters.http.router
// - name: egress
// address:
// socket_address:
// protocol: TCP
// address: 0.0.0.0
// port_value: 8081
// filter_chains:
// - filters:
// - name: envoy.filters.network.http_connection_manager
// ......
// http_filters:
// - name: envoy.filters.http.golang
// typed_config:
// "@type": type.googleapis.com/envoy.extensions.filters.http.golang.v3alpha.Config
// library_id: auth-id
// library_path: "/home/admin/envoy/go-plugins/libauth.so"
// plugine_name: auth
// plugin_config:
// "@type": type.googleapis.com/envoy.extensions.filters.http.golang.plugins.auth.v3.Config
// xxx1: xx1
// xxx2: xx2
// - name: envoy.filters.http.router
// [#next-free-field: 6]
message Config {
enum MergePolicy {
MERGE_VIRTUALHOST_ROUTER_FILTER = 0;
MERGE_VIRTUALHOST_ROUTER = 1;
OVERRIDE = 3;
}

// library_id is a unique ID for a dynamic library file, must be unique globally.
string library_id = 1 [(validate.rules).string = {min_len: 1}];

// Dynamic library implementing the interface of
// ``StreamFilter <contrib/golang/filters/http/source/go/pkg/api.StreamFilter>``.
// [#comment:TODO(wangfakang): Support for downloading libraries from remote repositories.]
string library_path = 2 [(validate.rules).string = {min_len: 1}];

// plugin_name is the name of the go plugin, which needs to be consistent with the name
// registered in http::RegisterHttpFilterConfigFactory.
string plugin_name = 3 [(validate.rules).string = {min_bytes: 1}];

// plugin_config is the configuration of the go plugin, note that this configuration is
// only parsed in the go plugin.
google.protobuf.Any plugin_config = 4;

// merge_policy is the merge policy configured by the go plugin.
// go plugin configuration supports three dimensions: the virtual host’s typed_per_filter_config,
// the route’s typed_per_filter_config or filter's config.
// The meanings are as follows:
// MERGE_VIRTUALHOST_ROUTER_FILTER: pass all configuration into go plugin.
// MERGE_VIRTUALHOST_ROUTER: pass Virtual-Host and Router configuration into go plugin.
// OVERRIDE: override according to Router > Virtual_host > Filter priority and pass the
// configuration to the go plugin.
MergePolicy merge_policy = 5 [(validate.rules).enum = {defined_only: true}];
}

message RouterPlugin {
// Example
//
// .. code-block:: yaml
//
// typed_per_filter_config:
// envoy.filters.http.golang:
// "@type": type.googleapis.com/envoy.extensions.filters.http.golang.v3alpha.ConfigsPerRoute
// plugins_config:
// plugin1:
// disabled: true
oneof override {
option (validate.required) = true;

// [#not-implemented-hide:]
// Disable the filter for this particular vhost or route.
// If disabled is specified in multiple per-filter-configs, the most specific one will be used.
bool disabled = 1 [(validate.rules).bool = {const: true}];

// The config field is used to setting per-route plugin config.
google.protobuf.Any config = 2;
}
}

message ConfigsPerRoute {
// plugins_config is the configuration of the go plugin at the per-router, and
// key is the name of the go plugin.
// Example
//
// .. code-block:: yaml
//
// typed_per_filter_config:
// envoy.filters.http.golang:
// "@type": type.googleapis.com/envoy.extensions.filters.http.golang.v3alpha.ConfigsPerRoute
// plugins_config:
// plugin1:
// disabled: true
// plugin2:
// config:
// "@type": type.googleapis.com/golang.http.plugin2
// xxx: xxx
map<string, RouterPlugin> plugins_config = 1;
}
1 change: 1 addition & 0 deletions api/versioning/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ proto_library(
deps = [
"//contrib/envoy/extensions/config/v3alpha:pkg",
"//contrib/envoy/extensions/filters/http/dynamo/v3:pkg",
"//contrib/envoy/extensions/filters/http/golang/v3alpha:pkg",
"//contrib/envoy/extensions/filters/http/language/v3alpha:pkg",
"//contrib/envoy/extensions/filters/http/squash/v3:pkg",
"//contrib/envoy/extensions/filters/http/sxg/v3alpha:pkg",
Expand Down
16 changes: 15 additions & 1 deletion bazel/dependency_imports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains", "regis
load("@com_google_cel_cpp//bazel:deps.bzl", "parser_deps")

# go version for rules_go
GO_VERSION = "1.17.5"
GO_VERSION = "1.18"

JQ_VERSION = "1.6"
YQ_VERSION = "4.24.4"
Expand Down Expand Up @@ -94,6 +94,20 @@ def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, y
# use_category = ["api"],
# source = "https://github.com/bufbuild/protoc-gen-validate/blob/v0.6.1/dependencies.bzl#L148-L153"
)
go_repository(
name = "org_golang_google_protobuf",
importpath = "google.golang.org/protobuf",
sum = "h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=",
version = "v1.28.1",
build_external = "external",
)
go_repository(
name = "com_github_cncf_xds_go",
importpath = "github.com/cncf/xds/go",
sum = "h1:B/lvg4tQ5hfFZd4V2hcSfFVfUvAK6GSFKxIIzwnkv8g=",
version = "v0.0.0-20220520190051-1e77728a1eaa",
build_external = "external",
)
go_repository(
name = "com_github_spf13_afero",
importpath = "github.com/spf13/afero",
Expand Down
1 change: 1 addition & 0 deletions bazel/exported_symbols.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
lua*;
envoyGoFilterHttp*;
};
3 changes: 3 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ new_features:
change: |
added :ref:`dubbo codec support <envoy_v3_api_msg_extensions.filters.network.generic_proxy.codecs.dubbo.v3.DubboCodecConfig>` to the
:ref:`generic_proxy filter <envoy_v3_api_msg_extensions.filters.network.generic_proxy.v3.GenericProxy>`.
- area: golang
change: |
added new :ref:`HTTP golang extension filter <config_http_filters_golang>`.
- area: custom response http filter
change: |
added :ref:`custom response http filter <config_http_filters_custom_response>` which adds the ability to customize responses sent to downstreams using local or remote sources.
Expand Down
1 change: 1 addition & 0 deletions contrib/contrib_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CONTRIB_EXTENSIONS = {
#

"envoy.filters.http.dynamo": "//contrib/dynamo/filters/http/source:config",
"envoy.filters.http.golang": "//contrib/golang/filters/http/source:config",
"envoy.filters.http.language": "//contrib/language/filters/http/source:config_lib",
"envoy.filters.http.squash": "//contrib/squash/filters/http/source:config",
"envoy.filters.http.sxg": "//contrib/sxg/filters/http/source:config",
Expand Down
5 changes: 5 additions & 0 deletions contrib/extensions_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ envoy.filters.http.dynamo:
- envoy.filters.http
security_posture: requires_trusted_downstream_and_upstream
status: stable
envoy.filters.http.golang:
categories:
- envoy.filters.http
security_posture: requires_trusted_downstream_and_upstream
status: alpha
envoy.filters.http.squash:
categories:
- envoy.filters.http
Expand Down
79 changes: 79 additions & 0 deletions contrib/golang/filters/http/source/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_contrib_extension",
"envoy_cc_library",
"envoy_contrib_package",
)

licenses(["notice"]) # Apache 2

# Golang extensions filter.
# Public docs: https://envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/golang_filter

envoy_contrib_package()

envoy_cc_library(
name = "golang_filter_lib",
srcs = [
"golang_filter.cc",
"processor_state.cc",
],
hdrs = [
"golang_filter.h",
"processor_state.h",
],
deps = [
":cgo",
"//contrib/golang/filters/http/source/common/dso:dso_lib",
"//envoy/http:codes_interface",
"//envoy/http:filter_interface",
"//source/common/buffer:watermark_buffer_lib",
"//source/common/common:enum_to_int",
"//source/common/common:linked_object",
"//source/common/common:thread_lib",
"//source/common/common:utility_lib",
"//source/common/grpc:context_lib",
"//source/common/http:headers_lib",
"//source/common/http:utility_lib",
"//source/common/http/http1:codec_lib",
"@envoy_api//contrib/envoy/extensions/filters/http/golang/v3alpha:pkg_cc_proto",
],
)

envoy_cc_contrib_extension(
name = "config",
srcs = ["config.cc"],
hdrs = ["config.h"],
deps = [
":golang_filter_lib",
"//contrib/golang/filters/http/source/common/dso:dso_lib",
"//envoy/registry",
"//envoy/server:filter_config_interface",
"//envoy/server:lifecycle_notifier_interface",
"//source/extensions/filters/http/common:factory_base_lib",
"@envoy_api//contrib/envoy/extensions/filters/http/golang/v3alpha:pkg_cc_proto",
],
)

envoy_cc_library(
name = "cgo",
srcs = ["cgo.cc"],
hdrs = [
"golang_filter.h",
"processor_state.h",
],
deps = [
"//contrib/golang/filters/http/source/common/dso:dso_lib",
"//envoy/http:codes_interface",
"//envoy/http:filter_interface",
"//source/common/buffer:watermark_buffer_lib",
"//source/common/common:enum_to_int",
"//source/common/common:linked_object",
"//source/common/common:utility_lib",
"//source/common/grpc:context_lib",
"//source/common/http:headers_lib",
"//source/common/http:utility_lib",
"//source/common/http/http1:codec_lib",
"@envoy_api//contrib/envoy/extensions/filters/http/golang/v3alpha:pkg_cc_proto",
],
)
Loading