Skip to content

Commit

Permalink
RANGER-2706 usermapsyncenabled can be removed from code
Browse files Browse the repository at this point in the history
Signed-off-by: Pradeep <pradeep@apache.org>
  • Loading branch information
lfrancke authored and pradeepagrawal8184 committed Feb 24, 2020
1 parent f909896 commit 07a70be
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ def add_advanced_ranger_configurations(add_admin_or_usersync, ranger_service_pro
advanced_user_sync_properties['ranger.usersync.ldap.groupname.caseconversion'] = ranger_service_properties_from_file.get('ranger.usersync.ldap.groupname.caseconversion','none')
advanced_user_sync_properties['ranger.usersync.logdir'] = ranger_service_properties_from_file.get('ranger.usersync.logdir','/var/log/ranger/usersync')
advanced_user_sync_properties['ranger.usersync.group.searchenabled'] = ranger_service_properties_from_file.get('ranger.usersync.group.searchenabled','false')
advanced_user_sync_properties['ranger.usersync.group.usermapsyncenabled'] = ranger_service_properties_from_file.get('ranger.usersync.group.usermapsyncenabled','false')
advanced_user_sync_properties['ranger.usersync.group.searchbase'] = ranger_service_properties_from_file.get('ranger.usersync.group.searchbase',' ')
advanced_user_sync_properties['ranger.usersync.group.searchscope'] = ranger_service_properties_from_file.get('ranger.usersync.group.searchscope',' ')
advanced_user_sync_properties['ranger.usersync.group.objectclass'] = ranger_service_properties_from_file.get('ranger.usersync.group.objectclass',' ')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ ranger.usersync.group.searchscope=sub
ranger.usersync.credstore.filename=
ranger.usersync.ldap.bindalias=
ranger.usersync.ldap.searchBase=
ranger.usersync.group.usermapsyncenabled=false

# Authentication properties
ranger.authentication.method=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ public class LdapConfig {
private static final String LGSYNC_GROUP_SEARCH_ENABLED = "ranger.usersync.group.searchenabled";
private static final boolean DEFAULT_LGSYNC_GROUP_SEARCH_ENABLED = false;

private static final String LGSYNC_GROUP_USER_MAP_SYNC_ENABLED = "ranger.usersync.group.usermapsyncenabled";
private static final boolean DEFAULT_LGSYNC_GROUP_USER_MAP_SYNC_ENABLED = false;

private static final String LGSYNC_GROUP_SEARCH_BASE = "ranger.usersync.group.searchbase";

private static final String LGSYNC_GROUP_SEARCH_SCOPE = "ranger.usersync.group.searchscope";
Expand Down Expand Up @@ -315,17 +312,6 @@ public boolean isGroupSearchEnabled() {
return groupSearchEnabled;
}

public boolean isGroupUserMapSyncEnabled() {
boolean groupUserMapSyncEnabled;
String val = prop.getProperty(LGSYNC_GROUP_USER_MAP_SYNC_ENABLED);
if (val == null || val.trim().isEmpty()) {
groupUserMapSyncEnabled = DEFAULT_LGSYNC_GROUP_USER_MAP_SYNC_ENABLED;
} else {
groupUserMapSyncEnabled = Boolean.valueOf(val);
}
return groupUserMapSyncEnabled;
}

public String getGroupSearchBase() {
String val = prop.getProperty(LGSYNC_GROUP_SEARCH_BASE);
return val;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ public class LdapDeltaUserGroupBuilder extends AbstractUserGroupSource {
private boolean userNameLowerCaseFlag = false;
private boolean groupNameLowerCaseFlag = false;

private boolean groupUserMapSyncEnabled = false;

//private Map<String, UserInfo> userGroupMap;

private Table<String, String, String> groupUserTable;
private Map<String, String> userNameMap;
private HashSet<String> groupNames;
Expand Down Expand Up @@ -297,7 +293,6 @@ private void setConfig() throws Throwable {
groupHierarchyLevels = config.getGroupHierarchyLevels();

extendedGroupSearchFilter = "(&" + extendedGroupSearchFilter + "(|(" + groupMemberAttributeName + "={0})(" + groupMemberAttributeName + "={1})))";
groupUserMapSyncEnabled = config.isGroupUserMapSyncEnabled();

groupSearchControls = new SearchControls();
groupSearchControls.setSearchScope(groupSearchScope);
Expand Down Expand Up @@ -343,7 +338,6 @@ private void setConfig() throws Throwable {
+ ", groupMemberAttributeName: " + groupMemberAttributeName
+ ", groupNameAttribute: " + groupNameAttribute
+ ", groupSearchAttributes: " + groupSearchAttributes
+ ", groupUserMapSyncEnabled: " + groupUserMapSyncEnabled
+ ", groupSearchFirstEnabled: " + groupSearchFirstEnabled
+ ", userSearchEnabled: " + userSearchEnabled
+ ", ldapReferral: " + ldapReferral
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ public class LdapUserGroupBuilder extends AbstractUserGroupSource {
private boolean userNameLowerCaseFlag;
private boolean groupNameLowerCaseFlag;

private boolean groupUserMapSyncEnabled;

private Map<String, UserInfo> userGroupMap;
//private Set<String> firstGroupDNs;
private Set<String> allUsers;
Expand Down Expand Up @@ -248,7 +246,6 @@ private void setConfig() throws Throwable {
if (!groupSearchFirstEnabled) {
extendedGroupSearchFilter = "(&" + extendedGroupSearchFilter + "(|(" + groupMemberAttributeName + "={0})(" + groupMemberAttributeName + "={1})))";
}
groupUserMapSyncEnabled = config.isGroupUserMapSyncEnabled();

groupSearchControls = new SearchControls();
groupSearchControls.setSearchScope(groupSearchScope);
Expand Down Expand Up @@ -287,7 +284,6 @@ private void setConfig() throws Throwable {
+ ", groupMemberAttributeName: " + groupMemberAttributeName
+ ", groupNameAttribute: " + groupNameAttribute
+ ", groupSearchAttributes: " + groupSearchAttributes
+ ", groupUserMapSyncEnabled: " + groupUserMapSyncEnabled
+ ", groupSearchFirstEnabled: " + groupSearchFirstEnabled
+ ", userSearchEnabled: " + userSearchEnabled
+ ", ldapReferral: " + ldapReferral
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@ public class UserGroupSyncConfig {
private static final String LGSYNC_USER_SEARCH_ENABLED = "ranger.usersync.user.searchenabled";
private static final boolean DEFAULT_LGSYNC_USER_SEARCH_ENABLED = true;

private static final String LGSYNC_GROUP_USER_MAP_SYNC_ENABLED = "ranger.usersync.group.usermapsyncenabled";
private static final boolean DEFAULT_LGSYNC_GROUP_USER_MAP_SYNC_ENABLED = false;

private static final String LGSYNC_GROUP_SEARCH_BASE = "ranger.usersync.group.searchbase";

private static final String LGSYNC_GROUP_SEARCH_SCOPE = "ranger.usersync.group.searchscope";
Expand Down Expand Up @@ -778,17 +775,6 @@ public boolean isUserSearchEnabled() {
return userSearchEnabled;
}

public boolean isGroupUserMapSyncEnabled() {
boolean groupUserMapSyncEnabled;
String val = prop.getProperty(LGSYNC_GROUP_USER_MAP_SYNC_ENABLED);
if(val == null || val.trim().isEmpty()) {
groupUserMapSyncEnabled = DEFAULT_LGSYNC_GROUP_USER_MAP_SYNC_ENABLED;
} else {
groupUserMapSyncEnabled = Boolean.valueOf(val);
}
return groupUserMapSyncEnabled;
}

public String getGroupSearchBase() throws Throwable {
String val = prop.getProperty(LGSYNC_GROUP_SEARCH_BASE);
if(val == null || val.trim().isEmpty()) {
Expand Down
5 changes: 0 additions & 5 deletions ugsync/src/test/resources/ranger-ugsync-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@
<value>sub</value>
</property>

<property>
<name>ranger.usersync.group.usermapsyncenabled</name>
<value>true</value>
</property>

<property>
<name>ranger.usersync.group.search.first.enabled</name>
<value>false</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ SYNC_LDAP_USERNAME_CASE_CONVERSION = ranger.usersync.ldap.username.caseconversio
SYNC_LDAP_GROUPNAME_CASE_CONVERSION = ranger.usersync.ldap.groupname.caseconversion
logdir=ranger.usersync.logdir
SYNC_GROUP_SEARCH_ENABLED = ranger.usersync.group.searchenabled
SYNC_GROUP_USER_MAP_SYNC_ENABLED = ranger.usersync.group.usermapsyncenabled
SYNC_GROUP_SEARCH_BASE=ranger.usersync.group.searchbase
SYNC_GROUP_SEARCH_SCOPE=ranger.usersync.group.searchscope
SYNC_GROUP_OBJECT_CLASS=ranger.usersync.group.objectclass
Expand Down
4 changes: 0 additions & 4 deletions unixauthservice/scripts/templates/ranger-ugsync-template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
<name>ranger.usersync.group.searchscope</name>
<value></value>
</property>
<property>
<name>ranger.usersync.group.usermapsyncenabled</name>
<value></value>
</property>
<property>
<name>ranger.usersync.ldap.binddn</name>
<value></value>
Expand Down

0 comments on commit 07a70be

Please sign in to comment.