Skip to content

NIFI-15567 Streamline Component Authorizable Evaluation Methods#10871

Closed
exceptionfactory wants to merge 3 commits intoapache:mainfrom
exceptionfactory:NIFI-15567
Closed

NIFI-15567 Streamline Component Authorizable Evaluation Methods#10871
exceptionfactory wants to merge 3 commits intoapache:mainfrom
exceptionfactory:NIFI-15567

Conversation

@exceptionfactory
Copy link
Copy Markdown
Contributor

Summary

NIFI-15567 Refactors and streamlines framework handling of ComponentAuthorizable references for both create and update operations using a shared class.

The new AuthorizeComponentReference class follows a pattern similar to classes for Controller Services and Parameter Providers, defining new methods for evaluating component restrictions and references in a single location. The unified approach removes duplicative try-finally handling for component creation, and supports reuse of similar evaluation for component updates.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

- Added AuthorizeComponentReference class with shared methods for evaluating authorized configuration operations and referenced Controller Services
- Updated create and update operations for Components using shared methods
Copy link
Copy Markdown
Contributor

@pvillard31 pvillard31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @exceptionfactory. Looks good to go, left some minor comments.


import java.util.Map;

public class AuthorizeComponentReference {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be final like its sibling AuthorizeControllerServiceReference?

}
}
final ProcessorConfigDTO config = requestProcessor.getConfig();
final Map<String, String> properties = config == null ? Map.of() : config.getProperties();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed that you are using Map.of() here but Collections.emptyMap() in ProcessorResource. Better to be consistent, no?

// authorize any parameter references
AuthorizeParameterReference.authorizeParameterReferences(properties, authorizer, authorizable.getParameterContext(), user);
AuthorizeParameterReference.authorizeParameterReferences(annotationData, authorizer, authorizable.getParameterContext(), user);
final Authorizable parameterContext = authorizable.getParameterContext();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final Authorizable parameterContext = authorizable.getParameterContext();
final ParameterContext parameterContext = authorizable.getParameterContext();

Like in L610, no?

@exceptionfactory
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback on consistency items @pvillard31, I pushed an update with adjustments.

@pvillard31 pvillard31 closed this in 119f888 Feb 9, 2026
yisun-anetac pushed a commit to Eng-Anetac/nifi that referenced this pull request Apr 4, 2026
- Added AuthorizeComponentReference class with shared methods for evaluating authorized configuration operations and referenced Controller Services
- Updated create and update operations for Components using shared methods

This closes apache#10871.

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants