Apache Thrift proxy for filtering requests

486 Views Asked by At

I am trying to build a Thrift proxy, with Apache Thrift, to filter some requests directed to a Thrift server. The flow should be like Thrift Client <-> Proxy <-> Thrift Server for all RPC calls.

Basically the Thrift server binds to some services that expose some callable methods. I want to develop a proxy which is able to filter any requests: the client is allowed to call only some methods on some services so I want to discard any request which is not allowed. I can't modify the Thrift Server code that's why I need a proxy.

Is there any solution or Thrift class which would be good in this case? Right now I am using python.

1

There are 1 best solutions below

0
On

Nothing specific in trunk to do this, however you could easily write a quick service implementation using the same IDL the real server uses. Your service could them filter client calls as needed and call through to the real server when appropriate. Your service would thus be a server to the client and a client to the real server. It would probably be good to throw a TApplicationException back to the client for calls you want to reject.