gRPC method-based routing

Is it possible to send requests for anonRpc directly to my ExampleService, but send requests for authRpc to a ForwardAuth middleware first?

If it is possible, could you give a brief example of the spec.routes.match filter I would need to use in the IngressRoute CRD?

Here is the service definition (.proto):

syntax = "proto3";

package example;

message Empty {}

service ExampleService {
  rpc anonRpc(Empty) returns (Empty);
  rpc authRpc(Empty) returns (Empty);

Would it be something like PathPrefix('/example.ExampleService/authRpc') for the route that has the ForwardAuth middleware?

Yes. Middlewares are applied to a router, so you need different routers for the services, using a rule like Host() && PathPrefix().

The "longer" rule has higher priority, so you can have a single one with Host && PathPrefix which will be matched first, other just with Host.