I tried to come up with one, but I guess we might need to go with actual type parameterization making it as distinct as possible instead of a sum type of different middlewares. This should end up having a collection of middlewares corresponding to just 1 protocol rather than a mix of them.
I thought it was an easy step to do it as part of worker-authentication work, but it looks like the root cause is the input request to gateway itself is a sum type of different types of requests (ex: HTTP, Grpc), and we might need to get away from it.
This is not a huge blocker. However fixing this is important as we will end up with less number of conditions and iterations in hot path
I tried to come up with one, but I guess we might need to go with actual type parameterization making it as distinct as possible instead of a sum type of different middlewares. This should end up having a collection of middlewares corresponding to just 1 protocol rather than a mix of them.
I thought it was an easy step to do it as part of worker-authentication work, but it looks like the root cause is the input request to gateway itself is a sum type of different types of requests (ex: HTTP, Grpc), and we might need to get away from it.
This is not a huge blocker. However fixing this is important as we will end up with less number of conditions and iterations in hot path