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

Allow adding `ServerInterceptor`s to specific services and methods

Open gjcairo opened this issue 1 year ago • 0 comments

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.

gjcairo avatar Oct 16 '24 18:10 gjcairo