wso2 / apk

Official Repository for APK distribution
Apache License 2.0
147 stars 89 forks source link

API Resource Level Interceptors doesn't work after adding a new resource from APIM #2253

Closed O-sura closed 2 months ago

O-sura commented 3 months ago

Description: When using APIM as the CP for the APK via agent, after redeploying an API(with resource level interceptors) after adding a new resource from the APIM make the resource level interceptors stop working. The observation was, after adding adding and deploying the API with the new resource, in CR updating/creation process the data related to interceptors gets removed from the API PolicyCR. However the agent generates the proper APK-Conf for that scenario, config-ds returns the CRs without attaching the interceptor details in the APIPolicyCR. This issue occurs only when there are multiple resources for an API.

Steps to reproduce:

  1. From the APIM, Create an API and add resource level interceptors for an endpoint.
  2. Try to invoke that endpoint and the interceptor should properly work.
  3. Go to API Configurations > Resources and add a new resource and redeploy the new revision.
  4. Again try to invoke the same endpoint and now the interceptor won't work as intended.