jduo commented on a change in pull request #7994:
URL: https://github.com/apache/arrow/pull/7994#discussion_r477543928
##########
File path:
java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java
##########
@@ -84,18 +81,15 @@
* Create a Flight client from an allocator and a gRPC channel.
*/
FlightClient(BufferAllocator incomingAllocator, ManagedChannel channel,
- List<FlightClientMiddleware.Factory> middleware) {
+ List<FlightClientMiddleware.Factory> middleware, CallCredentials
callCredentials) {
this.allocator = incomingAllocator.newChildAllocator("flight-client", 0,
Long.MAX_VALUE);
this.channel = channel;
- final ClientInterceptor[] interceptors;
- interceptors = new ClientInterceptor[]{authInterceptor, new
ClientInterceptorAdapter(middleware)};
-
// Create a channel with interceptors pre-applied for DoGet and DoPut
- this.interceptedChannel = ClientInterceptors.intercept(channel,
interceptors);
+ this.interceptedChannel = ClientInterceptors.intercept(channel, new
ClientInterceptorAdapter(middleware));
- blockingStub = FlightServiceGrpc.newBlockingStub(interceptedChannel);
- asyncStub = FlightServiceGrpc.newStub(interceptedChannel);
+ blockingStub =
FlightServiceGrpc.newBlockingStub(interceptedChannel).withCallCredentials(callCredentials);
Review comment:
I've added a CredentialCallOptions class which creates and adds
CallCredentials to the gRPC stub.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]