Skip to content

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
@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.

* Find names of all gRPC services.
* @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.

@onobc onobc closed this Jul 1, 2025
@onobc onobc force-pushed the GH-208-server-interceptorp-filter branch from 1979409 to 94b9ef9 Compare July 1, 2025 18:25
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 global server interceptors from services

1 participant