From 48afc8df333217fdc41857becb60fc692a15b611 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Thu, 30 Jul 2020 19:15:30 +0000 Subject: [PATCH] Upstream Wasm proto from envoy-wasm. (#12159) Description: Upstream Wasm proto files from envoy-wasm. Risk Level: Low Testing: Unit tests in envoy-wasm, integration tests in istio/proxy. Docs Changes: N/A Release Notes: N/A Signed-off-by: John Plevyak Mirrored from https://github.com/envoyproxy/envoy @ 26eaa2e85cee69e5c32ab6bf4c5ae3d338fa462f --- BUILD | 3 ++ envoy/extensions/access_loggers/wasm/v3/BUILD | 12 +++++++ .../access_loggers/wasm/v3/wasm.proto | 20 +++++++++++ envoy/extensions/filters/http/wasm/v3/BUILD | 12 +++++++ .../filters/http/wasm/v3/wasm.proto | 20 +++++++++++ .../extensions/filters/network/wasm/v3/BUILD | 12 +++++++ .../filters/network/wasm/v3/wasm.proto | 20 +++++++++++ envoy/extensions/wasm/v3/wasm.proto | 35 ++++++++++++------- versioning/BUILD | 3 ++ 9 files changed, 125 insertions(+), 12 deletions(-) create mode 100644 envoy/extensions/access_loggers/wasm/v3/BUILD create mode 100644 envoy/extensions/access_loggers/wasm/v3/wasm.proto create mode 100644 envoy/extensions/filters/http/wasm/v3/BUILD create mode 100644 envoy/extensions/filters/http/wasm/v3/wasm.proto create mode 100644 envoy/extensions/filters/network/wasm/v3/BUILD create mode 100644 envoy/extensions/filters/network/wasm/v3/wasm.proto diff --git a/BUILD b/BUILD index 8c608fde..3ac2738e 100644 --- a/BUILD +++ b/BUILD @@ -154,6 +154,7 @@ proto_library( "//envoy/data/tap/v3:pkg", "//envoy/extensions/access_loggers/file/v3:pkg", "//envoy/extensions/access_loggers/grpc/v3:pkg", + "//envoy/extensions/access_loggers/wasm/v3:pkg", "//envoy/extensions/clusters/aggregate/v3:pkg", "//envoy/extensions/clusters/dynamic_forward_proxy/v3:pkg", "//envoy/extensions/clusters/redis/v3:pkg", @@ -195,6 +196,7 @@ proto_library( "//envoy/extensions/filters/http/router/v3:pkg", "//envoy/extensions/filters/http/squash/v3:pkg", "//envoy/extensions/filters/http/tap/v3:pkg", + "//envoy/extensions/filters/http/wasm/v3:pkg", "//envoy/extensions/filters/listener/http_inspector/v3:pkg", "//envoy/extensions/filters/listener/original_dst/v3:pkg", "//envoy/extensions/filters/listener/original_src/v3:pkg", @@ -221,6 +223,7 @@ proto_library( "//envoy/extensions/filters/network/tcp_proxy/v3:pkg", "//envoy/extensions/filters/network/thrift_proxy/filters/ratelimit/v3:pkg", "//envoy/extensions/filters/network/thrift_proxy/v3:pkg", + "//envoy/extensions/filters/network/wasm/v3:pkg", "//envoy/extensions/filters/network/zookeeper_proxy/v3:pkg", "//envoy/extensions/filters/udp/dns_filter/v3alpha:pkg", "//envoy/extensions/filters/udp/udp_proxy/v3:pkg", diff --git a/envoy/extensions/access_loggers/wasm/v3/BUILD b/envoy/extensions/access_loggers/wasm/v3/BUILD new file mode 100644 index 00000000..8bad369e --- /dev/null +++ b/envoy/extensions/access_loggers/wasm/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/extensions/wasm/v3:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/envoy/extensions/access_loggers/wasm/v3/wasm.proto b/envoy/extensions/access_loggers/wasm/v3/wasm.proto new file mode 100644 index 00000000..cd9db590 --- /dev/null +++ b/envoy/extensions/access_loggers/wasm/v3/wasm.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package envoy.extensions.access_loggers.wasm.v3; + +import "envoy/extensions/wasm/v3/wasm.proto"; + +import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.access_loggers.wasm.v3"; +option java_outer_classname = "WasmProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [[#not-implemented-hide:] +// Custom configuration for an :ref:`AccessLog ` +// that calls into a WASM VM. +message WasmAccessLog { + envoy.extensions.wasm.v3.PluginConfig config = 1; +} diff --git a/envoy/extensions/filters/http/wasm/v3/BUILD b/envoy/extensions/filters/http/wasm/v3/BUILD new file mode 100644 index 00000000..8bad369e --- /dev/null +++ b/envoy/extensions/filters/http/wasm/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/extensions/wasm/v3:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/envoy/extensions/filters/http/wasm/v3/wasm.proto b/envoy/extensions/filters/http/wasm/v3/wasm.proto new file mode 100644 index 00000000..a812992a --- /dev/null +++ b/envoy/extensions/filters/http/wasm/v3/wasm.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package envoy.extensions.filters.http.wasm.v3; + +import "envoy/extensions/wasm/v3/wasm.proto"; + +import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.http.wasm.v3"; +option java_outer_classname = "WasmProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [[#not-implemented-hide:] +message Wasm { + // General Plugin configuration. + envoy.extensions.wasm.v3.PluginConfig config = 1; +} diff --git a/envoy/extensions/filters/network/wasm/v3/BUILD b/envoy/extensions/filters/network/wasm/v3/BUILD new file mode 100644 index 00000000..8bad369e --- /dev/null +++ b/envoy/extensions/filters/network/wasm/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/extensions/wasm/v3:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/envoy/extensions/filters/network/wasm/v3/wasm.proto b/envoy/extensions/filters/network/wasm/v3/wasm.proto new file mode 100644 index 00000000..13158276 --- /dev/null +++ b/envoy/extensions/filters/network/wasm/v3/wasm.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package envoy.extensions.filters.network.wasm.v3; + +import "envoy/extensions/wasm/v3/wasm.proto"; + +import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.network.wasm.v3"; +option java_outer_classname = "WasmProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [[#not-implemented-hide:] +message Wasm { + // General Plugin configuration. + envoy.extensions.wasm.v3.PluginConfig config = 1; +} diff --git a/envoy/extensions/wasm/v3/wasm.proto b/envoy/extensions/wasm/v3/wasm.proto index 73b7959c..26f45821 100644 --- a/envoy/extensions/wasm/v3/wasm.proto +++ b/envoy/extensions/wasm/v3/wasm.proto @@ -15,11 +15,11 @@ option java_outer_classname = "WasmProto"; option java_multiple_files = true; option (udpa.annotations.file_status).package_version_status = ACTIVE; -// [#protodoc-title: Wasm service] +// [#protodoc-title: Wasm] +// [[#not-implemented-hide:] // Configuration for a Wasm VM. -// [#next-free-field: 6] -// [#not-implemented-hide:] pending implementation. +// [#next-free-field: 7] message VmConfig { // An ID which will be used along with a hash of the wasm code (or the name of the registered Null // VM plugin) to determine which VM will be used for the plugin. All plugins which use the same @@ -44,21 +44,26 @@ message VmConfig { // Warning: this should only be enable for trusted sources as the precompiled code is not // verified. bool allow_precompiled = 5; + + // If true and the code needs to be remotely fetched and it is not in the cache then NACK the configuration + // update and do a background fetch to fill the cache, otherwise fetch the code asynchronously and enter + // warming state. + bool nack_on_code_cache_miss = 6; } +// [[#not-implemented-hide:] // Base Configuration for Wasm Plugins e.g. filters and services. // [#next-free-field: 6] -// [#not-implemented-hide:] pending implementation. message PluginConfig { // A unique name for a filters/services in a VM for use in identifying the filter/service if - // multiple filters/services are handled by the same *vm_id* and *group_name* and for + // multiple filters/services are handled by the same *vm_id* and *root_id* and for // logging/debugging. string name = 1; // A unique ID for a set of filters/services in a VM which will share a RootContext and Contexts // if applicable (e.g. an Wasm HttpFilter and an Wasm AccessLog). If left blank, all - // filters/services with a blank group_name with the same *vm_id* will share Context(s). - string group_name = 2; + // filters/services with a blank root_id with the same *vm_id* will share Context(s). + string root_id = 2; // Configuration for finding or starting VM. oneof vm_config { @@ -71,13 +76,19 @@ message PluginConfig { // `google.protobuf.Struct` is serialized as JSON before // passing it to the plugin. `google.protobuf.BytesValue` and // `google.protobuf.StringValue` are passed directly without the wrapper. - google.protobuf.Any configuration = 5; + google.protobuf.Any configuration = 4; + + // If there is a fatal error on the VM (e.g. exception, abort(), on_start or on_configure return false), + // then all plugins associated with the VM will either fail closed (by default), e.g. by returning an HTTP 503 error, + // or fail open (if 'fail_open' is set to true) by bypassing the filter. Note: when on_start or on_configure return false + // during xDS updates the xDS configuration will be rejected and when on_start or on_configuration return false on initial + // startup the proxy will not start. + bool fail_open = 5; } -// WasmService is configured as a built-in *envoy.wasm_service* :ref:`ServiceConfig -// `. This opaque configuration will be used to -// create a Wasm Service. -// [#not-implemented-hide:] pending implementation. +// [[#not-implemented-hide:] +// WasmService is configured as a built-in *envoy.wasm_service* :ref:`WasmService +// ` This opaque configuration will be used to create a Wasm Service. message WasmService { // General plugin configuration. PluginConfig config = 1; diff --git a/versioning/BUILD b/versioning/BUILD index 305f09df..950594d7 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -37,6 +37,7 @@ proto_library( "//envoy/data/tap/v3:pkg", "//envoy/extensions/access_loggers/file/v3:pkg", "//envoy/extensions/access_loggers/grpc/v3:pkg", + "//envoy/extensions/access_loggers/wasm/v3:pkg", "//envoy/extensions/clusters/aggregate/v3:pkg", "//envoy/extensions/clusters/dynamic_forward_proxy/v3:pkg", "//envoy/extensions/clusters/redis/v3:pkg", @@ -78,6 +79,7 @@ proto_library( "//envoy/extensions/filters/http/router/v3:pkg", "//envoy/extensions/filters/http/squash/v3:pkg", "//envoy/extensions/filters/http/tap/v3:pkg", + "//envoy/extensions/filters/http/wasm/v3:pkg", "//envoy/extensions/filters/listener/http_inspector/v3:pkg", "//envoy/extensions/filters/listener/original_dst/v3:pkg", "//envoy/extensions/filters/listener/original_src/v3:pkg", @@ -104,6 +106,7 @@ proto_library( "//envoy/extensions/filters/network/tcp_proxy/v3:pkg", "//envoy/extensions/filters/network/thrift_proxy/filters/ratelimit/v3:pkg", "//envoy/extensions/filters/network/thrift_proxy/v3:pkg", + "//envoy/extensions/filters/network/wasm/v3:pkg", "//envoy/extensions/filters/network/zookeeper_proxy/v3:pkg", "//envoy/extensions/filters/udp/dns_filter/v3alpha:pkg", "//envoy/extensions/filters/udp/udp_proxy/v3:pkg",