spiral-modules / php-grpc

:electric_plug: Fast and furious GRPC server for PHP applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Way to define Interceptors or Middlewares for OAuth?

lrembacz opened this issue · comments

Hi,
Is there a way or is planned to define some kind of Interceptors or Middlewares for this gRpc server?

Something like in this post would be great I guess:

https://texlution.com/post/oauth-and-grpc-go/

Yes, you can define Interceptor by implementing InvokerInterface:
https://github.com/spiral/php-grpc/blob/master/src/InvokerInterface.php

And pass it the server: https://github.com/spiral/php-grpc/blob/master/src/Server.php#L33

You can wrap default Invoker to implement needed functionality.

Yes, I can see that.
Thank you for your answer and this work.