From ffa1f53a6566165a090b48d4eb4841ab94333933 Mon Sep 17 00:00:00 2001 From: DedunuKarunarathne <46235093+DedunuKarunarathne@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:13:07 +0530 Subject: [PATCH] Inject Remote Parameters into the Entitlement Mediator Inject Remote Parameters into the Entitlement Mediator. Fixes:wso2/product-micro-integrator#3798 --- .../identity/entitlement/mediator/EntitlementMediator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/mediation/mediators/entitlement-mediator/org.wso2.micro.integrator.identity.entitlement.mediator/src/main/java/org/wso2/micro/integrator/identity/entitlement/mediator/EntitlementMediator.java b/components/mediation/mediators/entitlement-mediator/org.wso2.micro.integrator.identity.entitlement.mediator/src/main/java/org/wso2/micro/integrator/identity/entitlement/mediator/EntitlementMediator.java index ce73b6e842..fd3abbd242 100644 --- a/components/mediation/mediators/entitlement-mediator/org.wso2.micro.integrator.identity.entitlement.mediator/src/main/java/org/wso2/micro/integrator/identity/entitlement/mediator/EntitlementMediator.java +++ b/components/mediation/mediators/entitlement-mediator/org.wso2.micro.integrator.identity.entitlement.mediator/src/main/java/org/wso2/micro/integrator/identity/entitlement/mediator/EntitlementMediator.java @@ -37,6 +37,7 @@ import org.apache.synapse.SynapseConstants; import org.apache.synapse.SynapseException; import org.apache.synapse.SynapseLog; +import org.apache.synapse.commons.resolvers.ResolverFactory; import org.apache.synapse.config.SynapseConfiguration; import org.apache.synapse.continuation.ContinuationStackManager; import org.apache.synapse.continuation.ReliantContinuationState; @@ -479,9 +480,9 @@ public void init(SynapseEnvironment synEnv) { callback = new UTEntitlementCallbackHandler(); } - String remoteServiceUrlResolved = remoteServiceUrl; - String remoteServiceUsernameResolved = remoteServiceUserName; - String remoteServicePasswordResolved = remoteServicePassword; + String remoteServiceUrlResolved = ResolverFactory.getInstance().getResolver(remoteServiceUrl).resolve(); + String remoteServiceUsernameResolved = ResolverFactory.getInstance().getResolver(remoteServiceUserName).resolve(); + String remoteServicePasswordResolved = ResolverFactory.getInstance().getResolver(remoteServicePassword).resolve(); if (remoteServiceUrlKey != null && remoteServiceUrlKey.trim().length() > 0) { remoteServiceUrlResolved = resolveRegistryEntryText(synEnv, remoteServiceUrlKey);