see-quick commented on code in PR #22060:
URL: https://github.com/apache/kafka/pull/22060#discussion_r3253535884


##########
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/unsecured/OAuthBearerUnsecuredValidatorCallbackHandler.java:
##########
@@ -188,7 +188,7 @@ private String scopeClaimName() {
 
     private List<String> requiredScope() {
         String requiredSpaceDelimitedScope = option(REQUIRED_SCOPE_OPTION);
-        return Utils.isBlank(requiredSpaceDelimitedScope) ? 
Collections.emptyList() : 
OAuthBearerScopeUtils.parseScope(requiredSpaceDelimitedScope.trim());
+        return Utils.isBlank(requiredSpaceDelimitedScope) ? List.of() : 
OAuthBearerScopeUtils.parseScope(requiredSpaceDelimitedScope.trim());

Review Comment:
   I did find some time to check it, the JAAS option map values cannot be null 
in practice as in:
   
https://github.com/apache/kafka/blob/9dfc5a724239042ed6add3e87c0041e3ef9c2dee/clients/src/main/java/org/apache/kafka/common/security/JaasConfig.java#L113-L119
   
   explicitly rejects null values during parsing. So Map.copyOf(), is safe 
here. I will update PR with changes. 
   



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

Reply via email to