-
Notifications
You must be signed in to change notification settings - Fork 5.3k
grpc-json-transcoder: Add support for configuring unescaping behavior #14009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -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`. | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this interact with Envoy's existing path normalization controls? envoy/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto Line 493 in 4d77fc8
Keep in mind that we'e planning on making some changes here in the future #6589
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there may be overlap in the future with path normalization, but I can see how these would be used distinctly in a transcoder. |
||||
| 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}]; | ||||
| } | ||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,6 +134,11 @@ service Bookstore { | |
| get: "/bigbook" | ||
| }; | ||
| } | ||
| rpc PostWildcard(EchoBodyRequest) returns (google.protobuf.Empty) { | ||
| option (google.api.http) = { | ||
| post: "/wildcard/{arg=**}" | ||
| }; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if The logic will be if UrlUnescape_spec is default, check such
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can't be,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess the intention of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Thanks. |
||
| } | ||
| } | ||
|
|
||
| service ServiceWithResponseBody { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.