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


##########
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/unsecured/OAuthBearerUnsecuredJws.java:
##########
@@ -301,7 +300,7 @@ public static Map<String, Object> toMap(String split) 
throws OAuthBearerIllegalT
             for (Entry<String, JsonNode> entry : jsonNode.properties()) {
                 retval.put(entry.getKey(), convert(entry.getValue()));
             }
-            return Collections.unmodifiableMap(retval);
+            return Map.copyOf(retval);

Review Comment:
   But then I would change the behaviour of this i.e., we will expose this as 
mutable collection and then one could possibly do calls such as 
`token.claims().put(...)` or `token.scope().add(...)` which are currently not 
possible as those return collections are immutable and you would end up with 
`UnsupportedOperationException`. Or do I miss something?



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