Open
Description
Currently, auth is handled with Client/ServerInterceptor
s and that of course works. But this has a number of pitfalls:
- It requires you to call
send
/receive
on the correctEventLoop
(that could actually be fixed) - It requires you to call the
send
/receive
s in the order you got called. That means for async auth you will need to manually buffer! (see for example this user's illegal state issue: https://stackoverflow.com/questions/76534719/eventloopfuture-causing-invalid-state-unable-to-write-message/76535053#76535053 as well as Forwarding intecepted calls in an async callback #1181 (comment))
Basically it's way too hard to get this right for something that many/most(?) people will need.
I think gRPC should provide a very straightforward async throws
hook that gets to see the headers and is then allowed to mutate/accept/reject them. This is both important for clients (which may want to add a token) and servers (which may want to validate a token).