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
Have you looked at this example which does passes the HTTP headers to the RPC middleware stuff.
But you are right that it won't work with server builder API instead you have to utilize the "low-level API" and use jsonrpsee as as tower service and start the hyper server yourself.
Another example how we are using it in substrate to disable/enable rpc rate limiting middleware...
This is a bit mindbending. Do I understand correctly that the approach here is to create an rpc service for every http connection, kinda?
Yes, if you want some state from HTTP request itself such as headers then it's only possible to utilize it by creating a rpc service per connection.
So I get that it's quite tricky to use/understand but that's the trade-off right because we didn't want to introduce any additional custom middleware stuff in jsonrpsee and clone stuff that may not used by users....
I might have missed something, but I don't see a way to pass anything from http middlware to rpc middleware/handler.
I'd like to do authorization over http request, and then depending on the result possibly each rpc would enable/disable certain things etc.
Conceptually it's easy, but there seem to be nothing the two layers together, so it can't be done.
The text was updated successfully, but these errors were encountered: