scruz-denodo commented on PR #43155:
URL: https://github.com/apache/arrow/pull/43155#issuecomment-2214460996

   > But you're able to get the FlightService directly and fully control the 
server builder.
   
   Maybe I'm missing something, but I don't see how it is possible to do that. 
   
   I only see a way of registering a `io.grpc.ServerInterceptor` on the Builder 
which is invoking something like the previous code. 
   ```
    final MyServerInterceptor myServerInterceptor = new MyServerInterceptor();
    final Consumer<NettyServerBuilder> consumer = (builder) -> {
        builder.intercept(myServerInterceptor );
    };
   ```
   This `Consumer` is invoked when the 
`org.apache.arrow.flight.FlightServer.Builder#build` is executed. This `build` 
method also executes the following code as last step.
   ```
         builder.intercept(new ServerInterceptorAdapter(interceptors));
         return new FlightServer(location, builder.build(), grpcExecutor);
   ```
   With that code, the order of the ServerInterceptors added to gRPC provokes 
that the `ServerInterceptorAdapter` is invoked **before** the 
`MyServerInterceptor` instance. 
   So, the authentication process is executed before executing the custom 
`io.grpc.ServerInterceptor`. 
   
   I do not see a way of redefining the order of the `interceptors` passed to 
the builder to force the `MyServerInterceptor` being executed as first step.
   
   Maybe a change for adding the possibility to redefine that order would fit 
better?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to