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

reconcile grpcui cmd-line options with grpcurl #163

Merged
merged 1 commit into from Feb 11, 2022
Merged

Conversation

jhump
Copy link
Contributor

@jhump jhump commented Feb 11, 2022

This adds several command-line options to grpcui that are already available in grpcurl:

  • -H, -rpc-header: These allow adding extra metadata to all requests, in addition to what the user enters in the web form UI. The difference is that -H headers will also be added to reflection requests.
  • -expand-headers: This allows for safe use of secrets in metadata by putting them in environment variables instead of on the command-line
  • -use-reflection: This allows using both server reflection and proto sources, which can be useful to add extra descriptors that the server may not know about for resolving extensions and google.protobuf.Any messages.

This also adds a new, related option:

  • -preserve-header: This allows for propagating headers from the invocation request (which could include headers added by a client/browser/user agent as well as proxies in between the client and the grpcui server) to request metadata on the invoked RPC.

Finally, this PR fixes the HTTP response output when using the -vvv "very very verbose" log output. Before this change, binary data is written to the output as raw bytes. When the output is a terminal, this can cause undesirable behavior since some sequences of raw bytes may be interpreted as control/escape sequences. Now, binary output for HTTP responses is encoded in hex.

Fixes #111 and #126.
This should also help with #99.

… -expand-header, and -use-reflection options

- also adds -preserve-header option
- also updates -vvv output for binary HTTP responses to use hex-encoding
@jhump jhump merged commit 3da5e70 into master Feb 11, 2022
@jhump jhump deleted the jh/new-features branch February 11, 2022 17:10
@jhump jhump restored the jh/new-features branch February 11, 2022 20:17
@jhump jhump deleted the jh/new-features branch February 11, 2022 20:18
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.

Use -default-header values during reflection call
1 participant