nandini12396 commented on code in PR #22880:
URL: https://github.com/apache/kafka/pull/22880#discussion_r3649992406
##########
clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java:
##########
@@ -2773,4 +2799,25 @@ public KafkaPrincipal deserialize(byte[] bytes) {
return null;
}
}
+
+ public static class CountingKafkaPrincipalBuilder implements
KafkaPrincipalBuilder {
+ private static final AtomicInteger BUILD_COUNT = new AtomicInteger();
Review Comment:
Agreed. Done, thanks!
##########
clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java:
##########
@@ -217,6 +217,32 @@ public void testValidSaslPlainOverPlaintext() throws
Exception {
checkAuthenticationAndReauthentication(securityProtocol, node);
}
+ @Test
+ public void testPrincipalBuiltOncePerAuthentication() throws Exception {
+ String node = "0";
+ time = new MockTime();
+ SecurityProtocol securityProtocol = SecurityProtocol.SASL_PLAINTEXT;
+ configureMechanisms("PLAIN", Collections.singletonList("PLAIN"));
+
saslServerConfigs.put(BrokerSecurityConfigs.PRINCIPAL_BUILDER_CLASS_CONFIG,
+ CountingKafkaPrincipalBuilder.class);
+ CountingKafkaPrincipalBuilder.BUILD_COUNT.set(0);
Review Comment:
Done, thanks!
--
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]