You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add "context" (I am using quotes because I think this is a bad word) support within tonic's transport server. This should be done via a similar method that http::Request has an extenions with an AnyMap behind it. This way we can let the interceptor/or any other type of transport populate it, then let users get the "context" from request handlers. Then the transport module can expose newtypes that allow users to guarantee they are fetching the correct item from the anymap.
Once, we have this in place we can populate it with the peer addr and the tls config.
(sorry for the messy write up I am in a hurry :) )
The text was updated successfully, but these errors were encountered:
IIUC, this would allow implementors of a gRPC service (through the generated trait) to access this "context", for lack of a better term. So effectively, tonic's Request type would implement a mechanism similar to http's request extensions.
Given that interceptors currently receive http's Request type as argument, how would it work to read data from said "context" within them ? Would interceptors only serve as a way to populate the "context" and is it going to be necessary to move logging / access control / etc... to each function in the generated trait ?
Apart from that, can I help you with getting this done or is everything already in the works on your end ?
@Farenjihn Yeah, that is the idea, I am not sure yet how to mix and match http with its request extensions. I'd also like to find a better way to let users inject logging. My goal is to get 0.1 out by next week and I want to include these features.
I would like to add "context" (I am using quotes because I think this is a bad word) support within tonic's transport server. This should be done via a similar method that http::Request has an
extenions
with anAnyMap
behind it. This way we can let the interceptor/or any other type of transport populate it, then let users get the "context" from request handlers. Then thetransport
module can expose newtypes that allow users to guarantee they are fetching the correct item from the anymap.Once, we have this in place we can populate it with the peer addr and the tls config.
(sorry for the messy write up I am in a hurry :) )
The text was updated successfully, but these errors were encountered: