grpc-gateway icon indicating copy to clipboard operation
grpc-gateway copied to clipboard

Proxy to multiple servers and intercept data in gateway to check ACL

Open that-coder opened this issue 2 years ago • 4 comments

Hello world!

Is there any way to proxy to my different grpc services based on routes. At the same time, I wanna intercept request data in the gateway and validate my ACL logic and return if the user is not authenticated/ unauthorized.

if route=="/x/*"
  ACL business logic
  call grpc service x based on the route.
if route=="/y/*"
  acl business logic
  call grpc service x based on the route.

that-coder avatar Jul 27 '22 21:07 that-coder

This should be possible by implementing a http.Handler that does your ACL business logic, then dial and register separate gRPC services for each of your Protobuf services as usual.

johanbrandhorst avatar Jul 28 '22 05:07 johanbrandhorst

@johanbrandhorst do you have any link to refer? using multiple servers in the same gateway with an interceptor and executing some business logic in the gateway.

that-coder avatar Jul 28 '22 05:07 that-coder

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 02 '22 06:11 stale[bot]

@johanbrandhorst do you have any link to refer? using multiple servers in the same gateway with an interceptor and executing some business logic in the gateway.

Sorry, I missed this message, I don't have a link with an example for this but it's essentially just registering multiple services to the same gRPC server.

johanbrandhorst avatar Nov 02 '22 15:11 johanbrandhorst