kevdoran commented on a change in pull request #3446: NIFI-6224 Updated 
KerberosProvider to use the "Default Realm" property
URL: https://github.com/apache/nifi/pull/3446#discussion_r277821968
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-kerberos-iaa-providers-bundle/nifi-kerberos-iaa-providers/src/main/java/org/apache/nifi/kerberos/KerberosProvider.java
 ##########
 @@ -61,11 +63,16 @@ public final void onConfigured(final 
LoginIdentityProviderConfigurationContext c
         }
 
         try {
-            expiration = FormatUtils.getTimeDuration(rawExpiration, 
TimeUnit.MILLISECONDS);
+            expiration = 
Double.valueOf(FormatUtils.getPreciseTimeDuration(rawExpiration, 
TimeUnit.MILLISECONDS)).longValue();
         } catch (final IllegalArgumentException iae) {
             throw new ProviderCreationException(String.format("The Expiration 
Duration '%s' is not a valid time duration", rawExpiration));
         }
 
+        defaultRealm = configurationContext.getProperty("Default Realm");
+        if (defaultRealm.contains("@")) {
 
 Review comment:
   If I did not have the Default Realm property present in the config, I was 
able to get a NPE in testing.
   
   ```suggestion
           if (StringUtils.isNotBlank(defaultRealm) && 
defaultRealm.contains("@")) {
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to