From 4de1fc9f0fda58ced2763a4ba18e67b592887e4d Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Fri, 4 Jan 2019 17:05:18 +0000 Subject: [PATCH] extensions: add grpc_http1_reverse_bridge filter (#5315) Adds a filter that allows converting a gRPC request into an HTTP/1.1 request with a custom content-type. Allows a vanilla HTTP/1.1 upstream to handle incoming requests by reading and responding with protobuf messages in binary octet format. For now this shields the upstream from any gRPC association: the filter removes the gRPC specific message prefix and manages the conversion of the HTTP status code into grpc-status. Signed-off-by: Snow Pettersen Mirrored from https://github.com/envoyproxy/envoy @ a97e138ffc58c13dc5be277b877c6a5949083023 --- .../grpc_http1_reverse_bridge/v2alpha1/BUILD | 8 +++++++ .../v2alpha1/config.proto | 22 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/BUILD create mode 100644 envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/config.proto diff --git a/envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/BUILD b/envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/BUILD new file mode 100644 index 00000000..105a035b --- /dev/null +++ b/envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/BUILD @@ -0,0 +1,8 @@ +load("//bazel:api_build_system.bzl", "api_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "config", + srcs = ["config.proto"], +) diff --git a/envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/config.proto b/envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/config.proto new file mode 100644 index 00000000..5906ce57 --- /dev/null +++ b/envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/config.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package envoy.extensions.filter.http.grpc_http1_reverse_bridge.v2alpha1; +option java_package = "io.envoyproxy.envoy.extensions.filter.http.grpc_http1_reverse_bridge.v2alpha1"; +option java_multiple_files = true; +option go_package = "v2"; + +import "validate/validate.proto"; + +// [#protodoc-title: Extensions gRPC Http1 Reverse Bridge] +// gRPC reverse bridge filter configuration +message FilterConfig { + // The content-type to pass to the upstream when the gRPC bridge filter is applied. + // The filter will also validate that the upstream responds with the same content type. + string content_type = 1 [(validate.rules).string.min_bytes = 1]; + + // If true, Envoy will assume that the upstream doesn't understand gRPC frames and + // strip the gRPC frame from the request, and add it back in to the response. This will + // hide the gRPC semantics from the upstream, allowing it to receive and respond with a + // simple binary encoded protobuf. + bool withhold_grpc_frames = 2; +}