Skip to content

Add support for server interceptor filtering #209

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

onobc
Copy link
Contributor

@onobc onobc commented Jun 29, 2025

Warning

WIP
This is being reworked once #212 is merged

This commit adds support for filtering the server-side global interceptors.

The server factory is now passed down through the service discoverer and configurer to allow the filter to take into account the server factory in use.

The service discoverer contract has also been minimized to remove the unused findService(String) method.

Resolves #208

@onobc onobc force-pushed the GH-208-server-interceptorp-filter branch from 4545f1a to 9b53805 Compare June 29, 2025 19:19
@onobc onobc requested a review from dsyer June 29, 2025 19:19
This commit adds support for filtering the server global interceptors.

The server factory is now passed down through the service discoverer and
configurer to allow the filter to take into account the server factory in
use.

The service discoverer contract has also been minimized to remove the
unused `findService(String)` method.

Resolves spring-projects#208

Signed-off-by: Chris Bono <chris.bono@gmail.com>
@onobc onobc force-pushed the GH-208-server-interceptorp-filter branch from 9b53805 to 1979409 Compare June 29, 2025 19:22
import io.grpc.ServerServiceDefinition;

/**
* Marker interface for {@link GrpcServerFactory} that is to be handled by the servlet
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not super excited about this but the alternative is to pass in null in this case but then the filter implementations must take this into account and check for null and then assume null means servlet.

* @return list of service names - empty when no services available
*/
default List<String> listServiceNames() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because listing of service names should not need to deal w/ any interceptors etc.. I broke this out into its own impl as it was just piggy-backing off of findServices out of convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to filter out server interceptors from server factories
1 participant