-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIFI-7573: Add an Azure Active Directory (AAD) User Group Provider #4367
Conversation
I haver rebased to main and push to see if build failure will be fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjyang18 Thanks for this, it's going to be really useful. There are three things I think we need to work through:
- There are a variety of style changes to fix. If we can get this done it'll be easier to work through any additional things.
- I think we should take a different approach for managing the concurrency/thread safety of the user groups. The most common approach in the rest of the codebase is to use an immutable object with an AtomicReference and use the
AtomicReference::set()
to effectively swap the values. I created an example in a gist. The idea is thatrefreshUserGroupData()
always creates a new user group object and swaps the values. So the background thread can just call it in a thread safe way. - We'll have to add the documentation. There's already bits and pieces in the comments so this should be easy once we work through the rest.
...horizer/src/test/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProviderIT.java
Outdated
Show resolved
Hide resolved
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-graph-authorizer/pom.xml
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
.../nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml
Outdated
Show resolved
Hide resolved
…perty to authorizer.xml
…possible code injection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjyang18 Thanks for the updates! There are a few more suggestions:
- I think it'd be useful to have the names of the configuration properties in authorizers.xml match the names the user would see in the portal.
- Since the instructions for configuration/behavior are in the docs I think it can be removed from the comments in the authorizers.xml.
- The microsoft-graph dependency has been updated several times. As far as I can tell, everything still works with 2.10.0. It might make sense to update the version to that.
- The microsoft-graph dependency needs to be added to the nifi-azure-nar/src/main/resources/META-INF/LICENSE file. It should say something like "The binary distribution of this product bundles 'Microsoft Graph SDK for Java' which is available under an MIT license." and include the text of the the license.
.../nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml
Outdated
Show resolved
Hide resolved
.../nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml
Outdated
Show resolved
Hide resolved
.../nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml
Outdated
Show resolved
Hide resolved
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-graph-authorizer/pom.xml
Outdated
Show resolved
Hide resolved
...uthorizer/src/main/java/org/apache/nifi/authorization/azure/AzureGraphUserGroupProvider.java
Outdated
Show resolved
Hide resolved
.../nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml
Outdated
Show resolved
Hide resolved
.../nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sjyang18 everything LGTM.
This closes apache#4367 Signed-off-by: Joey Frazee <jfrazee@apache.org>
Thank you for submitting a contribution to Apache NiFi.
Please provide a short description of the PR here:
Description of PR
NiFi on Azure Cloud environment may be integrated with AAD and define the group based authorization policies. Combined with OIDC based user authentication, this will improve user/group authorization policy management experience.
Reference:
https://docs.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0
https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically
master
)?Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squash
or use--force
when pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean install
at the rootnifi
folder?LICENSE
file, including the mainLICENSE
file undernifi-assembly
?NOTICE
file, including the mainNOTICE
file found undernifi-assembly
?.displayName
in addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.