|
23 | 23 | import org.apache.axis2.context.OperationContext;
|
24 | 24 | import org.apache.axis2.context.ServiceContext;
|
25 | 25 | import org.apache.axis2.description.InOutAxisOperation;
|
| 26 | +import org.apache.commons.lang3.StringUtils; |
26 | 27 | import org.apache.http.HttpHeaders;
|
27 | 28 | import org.apache.synapse.MessageContext;
|
28 | 29 | import org.apache.synapse.core.axis2.MessageContextCreatorForAxis2;
|
@@ -264,13 +265,19 @@ public static InboundProcessorResponseDTO validateDenyPolicies(InboundMessageCon
|
264 | 265 | String appLevelBlockingKey = "";
|
265 | 266 | String subscriptionLevelBlockingKey = "";
|
266 | 267 |
|
| 268 | + String authorizedUser = infoDTO.getEndUserName(); |
| 269 | + //Check if the tenant domain is appended with authorizedUser and append if it is not there |
| 270 | + if (!StringUtils.contains(authorizedUser, apiTenantDomain)) { |
| 271 | + authorizedUser = authorizedUser + "@" + apiTenantDomain; |
| 272 | + } |
| 273 | + |
267 | 274 | if (ServiceReferenceHolder.getInstance().getThrottleDataHolder().isBlockingConditionsPresent()) {
|
268 | 275 | appLevelBlockingKey = infoDTO.getSubscriber() + ":" + infoDTO.getApplicationName();
|
269 | 276 | subscriptionLevelBlockingKey = apiContext + ":" + apiVersion + ":" + infoDTO.getSubscriber() + ":"
|
270 | 277 | + infoDTO.getApplicationName() + ":" + infoDTO.getType();
|
271 | 278 | isBlockedRequest = ServiceReferenceHolder.getInstance().getThrottleDataHolder()
|
272 |
| - .isRequestBlocked(apiContext, appLevelBlockingKey, infoDTO.getEndUserName(), clientIp, |
273 |
| - apiTenantDomain, subscriptionLevelBlockingKey); |
| 279 | + .isRequestBlocked(apiContext, appLevelBlockingKey, authorizedUser, clientIp, apiTenantDomain, |
| 280 | + subscriptionLevelBlockingKey); |
274 | 281 | }
|
275 | 282 |
|
276 | 283 | if (isBlockedRequest) {
|
|
0 commit comments