You are viewing a plain text version of this content. The canonical link for it is here.
Posted to devnull@infra.apache.org by "satishd (GitHub)" <gi...@apache.org> on 2018/08/22 05:10:18 UTC

[GitHub] [kafka] satishd commented on pull request #5552: KAFKA-7324: NPE due to lack of SASLExtensions in SASL/OAUTHBEARER

It may be good to add this check in `validateExtensions(extensions)` and return respective instance because it will avoid having null check for extensions in any code which will be added in future. 

```java
public static SaslExtensions validateExtensions(SaslExtensions extensions) throws SaslException {
  if(extensions == null) {
    return NO_SASL_EXTENSIONS; // nothing to validate further
  }
  // existing logic
  ....
}
```

validateExtensions(extensions) may be renamed to be explicit about returning resultant  extensions. 

Assigning `validateExtensions(extensions)` result is missed [here](https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/unsecured/OAuthBearerUnsecuredLoginCallbackHandler.java#L234) which is not added as part of this PR but it may be addressed in this PR if possible.



[ Full content available at: https://github.com/apache/kafka/pull/5552 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org