kezhuw commented on code in PR #2176: URL: https://github.com/apache/zookeeper/pull/2176#discussion_r1758876160
########## zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/auth/SaslQuorumAuthLearner.java: ########## @@ -62,9 +64,13 @@ public SaslQuorumAuthLearner( "SASL-authentication failed because the specified JAAS configuration section '%s' could not be found.", loginContext)); } + + Supplier<CallbackHandler> callBackSupplier = () -> { + return new SaslClientCallbackHandler(null, "QuorumLearner"); + }; this.learnerLogin = new Login( loginContext, - new SaslClientCallbackHandler(null, "QuorumLearner"), + callBackSupplier, Review Comment: ```suggestion callbackSupplier, ``` ########## zookeeper-server/src/main/java/org/apache/zookeeper/Login.java: ########## @@ -48,7 +49,7 @@ public class Login { private static final String KINIT_COMMAND_DEFAULT = "/usr/bin/kinit"; private static final Logger LOG = LoggerFactory.getLogger(Login.class); public static final String SYSTEM_USER = System.getProperty("user.name", "<NA>"); - public CallbackHandler callbackHandler; + private Supplier<CallbackHandler> callbackHandlerSupplier; Review Comment: ```suggestion private final Supplier<CallbackHandler> callbackHandlerSupplier; ``` ########## zookeeper-server/src/main/java/org/apache/zookeeper/util/SecurityUtils.java: ########## @@ -36,10 +42,14 @@ import org.ietf.jgss.GSSName; import org.ietf.jgss.Oid; import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public final class SecurityUtils { + private static final Logger LOG = LoggerFactory.getLogger(SecurityUtils.class); Review Comment: How about follow the pattern of `createSaslClient`/`createSaslServer` to accept a log parameter ? This will allow callers to log in their contexts. ########## zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/auth/SaslQuorumAuthLearner.java: ########## @@ -62,9 +64,13 @@ public SaslQuorumAuthLearner( "SASL-authentication failed because the specified JAAS configuration section '%s' could not be found.", loginContext)); } + + Supplier<CallbackHandler> callBackSupplier = () -> { Review Comment: ```suggestion Supplier<CallbackHandler> callbackSupplier = () -> { ``` -- 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: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org