grpc-swift
grpc-swift copied to clipboard
Allow adding `ServerInterceptor`s to specific services and methods
Motivation
We want to allow users to customise the RPCs a registered interceptor should apply to on the server:
- Intercept all requests
- Intercept requests only meant for specific services
- Intercept requests only meant for specific methods
Modifications
This PR adds a new ServerInterceptorTarget type that allows users to specify what the target of the interceptor should be.
Existing APIs accepting [any ServerInterceptor] have been changed to instead take [ServerInterceptorTarget].
Result
Users can have more control over to which requests interceptors are applied.