Skip to content

Commit

Permalink
RANGER-5007: Expose service configs in RangerBasePlugin (#414)
Browse files Browse the repository at this point in the history
* RANGER-5007: Expose service configs in RangerBasePlugin

* RANGER-5007: review comments
  • Loading branch information
fateh288 authored Nov 25, 2024
1 parent 925ed23 commit 806fd9d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class RangerBasePlugin {
private final List<RangerChainedPlugin> chainedPlugins;
private final boolean dedupStrings;
private boolean isUserStoreEnricherAddedImplcitly = false;
private Map<String, String> serviceConfigs;


public RangerBasePlugin(String serviceType, String appId) {
Expand Down Expand Up @@ -308,7 +309,7 @@ public void setPolicies(ServicePolicies policies) {
if (LOG.isDebugEnabled()) {
LOG.debug("==> setPolicies(" + policies + ")");
}

this.serviceConfigs = (policies != null && policies.getServiceConfig() != null) ? policies.getServiceConfig() : new HashMap<>();
if (pluginConfig.isEnableImplicitUserStoreEnricher() && policies != null && !ServiceDefUtil.isUserStoreEnricherPresent(policies)) {
String retrieverClassName = pluginConfig.get(RangerUserStoreEnricher.USERSTORE_RETRIEVER_CLASSNAME_OPTION, RangerAdminUserStoreRetriever.class.getCanonicalName());
String retrieverPollIntMs = pluginConfig.get(RangerUserStoreEnricher.USERSTORE_REFRESHER_POLLINGINTERVAL_OPTION, Integer.toString(60 * 1000));
Expand Down Expand Up @@ -1241,6 +1242,10 @@ public static RangerResourceACLs getMergedResourceACLs(RangerResourceACLs baseAC
return baseACLs;
}

public Map<String, String> getServiceConfigs() {
return serviceConfigs;
}

protected RangerPolicyEngine getPolicyEngine() {
return policyEngine;
}
Expand Down

0 comments on commit 806fd9d

Please sign in to comment.