Repository: zeppelin Updated Branches: refs/heads/master 53cbb10f7 -> 7e028903c
[ZEPPELIN-3555] Zeppelin auth fails if `activeDirectoryRealm.groupRolesMap` is not specified. Zeppelin auth fails if `activeDirectoryRealm.groupRolesMap` is not specified. [Bug Fix] * [ZEPPELIN-3555](https://issues.apache.org/jira/browse/ZEPPELIN-3555) Zeppelin auth fails if `groupRolesMap` is not specified in `ActiveDirectoryGroupRealm`, with this PR following config should work; ``` activeDirectoryRealm = org.apache.zeppelin.realm.ActiveDirectoryGroupRealm activeDirectoryRealm.systemUsername = userNameA activeDirectoryRealm.systemPassword = passwordA activeDirectoryRealm.searchBase = CN=Users,DC=SOME_GROUP,DC=COMPANY,DC=COM activeDirectoryRealm.url = ldap://ldap.test.com:389 activeDirectoryRealm.authorizationCachingEnabled = false ``` * Does the licenses files need update? N/A * Is there breaking changes for older versions? N/A * Does this needs documentation? N/A Author: Prabhjyot Singh <prabhjyotsi...@gmail.com> Closes #3037 from prabhjyotsingh/ZEPPELIN-3555 and squashes the following commits: 25196d3 [Prabhjyot Singh] revert `getGroupRolesMap()` method 6cb408a [Prabhjyot Singh] ZEPPELIN-3555: fix NPE in groupRolesMap for ActiveDirectoryGroupRealm Change-Id: I7147b994ce1a72410122e6fdddd96335250d8868 Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/7e028903 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/7e028903 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/7e028903 Branch: refs/heads/master Commit: 7e028903c6509e9c73e64363df86fb00fe311cb5 Parents: 53cbb10 Author: Prabhjyot Singh <prabhjyotsi...@gmail.com> Authored: Fri Jun 22 10:38:13 2018 +0530 Committer: Prabhjyot Singh <prabhjyotsi...@gmail.com> Committed: Tue Jun 26 10:01:20 2018 +0530 ---------------------------------------------------------------------- .../org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7e028903/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java index 624b1ae..40d28fe 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java @@ -16,6 +16,7 @@ */ package org.apache.zeppelin.realm; +import java.util.LinkedHashMap; import org.apache.commons.lang.StringUtils; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; @@ -76,10 +77,10 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm { * group names (e.g. CN=Group,OU=Company,DC=MyDomain,DC=local) * as returned by the active directory LDAP server to role names. */ - private Map<String, String> groupRolesMap; + private Map<String, String> groupRolesMap = new LinkedHashMap<>(); public void setGroupRolesMap(Map<String, String> groupRolesMap) { - this.groupRolesMap = groupRolesMap; + this.groupRolesMap.putAll(groupRolesMap); } LdapContextFactory ldapContextFactory;