alopresto commented on a change in pull request #4099: NIFI-7170: Add option to 
disable anonymous authentication
URL: https://github.com/apache/nifi/pull/4099#discussion_r387197313
 
 

 ##########
 File path: 
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
 ##########
 @@ -904,10 +905,19 @@ public boolean isLoginIdentityProviderEnabled() {
         return 
!StringUtils.isBlank(getProperty(NiFiProperties.SECURITY_USER_LOGIN_IDENTITY_PROVIDER));
     }
 
+    /**
+     * @return True if property value is 'true'; False otherwise.
+     */
+    public Boolean isAnonymousAuthenticationAllowed() {
+        final String anonymousAuthenticationAllowed = 
getProperty(SECURITY_ANONYMOUS_AUTHENTICATION, "false");
+
+        return "true".equalsIgnoreCase(anonymousAuthenticationAllowed);
 
 Review comment:
   I think we should trim the retrieved property before comparing. Users 
frequently have trailing spaces in their `nifi.properties` files, which can 
cause string inequality when to the human eye it looks valid, and this is 
difficult to diagnose. 

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