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

ASF GitHub Bot commented on NIFI-5656:
--------------------------------------

Github user kevdoran commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/3043#discussion_r222308394
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java
 ---
    @@ -232,16 +232,21 @@ public void 
onConfigured(AuthorizerConfigurationContext configurationContext) th
                 nodeGroupIdentifier = null;
     
                 if (nodeGroupName != null) {
    -                for (Group group : userGroupProvider.getGroups()) {
    -                    if (group.getName().equals(nodeGroupName)) {
    -                        nodeGroupIdentifier = group.getIdentifier();
    -                        break;
    +                if (!StringUtils.isBlank(nodeGroupName)) {
    +                    logger.debug("Trying to load node group '{}' from the 
underlying userGroupProvider", nodeGroupName);
    +                    for (Group group : userGroupProvider.getGroups()) {
    +                        if (group.getName().equals(nodeGroupName)) {
    +                            nodeGroupIdentifier = group.getIdentifier();
    +                            break;
    +                        }
                         }
    -                }
     
    -                if (nodeGroupIdentifier == null) {
    -                    throw new AuthorizerCreationException(String.format(
    +                    if (nodeGroupIdentifier == null) {
    +                        throw new 
AuthorizerCreationException(String.format(
                                 "Authorizations node group '%s' could not be 
found", nodeGroupName));
    +                    }
    +                } else {
    +                    logger.warn("Empty node group name provided");
    --- End diff --
    
    I don't think this merits a warning, given that it empty by default. 
Perhaps a debug message would be appropriate.


> Remove Node Group property from FileAccessPolicyProvider in the default case
> ----------------------------------------------------------------------------
>
>                 Key: NIFI-5656
>                 URL: https://issues.apache.org/jira/browse/NIFI-5656
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.8.0
>            Reporter: Peter Wilcsinszky
>            Assignee: Peter Wilcsinszky
>            Priority: Major
>             Fix For: 1.8.0
>
>
> The "Node Group" property was introduced to let configuring node policies 
> easier in a more dynamic environment. This feature is a base for future 
> custom UserGroupProviders to provide a Group and the list of contained nodes 
> dynamically. However in it's current form (if left empty) will throw an 
> exception that would end in a confusing user experience as NiFi will fail to 
> start.



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

Reply via email to