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_r262437759
 
 

 ##########
 File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/api/Commands.java
 ##########
 @@ -168,6 +205,52 @@ public static ByteBuf newConnected(int 
clientProtocolVersion) {
         return res;
     }
 
+    public static ByteBuf newAuthChallenge(String authMethod, AuthData 
brokerData, int clientProtocolVersion) {
+        CommandAuthChallenge.Builder challengeBuilder = 
CommandAuthChallenge.newBuilder();
+
+        // If the broker supports a newer version of the protocol, it will 
anyway advertise the max version that the
+        // client supports, to avoid confusing the client.
+        int currentProtocolVersion = getCurrentProtocolVersion();
+        int versionToAdvertise = Math.min(currentProtocolVersion, 
clientProtocolVersion);
+
+        challengeBuilder.setProtocolVersion(versionToAdvertise);
+        challengeBuilder.setServerVersion("Pulsar Server");
 
 Review comment:
   We should have the server version available somewhere. There's no point in 
just sending "Pulsar Server"

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to