From 806fd9d323a6536646d778537d399fbc7be159a0 Mon Sep 17 00:00:00 2001 From: Fateh Singh Date: Mon, 25 Nov 2024 14:31:26 -0800 Subject: [PATCH] RANGER-5007: Expose service configs in RangerBasePlugin (#414) * RANGER-5007: Expose service configs in RangerBasePlugin * RANGER-5007: review comments --- .../org/apache/ranger/plugin/service/RangerBasePlugin.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java b/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java index 6a614bf2d6..5a9fffaef9 100644 --- a/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java +++ b/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java @@ -76,6 +76,7 @@ public class RangerBasePlugin { private final List chainedPlugins; private final boolean dedupStrings; private boolean isUserStoreEnricherAddedImplcitly = false; + private Map serviceConfigs; public RangerBasePlugin(String serviceType, String appId) { @@ -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)); @@ -1241,6 +1242,10 @@ public static RangerResourceACLs getMergedResourceACLs(RangerResourceACLs baseAC return baseACLs; } + public Map getServiceConfigs() { + return serviceConfigs; + } + protected RangerPolicyEngine getPolicyEngine() { return policyEngine; }