grpc-json-transcoder: Add support for configuring unescaping behavior (#14009)

Functionality is implemented in grpc-ecosystem/grpc-httpjson-transcoding#45, add configuration options and wire them into filter.

The reasoning is provided in grpc-ecosystem/grpc-httpjson-transcoding#44.

Risk Level: Low
Testing: added unit test
Docs Changes: added proto docs
Release Notes: updated

Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>

Mirrored from https://github.com/envoyproxy/envoy @ 39e43e1abb45c96993f2df3323df12bc94937910
pull/623/head
data-plane-api(Azure Pipelines) 4 years ago
parent 17bb96ecd0
commit c182fa33e7
  1. 25
      envoy/extensions/filters/http/grpc_json_transcoder/v3/transcoder.proto

@ -15,11 +15,27 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// gRPC-JSON transcoder :ref:`configuration overview <config_http_filters_grpc_json_transcoder>`.
// [#extension: envoy.filters.http.grpc_json_transcoder]
// [#next-free-field: 10]
// [#next-free-field: 11]
message GrpcJsonTranscoder {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.http.transcoder.v2.GrpcJsonTranscoder";
enum UrlUnescapeSpec {
// URL path parameters will not decode RFC 6570 reserved characters.
// For example, segment `%2f%23/%20%2523` is unescaped to `%2f%23/ %23`.
ALL_CHARACTERS_EXCEPT_RESERVED = 0;
// URL path parameters will be fully URI-decoded except in
// cases of single segment matches in reserved expansion, where "%2F" will be
// left encoded.
// For example, segment `%2f%23/%20%2523` is unescaped to `%2f#/ %23`.
ALL_CHARACTERS_EXCEPT_SLASH = 1;
// URL path parameters will be fully URI-decoded.
// For example, segment `%2f%23/%20%2523` is unescaped to `/#/ %23`.
ALL_CHARACTERS = 2;
}
message PrintOptions {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.http.transcoder.v2.GrpcJsonTranscoder.PrintOptions";
@ -160,4 +176,11 @@ message GrpcJsonTranscoder {
// the ``google/rpc/error_details.proto`` should be included in the configured
// :ref:`proto descriptor set <config_grpc_json_generate_proto_descriptor_set>`.
bool convert_grpc_status = 9;
// URL unescaping policy.
// This spec is only applied when extracting variable with multiple segments.
// For example, in case of `/foo/{x=*}/bar/{y=prefix/*}/{z=**}` `x` variable is single segment and `y` and `z` are multiple segments.
// For a path with `/foo/first/bar/prefix/second/third/fourth`, `x=first`, `y=prefix/second`, `z=third/fourth`.
// If this setting is not specified, the value defaults to :ref:`ALL_CHARACTERS_EXCEPT_RESERVED<envoy_api_enum_value_extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder.UrlUnescapeSpec.ALL_CHARACTERS_EXCEPT_RESERVED>`.
UrlUnescapeSpec url_unescape_spec = 10 [(validate.rules).enum = {defined_only: true}];
}

Loading…
Cancel
Save