ivankelly commented on a change in pull request #3677: PIP-30: interface and 
mutual change authentication
URL: https://github.com/apache/pulsar/pull/3677#discussion_r264295784
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
 ##########
 @@ -187,13 +195,14 @@ public void channelActive(ChannelHandlerContext ctx) 
throws Exception {
                 });
     }
 
-    protected ByteBuf newConnectCommand() throws PulsarClientException {
-        String authData = "";
-        if (authentication.getAuthData().hasDataFromCommand()) {
-            authData = authentication.getAuthData().getCommandData();
-        }
+    protected ByteBuf newConnectCommand() throws Exception {
+        // mutual authentication is to auth between `remoteHostName` and this 
client for this channel.
+        // each channel will have a mutual client/server pair, mutual client 
evaluateChallenge with init data,
+        // and return authData to server.
+        authenticationDataProvider = 
authentication.getAuthData(remoteHostName);
+        AuthData authData = 
authenticationDataProvider.authenticate(AuthData.of("init".getBytes("UTF-8")));
 
 Review comment:
   init should be defined as a constant somewhere.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to