ZEPPELIN-6171 Add FreeIPA authentication with memberOf attribute for groups maping #4917
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this PR for?
This pull request introduces support for LDAP authentication using the memberOf attribute, retrieving user group memberships from LDAP systems like FreeIPA.
Problem
Previously, Zeppelin's LdapRealm could only determine group memberships by searching all groups in the LDAP directory and checking if the user was a member of each group. This approach doesn't properly support nested group memberships in systems that use the memberOf attribute like FreeIPA.
Solution
This PR adds the ability to use the memberOf attribute for determining group memberships by:
Adding configuration options to enable memberOf attribute support:
Implementing a new code path in the rolesFor method that:
Searches for the user and retrieves their memberOf attribute values
Correctly extracts group names from the memberOf Distinguished Names
Maps these group names to roles based on the configured rolesByGroup mapping
Properly handling the LDAP Distinguished Name (DN) component order when extracting group names by iterating through the DN components in the correct order
What type of PR is it?
Improvement
Please leave your type of PR only
Todos
What is the Jira issue?
[ZEPPELIN-6171]
How should this be tested?
added automated unit tests for any new or changed behavior