Skip to content
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

Closed
wants to merge 19 commits into from

Conversation

sjyang18
Copy link
Contributor

@sjyang18 sjyang18 commented Jun 26, 2020

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:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • Have you verified that the full build is successful on JDK 8?
  • Have you verified that the full build is successful on JDK 11?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

@jfrazee jfrazee self-requested a review July 4, 2020 19:08
@pvillard31 pvillard31 changed the base branch from master to main September 17, 2020 10:25
@sjyang18
Copy link
Contributor Author

sjyang18 commented Sep 28, 2020

I haver rebased to main and push to see if build failure will be fixed.

Copy link
Member

@jfrazee jfrazee left a 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:

  1. 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.
  2. 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 that refreshUserGroupData() always creates a new user group object and swaps the values. So the background thread can just call it in a thread safe way.
  3. 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.

nifi-docs/src/main/asciidoc/administration-guide.adoc Outdated Show resolved Hide resolved
nifi-docs/src/main/asciidoc/administration-guide.adoc Outdated Show resolved Hide resolved
nifi-docs/src/main/asciidoc/administration-guide.adoc Outdated Show resolved Hide resolved
nifi-docs/src/main/asciidoc/administration-guide.adoc Outdated Show resolved Hide resolved
nifi-docs/src/main/asciidoc/administration-guide.adoc Outdated Show resolved Hide resolved
nifi-docs/src/main/asciidoc/administration-guide.adoc Outdated Show resolved Hide resolved
nifi-docs/src/main/asciidoc/administration-guide.adoc Outdated Show resolved Hide resolved
nifi-docs/src/main/asciidoc/administration-guide.adoc Outdated Show resolved Hide resolved
nifi-docs/src/main/asciidoc/administration-guide.adoc Outdated Show resolved Hide resolved
Copy link
Member

@jfrazee jfrazee left a 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:

  1. 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.
  2. Since the instructions for configuration/behavior are in the docs I think it can be removed from the comments in the authorizers.xml.
  3. 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.
  4. 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.

Copy link
Member

@jfrazee jfrazee left a 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.

@jfrazee jfrazee closed this in 365dde2 Apr 9, 2021
krisztina-zsihovszki pushed a commit to krisztina-zsihovszki/nifi that referenced this pull request Jun 28, 2022
This closes apache#4367

Signed-off-by: Joey Frazee <jfrazee@apache.org>
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