You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/03/03 18:03:31 UTC

[GitHub] [nifi] alopresto commented on a change in pull request #4099: NIFI-7170: Add option to disable anonymous authentication

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:
users@infra.apache.org


With regards,
Apache Git Services