-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call Interceptor functionality #785
Comments
@adriantabirta what's your specific use case? It might be something we can solve without interceptors. I agree though, interceptors would be helpful! |
I would use Interceptors for:
|
@glbrntt is this on the roadmap? I'd love to take a stab at implementing it. I was thinking of creating a mechanism to specify additional ChannelHandlers per-Server and/or per-CallHandlerProvider to be injected into the Pipeline between GRPCServerRequestRoutingHandler and BaseCallHandler. The API would look something like: extension CallHandlerProvider {
public var prefixedHandlers: [ChannelHandler.Type]? { get }
}
extension Server.Builder {
@discardableResult
public func withPrefixHandlers(_ handlers: [ChannelHandler.Type]) -> Self {
// prefixedHandlers gets added to Server.Configuration
self.prefixedHandlers = handlers
return self
}
} Does that sound right? This would work nicely for my needs, where I want to validate JWT on a subset of my GRPC api. |
Actually now I realize the async part of my JWT auth procedure can be factored out... so I suppose this isn't nearly as dire as I was making out. Still up for contributing if this approach is sane :) |
It's certainly on the roadmap. It's not clear to me that a |
This is available as of 1.0.0-alpha.21 |
how can I use the ClientInterceptor? any documentations? |
I have an example/tutorial which needs tidying up, I'll try to post it in the next couple of days. In the meantime I'd suggesting looking at some of the tests as a starting point: https://github.com/grpc/grpc-swift/blob/main/Tests/GRPCTests/InterceptorsTests.swift#L298-#L325 |
thanks. |
fyi, there is now a tutorial/example: https://github.com/grpc/grpc-swift/blob/main/docs/interceptors-tutorial.md |
On client side I need an interceptor, would be great if we do have one like in go
The text was updated successfully, but these errors were encountered: