Skip to content
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

grpc-json: preserve request method in x-envoy-original-method header #11126

Merged
merged 9 commits into from
Jun 2, 2020
Merged

grpc-json: preserve request method in x-envoy-original-method header #11126

merged 9 commits into from
Jun 2, 2020

Conversation

JavaScriptBach
Copy link
Contributor

@JavaScriptBach JavaScriptBach commented May 10, 2020

Commit Message: grpc-json: preserve http request method in x-envoy-original-method header so that applications have access to it.
Additional Description: The grpc-json transcoder currently forwards HTTP path to applications via "x-envoy-original-path" header. We would find it useful if it also forwarded the HTTP method.
Risk Level: Low
Testing: Updated grpc-json-transcoder unit tests
Docs Changes: Added docs
Release Notes: Added release notes

@JavaScriptBach JavaScriptBach requested a review from lizan as a code owner May 10, 2020 04:20
@@ -293,6 +293,7 @@ class HeaderEntry {
HEADER_FUNC(EnvoyRetryGrpcOn) \
HEADER_FUNC(EnvoyRetriableStatusCodes) \
HEADER_FUNC(EnvoyRetriableHeaderNames) \
HEADER_FUNC(EnvoyOriginalMethod) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive by: please don't add this to the O(1) header map, as it only needs to be set.

Also, this change will need documentation and release notes. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. Could you point out where you would like to see the documentation? I could not find any prior mention of headers in https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_json_transcoder_filter. Should I create a section there anyway?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think documenting this within the filter config docs would be fine for now. Thank you!

Phillip Huang added 3 commits May 11, 2020 14:24
@JavaScriptBach JavaScriptBach changed the title router: add x-envoy-original-method header and use in grpc-json transcoder grpc-json: preserve request method in x-envoy-original-method header May 11, 2020
Signed-off-by: Phillip Huang <[email protected]>
@@ -87,6 +87,15 @@ can be send by the gRPC server in the server streaming case.
In this case, HTTP response header `Content-Type` will use the `content-type` from the first
`google.api.HttpBody <https://github.com/googleapis/googleapis/blob/master/google/api/httpbody.proto>`.

Metadata
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's call this header. Metadata is confusing with dynamic metadata

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Can you review again?

@stale
Copy link

stale bot commented May 30, 2020

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label May 30, 2020
@lizan
Copy link
Member

lizan commented Jun 1, 2020

Can you merge master and resolve conflicts? Then we can merge this. Thank you!

@stale stale bot removed the stale stalebot believes this issue/PR has not been touched recently label Jun 1, 2020
Phillip Huang added 3 commits June 1, 2020 11:36
Signed-off-by: Phillip Huang <[email protected]>
Signed-off-by: Phillip Huang <[email protected]>
@JavaScriptBach
Copy link
Contributor Author

Can you merge master and resolve conflicts? Then we can merge this. Thank you!

Done. Thank you!

@lizan lizan merged commit 6a69cc5 into envoyproxy:master Jun 2, 2020
@JavaScriptBach JavaScriptBach deleted the envoy-original-method branch June 3, 2020 06:25
auni53 pushed a commit to auni53/envoy that referenced this pull request Jun 4, 2020
…nvoyproxy#11126)

Commit Message: grpc-json: preserve http request method in `x-envoy-original-method` header so that applications have access to it.
Additional Description: The grpc-json transcoder currently forwards HTTP path to applications via "x-envoy-original-path" header. We would find it useful if it also forwarded the HTTP method.
Risk Level: Low
Testing: Updated grpc-json-transcoder unit tests
Docs Changes: Added docs
Release Notes: Added release notes

Signed-off-by: Phillip Huang <[email protected]>

Signed-off-by: Auni Ahsan <[email protected]>
yashwant121 pushed a commit to yashwant121/envoy that referenced this pull request Jul 24, 2020
…nvoyproxy#11126)

Commit Message: grpc-json: preserve http request method in `x-envoy-original-method` header so that applications have access to it.
Additional Description: The grpc-json transcoder currently forwards HTTP path to applications via "x-envoy-original-path" header. We would find it useful if it also forwarded the HTTP method.
Risk Level: Low
Testing: Updated grpc-json-transcoder unit tests
Docs Changes: Added docs
Release Notes: Added release notes

Signed-off-by: Phillip Huang <[email protected]>
Signed-off-by: yashwant121 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants