Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tonic-reflection: 🆕 use
v1
reflection protobuffer definitions
this fixes hyperium#1685. in penumbra-zone/penumbra#4392, we observed that tonic servers do not properly support reflection when servicing a request sent by recent versions of [`grpcurl`], after [v1.8.8] began using `grpc.reflection.v1.ServerReflection`. (see fullstorydev/grpcurl#407) these lead to an error regarding an unexpected status code, like this: ``` ❯ grpcurl --version grpcurl v1.9.1 ❯ grpcurl -vv grpc.testnet.penumbra.zone:443 list Failed to list services: rpc error: code = Unknown desc = unexpected HTTP status code received from server: 405 (Method Not Allowed); malformed header: missing HTTP content-type ``` this adds the v1 reflection definition to `tonic-reflection`, which was observed as fixing these issues for our gRPC endpoint. ### 🩹 changes changes in this commet are as follows: * vendors the `v1` definition of [`reflection.proto`][proto]. * renames the (deprecated) `v1alpha` definition to `reflection_v1alpha.proto`. * `tonic_reflection::generated::grpc_reflection_v1` links to the generated Rust code (created by running `cargo run --package codegen`). * `tonic_reflection::generated::FILE_DESCRIPTOR_SET` is replaced by `tonic_reflection::generated::{FILE_DESCRIPTOR_SET_V1ALPHA, FILE_DESCRIPTOR_SET_V1}`. * `tonic_reflection::pb` now contains namespaced `tonic_reflection::pb::{v1alpha, v1}` submodules. (**NB: this is a breaking change to the public `tonic-reflection` API.**) * `tonic_reflection::server` is updated to use the generated `tonic_reflection::pb::v1` code. [v1.8.8]: https://github.com/fullstorydev/grpcurl/releases/tag/v1.8.8 [proto]: https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1/reflection.proto [grpcurl]: https://github.com/fullstorydev/grpcurl --- fixes: hyperium#1685 x-ref: penumbra-zone/penumbra#4392 co-authored-by: Conor Schaefer <[email protected]>
- Loading branch information