HomePhabricator
Diffusion Comm 855305de44d3

[identity] enable grpc-web on identity service

Description

[identity] enable grpc-web on identity service

Summary:
tonic_web::enable will apply a CORS default configuration, returning a tower_http::cors::Cors instance that works well with grpc-web clients out of the box.
However, the server builder's add_service method requires that the NamedService trait be implemented for its input, and tower_http::cors::Cors does not implement this trait.
To get around this, I've written a service wrapper that implements the Service and NamedService traits.

Test Plan: called generateNonce using normal grpc and grpc-web (BloomRPC supports both) and got back a nonce string

Reviewers: jon, bartek

Reviewed By: bartek

Subscribers: ashoat, tomek, atul

Differential Revision: https://phab.comm.dev/D7244

Details

Provenance
varunAuthored on Mar 29 2023, 2:45 PM
Reviewer
bartek
Differential Revision
D7244: [identity] enable grpc-web on identity service
Parents
rCOMM5cafc8dec1dd: [keyserver] Redirect to the right store depending on the user agent
Branches
Unknown
Tags
Unknown