syntax = "proto3";

package envoy.config.filter.http.grpc_http1_reverse_bridge.v2alpha1;

import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.config.filter.http.grpc_http1_reverse_bridge.v2alpha1";
option java_outer_classname = "ConfigProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1";
option (udpa.annotations.file_migrate).move_to_package =
    "envoy.extensions.filters.http.grpc_http1_reverse_bridge.v3";
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: gRPC HTTP/1.1 Reverse Bridge]
// gRPC HTTP/1.1 Reverse Bridge :ref:`configuration overview
// <config_http_filters_grpc_http1_reverse_bridge>`.
// [#extension: envoy.filters.http.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;
}

// gRPC reverse bridge filter configuration per virtualhost/route/weighted-cluster level.
message FilterConfigPerRoute {
  // If true, disables gRPC reverse bridge 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;
}
