golemcloud / golem

Golem is an open source durable computing platform that makes it easy to build and deploy highly reliable distributed systems.
https://learn.golem.cloud/
Apache License 2.0
530 stars 59 forks source link

Rethink or redesign about middlewares that can span across different protocols in API gateway #1069

Open afsalthaj opened 1 day ago

afsalthaj commented 1 day ago

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