grpc-json: add support for ignoring unknown query parameters (#7691)

* grpc-json: add support for ignoring unknown query parameters

Current behavior is not to transcode a request that contains a query parameter
that cannot be mapped. In cases where there is a specific set of parameters to
ignore one can use ignored_query_parameters. If there is a proxy or client
adding query parameters that one cannot control this won't work and the
transcoder becomes useless. ignore_unknown_query_parameters solves this problem.

Risk Level: low to medium
Testing: Added a unit test for the transcoder.
Tested manually, locally.
Docs Changes:
Added field description in api/envoy/config/filter/http/transcoder/v2/transcoder.proto
Release Notes:

Signed-off-by: Neri Marschik <codesuki@users.noreply.github.com>

Mirrored from https://github.com/envoyproxy/envoy @ 6af53be976c79a2b51a3f55825b722b58686c8a0
pull/620/head
data-plane-api(CircleCI) 5 years ago
parent 50c3a81070
commit 53b54e4c53
  1. 6
      envoy/config/filter/http/transcoder/v2/transcoder.proto

@ -114,4 +114,10 @@ message GrpcJsonTranscoder {
// The client could ``post`` a json body ``{"shelf": 1234}`` with the path of // The client could ``post`` a json body ``{"shelf": 1234}`` with the path of
// ``/bookstore.Bookstore/GetShelfRequest`` to call ``GetShelfRequest``. // ``/bookstore.Bookstore/GetShelfRequest`` to call ``GetShelfRequest``.
bool auto_mapping = 7; bool auto_mapping = 7;
// Whether to ignore query parameters that cannot be mapped to a corresponding
// protobuf field. Use this if you cannot control the query parameters and do
// not know them beforehand. Otherwise use ``ignored_query_parameters``.
// Defaults to false.
bool ignore_unknown_query_parameters = 8;
} }

Loading…
Cancel
Save