Comments (2)
@HT808s, I think this is a great idea. The only reason grpcurl
doesn't show it now was more-or-less pure oversight.
I think it will be a bit tricky though. The Details()
method of status won't be useful because it uses the default logic in github.com/golang/protobuf/ptypes
to unmarshal the Any
messages, which relies on linking generated code into the binary. Since grpcurl
does not link with any such generated code (except for the few google.protobuf
proto packages for descriptors and well-known types), you'll most likely just get a list of errors about not being able to resolve the actual message type.
So what I think is actually necessary follows:
- Get the underlying
google.protobuf.Any
messages for the details. - For each one, parse out the fully-qualified message name. Use the
DescriptorSource
to get descriptor details for that message type (this will ask the server via the reflection interface or look at local proto files). - If you can get a descriptor, then from there you can use functions in
github.com/jhump/protoreflect/dynamic
to unmarshal the message and then format it as JSON. - If you cannot get a descriptor, then I think we should just show the
String()
-ified proto or perhaps a custom JSON form that shows the@type
attribute but then also shows a@value
attribute as the base64-encoded binary value.
If you're still willing to tackle a PR, I'll review it. But I can also probably get to this sometime this week, maybe even later today.
from grpcurl.
@jhump Thanks for your detailed reply!
I am not familiar with the inner of proto messages unmarshaling so this was instructive!
It's fine by me if you want to tackle it!
from grpcurl.
Related Issues (20)
- With an UnaryResponse, OnReceiveResponse is never called HOT 1
- Fails to display response headers in case of "unexpected HTTP status code"
- Security Vulnerability: Update grpc version to at least 1.58.3 HOT 8
- Fail to inspect custom `gRPC` server HOT 2
- BUG - Failed to list methods for service "tamama.grpc.Tamama": Symbol not found: tamama.grpc.Tamama HOT 4
- `remote reset` error with 1.8.8 and higher HOT 1
- Wrong error message if a server requires client certificates
- Unix Domain Socket connection should use `localhost` authority header convention by default HOT 2
- Add the OpenSSF Scorecard Github Action HOT 1
- Attempts to install fail because of "missing do in first path element" HOT 2
- Cannot list methods of a service and make requests HOT 1
- Publish releases to winget HOT 1
- Possible to support other codec? HOT 1
- Server reflection fails when using well-known types (Timestamp) HOT 3
- Google Cloud Run producing `context deadline exceeded`
- protoset-out does not get namespace when using reflection HOT 5
- Create Process Failed to Run Issue HOT 1
- Include more output while connecting and reflecting with verbose mode
- Does grpcurl support pulling a client certificate from the OS X Keychain?
- How Do I invoke a grpc call which utilizes Bearer token as authorization HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpcurl.