Skip to content

Commit a7e74f7

Browse files
committed
Allow policy name matching with "_imported" suffix
1 parent 5ee9d1e commit a7e74f7

File tree

1 file changed

+4
-2
lines changed
  • components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl

1 file changed

+4
-2
lines changed

Diff for: components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1869,8 +1869,10 @@ private List<OperationPolicy> validatePolicies(List<OperationPolicy> apiPolicies
18691869
+ " policy is not found.", ExceptionCodes.INVALID_OPERATION_POLICY);
18701870
}
18711871

1872-
if (!policyData.getSpecification().getName().equals(policy.getPolicyName()) ||
1873-
!policyData.getSpecification().getVersion().equals(policy.getPolicyVersion())) {
1872+
boolean isPolicyNameMatch = policyData.getSpecification().getName().equals(policy.getPolicyName())
1873+
|| (policyData.getSpecification().getName()).equals(policy.getPolicyName() + "_imported");
1874+
if (!isPolicyNameMatch || !policyData.getSpecification().getVersion()
1875+
.equals(policy.getPolicyVersion())) {
18741876
throw new APIManagementException("Applied policy " + policy.getPolicyName()
18751877
+ "_" + policy.getPolicyVersion() + " does not match the specification");
18761878
}

0 commit comments

Comments
 (0)