Skip to content
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

Allow adding ServerInterceptors to specific services and methods #2096

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gjcairo
Copy link
Collaborator

@gjcairo gjcairo commented Oct 16, 2024

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 gjcairo added ⚠️ semver/major Breaks existing public API. v2 A change for v2 labels Oct 16, 2024
@gjcairo gjcairo requested a review from glbrntt October 16, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ semver/major Breaks existing public API. v2 A change for v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant