chia7712 commented on code in PR #16990: URL: https://github.com/apache/kafka/pull/16990#discussion_r1733198119
########## clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/AccessTokenRetrieverFactory.java: ########## @@ -70,6 +73,8 @@ public static AccessTokenRetriever create(Map<String, ?> configs, if (jou.shouldCreateSSLSocketFactory(tokenEndpointUrl)) sslSocketFactory = jou.createSSLSocketFactory(); + boolean urlencodeHeader = validateUrlencodeHeader(cu); Review Comment: nit: `validateUrlEncodeHeader` ########## clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/ConfigurationUtils.java: ########## @@ -209,6 +209,15 @@ public String validateString(String name, boolean isRequired) throws ValidateExc return value; } + public Boolean validateBoolean(String name, boolean isRequired) { + Boolean value = get(name); + + if (value == null && isRequired) + throw new ConfigException(name, null, String.format("The OAuth configuration option %s must be non-null", name)); Review Comment: you have created the detailed error message, so we don't need to pass `name` and `null` to ConfigException ########## clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/AccessTokenRetrieverFactory.java: ########## @@ -79,8 +84,27 @@ public static AccessTokenRetriever create(Map<String, ?> configs, cu.validateLong(SASL_LOGIN_RETRY_BACKOFF_MAX_MS), cu.validateInteger(SASL_LOGIN_CONNECT_TIMEOUT_MS, false), cu.validateInteger(SASL_LOGIN_READ_TIMEOUT_MS, false), - cu.get(SASL_OAUTHBEARER_HEADER_URLENCODE)); + urlencodeHeader); Review Comment: nit: `urlEncodeHeader` -- 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