RivenSun2 commented on code in PR #12010: URL: https://github.com/apache/kafka/pull/12010#discussion_r853651665
########## clients/src/main/java/org/apache/kafka/common/config/internals/BrokerSecurityConfigs.java: ########## @@ -89,4 +91,31 @@ public class BrokerSecurityConfigs { + "The broker will disconnect any such connection that is not re-authenticated within the session lifetime and that is then subsequently " + "used for any purpose other than re-authentication. Configuration names can optionally be prefixed with listener prefix and SASL " + "mechanism name in lower-case. For example, listener.name.sasl_ssl.oauthbearer.connections.max.reauth.ms=3600000"; + + public static class SaslEnabledMechanismsValidator implements ConfigDef.Validator { + @Override + public void ensureValid(String name, Object value) { + if (value == null) { + throw new ConfigException(name, null, "entry must be non null"); + } + + @SuppressWarnings("unchecked") + List<String> mechanismStrings = (List) value; + + if (mechanismStrings.isEmpty()) { + throw new ConfigException(name, null, "entry must be non-empty list"); + } + + mechanismStrings.forEach(mechanism -> { + if (mechanism == null || mechanism.isEmpty()) { + throw new ConfigException(name, mechanism, "enabled mechanism must be non-null or non-empty string"); Review Comment: thanks for your review -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org