kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (KAFKA-5802) ScramServerCallbackHandler#handle should check username not being null before calling credentialCache.get()
Date Fri, 16 Feb 2018 00:53:00 GMT

    [ https://issues.apache.org/jira/browse/KAFKA-5802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16302643#comment-16302643
] 

Ted Yu edited comment on KAFKA-5802 at 2/16/18 12:52 AM:
---------------------------------------------------------

+1 from me.


was (Author: yuzhihong@gmail.com):
+1

> ScramServerCallbackHandler#handle should check username not being null before calling
credentialCache.get()
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-5802
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5802
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>
> {code}
>         String username = null;
>         for (Callback callback : callbacks) {
>             if (callback instanceof NameCallback)
>                 username = ((NameCallback) callback).getDefaultName();
>             else if (callback instanceof ScramCredentialCallback)
>                 ((ScramCredentialCallback) callback).scramCredential(credentialCache.get(username));
> {code}
> Since ConcurrentHashMap, used by CredentialCache, doesn't allow null keys, we should
check that username is not null before calling credentialCache.get()



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message