tap transport: refactor to use common tap framework (#5724)
This commit refactors the tap transport socket to use the common tap extension configuration and tap matching infrastructure. More match conditions will be added in a future PR as well as additional cleanups that have been marked with TODOs. One result of this PR is that the HTTP tap filter can now have a static configuration as well as write to a file per tap sink. All future tap PRs should be smaller and more targeted after this one. Signed-off-by: Matt Klein <mklein@lyft.com> Mirrored from https://github.com/envoyproxy/envoy @ f37ebdc14f4c0adf0e90aabddae833355c0cec1bpull/620/head
parent
2a5be83a3e
commit
1df7f3ad16
14 changed files with 97 additions and 55 deletions
@ -0,0 +1,12 @@ |
||||
load("//bazel:api_build_system.bzl", "api_proto_library_internal") |
||||
|
||||
licenses(["notice"]) # Apache 2 |
||||
|
||||
api_proto_library_internal( |
||||
name = "common", |
||||
srcs = ["common.proto"], |
||||
visibility = ["//visibility:public"], |
||||
deps = [ |
||||
"//envoy/service/tap/v2alpha:common", |
||||
], |
||||
) |
@ -0,0 +1,32 @@ |
||||
syntax = "proto3"; |
||||
|
||||
import "envoy/service/tap/v2alpha/common.proto"; |
||||
|
||||
import "validate/validate.proto"; |
||||
|
||||
package envoy.config.common.tap.v2alpha; |
||||
option java_package = "io.envoyproxy.envoy.service.tap.v2alpha"; |
||||
|
||||
// [#protodoc-title: Common tap extension configuration] |
||||
|
||||
// Common configuration for all tap extensions. |
||||
message CommonExtensionConfig { |
||||
oneof config_type { |
||||
option (validate.required) = true; |
||||
|
||||
// If specified, the tap filter will be configured via an admin handler. |
||||
AdminConfig admin_config = 1; |
||||
|
||||
// If specified, the tap filter will be configured via a static configuration that cannot be |
||||
// changed. |
||||
service.tap.v2alpha.TapConfig static_config = 2; |
||||
} |
||||
} |
||||
|
||||
// Configuration for the admin handler. See :ref:`here <config_http_filters_tap_admin_handler>` for |
||||
// more information. |
||||
message AdminConfig { |
||||
// Opaque configuration ID. When requests are made to the admin handler, the passed opaque ID is |
||||
// matched to the configured filter opaque ID to determine which filter to configure. |
||||
string config_id = 1 [(validate.rules).string.min_bytes = 1]; |
||||
} |
Loading…
Reference in new issue