Skip to content

Commit 53140c7

Browse files
RANGER-5215 : Policy authroisation fails for Ranger Plugins in case of users/groups converted by Ranger userysnc as per given Regex
1 parent 5216966 commit 53140c7

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ public RangerBasePlugin(RangerPluginConfig pluginConfig, ServicePolicies policie
210210
this(pluginConfig);
211211

212212
init();
213-
configurePluginContextFromServicePoliciesForUserGroupName(policies);
214213
setPolicies(policies);
215214
setRoles(roles);
216215

@@ -443,7 +442,7 @@ public long getUserStoreVersion() {
443442

444443
public void setPolicies(ServicePolicies policies) {
445444
LOG.debug("==> setPolicies({})", policies);
446-
445+
configurePluginContextFromServicePoliciesForUserGroupName(policies);
447446
this.serviceConfigs = (policies != null && policies.getServiceConfig() != null) ? policies.getServiceConfig() : new HashMap<>();
448447

449448
if (pluginConfig.isEnableImplicitUserStoreEnricher() && policies != null && !ServiceDefUtil.isUserStoreEnricherPresent(policies)) {

security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,13 +2849,13 @@ public void updateServiceAuditConfig(String searchUsrGrpRoleName, REMOVE_REF_TYP
28492849

28502850
public Map<String, String> getLatestUgsyncConfig() {
28512851
Map<String, String> configs = new HashMap<String, String>();
2852-
configs.put(RangerCommonConstants.PLUGINS_USERNAME_CASE_CONVERSION_PARAM, PropertiesUtil.getProperty(UgsyncCommonConstants.UGSYNC_USERNAME_CASE_CONVERSION_PARAM,
2852+
configs.put(RangerCommonConstants.PLUGINS_USERNAME_CASE_CONVERSION_PARAM, PropertiesUtil.getProperty(RangerCommonConstants.PLUGINS_USERNAME_CASE_CONVERSION_PARAM,
28532853
UgsyncCommonConstants.DEFAULT_UGSYNC_USERNAME_CASE_CONVERSION_VALUE));
2854-
configs.put(RangerCommonConstants.PLUGINS_GROUPNAME_CASE_CONVERSION_PARAM, PropertiesUtil.getProperty(UgsyncCommonConstants.UGSYNC_GROUPNAME_CASE_CONVERSION_PARAM,
2854+
configs.put(RangerCommonConstants.PLUGINS_GROUPNAME_CASE_CONVERSION_PARAM, PropertiesUtil.getProperty(RangerCommonConstants.PLUGINS_GROUPNAME_CASE_CONVERSION_PARAM,
28552855
UgsyncCommonConstants.DEFAULT_UGSYNC_GROUPNAME_CASE_CONVERSION_VALUE));
2856-
configs.put(RangerCommonConstants.PLUGINS_MAPPING_USERNAME_HANDLER, PropertiesUtil.getProperty(UgsyncCommonConstants.SYNC_MAPPING_USERNAME_HANDLER,
2856+
configs.put(RangerCommonConstants.PLUGINS_MAPPING_USERNAME_HANDLER, PropertiesUtil.getProperty(RangerCommonConstants.PLUGINS_MAPPING_USERNAME_HANDLER,
28572857
UgsyncCommonConstants.DEFAULT_SYNC_MAPPING_USERNAME_HANDLER));
2858-
configs.put(RangerCommonConstants.PLUGINS_MAPPING_GROUPNAME_HANDLER, PropertiesUtil.getProperty(UgsyncCommonConstants.SYNC_MAPPING_GROUPNAME_HANDLER,
2858+
configs.put(RangerCommonConstants.PLUGINS_MAPPING_GROUPNAME_HANDLER, PropertiesUtil.getProperty(RangerCommonConstants.PLUGINS_MAPPING_GROUPNAME_HANDLER,
28592859
UgsyncCommonConstants.DEFAULT_SYNC_MAPPING_GROUPNAME_HANDLER));
28602860
configs.put(RangerCommonConstants.PLUGINS_MAPPING_SEPARATOR, getRegexSeparator());
28612861
configs.putAll(getAllRegexPatternsConfig(RangerCommonConstants.PLUGINS_MAPPING_USERNAME));
@@ -2865,7 +2865,7 @@ public Map<String, String> getLatestUgsyncConfig() {
28652865

28662866
public String getRegexSeparator() {
28672867
String ret = UgsyncCommonConstants.DEFAULT_MAPPING_SEPARATOR;
2868-
String val = PropertiesUtil.getProperty(UgsyncCommonConstants.SYNC_MAPPING_SEPARATOR);
2868+
String val = PropertiesUtil.getProperty(RangerCommonConstants.PLUGINS_MAPPING_SEPARATOR);
28692869
if (StringUtils.isNotEmpty(val)) {
28702870
if (val.length() == 1) {
28712871
ret = val;

0 commit comments

Comments
 (0)