Page MenuHomePhabricator

[identity] enable grpc-web on identity service
ClosedPublic

Authored by varun on Mar 29 2023, 3:10 PM.
Tags
None
Referenced Files
F3643645: D7244.id24391.diff
Sat, Jan 4, 5:33 PM
F3643152: D7244.id24356.diff
Sat, Jan 4, 4:58 PM
F3643118: D7244.id24349.diff
Sat, Jan 4, 4:52 PM
Unknown Object (File)
Fri, Jan 3, 9:16 AM
Unknown Object (File)
Thu, Jan 2, 10:24 AM
Unknown Object (File)
Tue, Dec 31, 4:09 AM
Unknown Object (File)
Tue, Dec 31, 4:09 AM
Unknown Object (File)
Tue, Dec 31, 4:09 AM
Subscribers

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable