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 <snowp@squareup.com>

Mirrored from https://github.com/envoyproxy/envoy @ a97e138ffc58c13dc5be277b877c6a5949083023
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 286a22138c
commit 4de1fc9f0f
  1. 8
      envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/BUILD
  2. 22
      envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/config.proto

@ -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"],
)

@ -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;
}
Loading…
Cancel
Save