If a user wants to filter out only API type block conditions from the list above, they can query as follows:
https://localhost:9443/api/am/admin/v4/throttling/deny-policies?query=conditionType:API
If the user wants to filter out API type block conditions that are added for the exact API context and version, such as /pizzashack/1.0.0, then the user can query using:
https://localhost:9443/api/am/admin/v4/throttling/deny-policies?query=conditionType:API&conditionValue:/pizzashack/1.0.0
There are some edge cases when filtering the /test API context using the below ways:
https://localhost:9443/api/am/admin/v4/throttling/deny-policies?query=conditionType:API&conditionValue:/test/1.0.0 -> Only this block condition
https://localhost:9443/api/am/admin/v4/throttling/deny-policies?query=conditionType:API&conditionValue:/test -> both /test/1.0.0 and /test/abc/1.0.0 conditions
Purpose
To add filters to the management REST API for blacklisting at https://localhost:9443/api/am/admin/v4/throttling/deny-policies. The filters will filter out block conditions based on API context and version for the API type block conditions.
Example behavior:
Imagine a situation where there are multiple entries for block conditions as follows:
If a user wants to filter out only API type block conditions from the list above, they can query as follows:
https://localhost:9443/api/am/admin/v4/throttling/deny-policies?query=conditionType:API
If the user wants to filter out API type block conditions that are added for the exact API context and version, such as /pizzashack/1.0.0, then the user can query using:
https://localhost:9443/api/am/admin/v4/throttling/deny-policies?query=conditionType:API&conditionValue:/pizzashack/1.0.0
There are some edge cases when filtering the /test API context using the below ways:
https://localhost:9443/api/am/admin/v4/throttling/deny-policies?query=conditionType:API&conditionValue:/test/1.0.0
-> Only this block conditionhttps://localhost:9443/api/am/admin/v4/throttling/deny-policies?query=conditionType:API&conditionValue:/test/abc/1.0.0
-> Only this block conditionhttps://localhost:9443/api/am/admin/v4/throttling/deny-policies?query=conditionType:API&conditionValue:/test
-> both /test/1.0.0 and /test/abc/1.0.0 conditionsImportant:
https://github.com/wso2/carbon-apimgt/pull/12461/files#diff-833d66b2c304471172f7cf9a088df847a742e0f4832cb0ac10e3818165eae730R1342
Goal
Fixes: https://github.com/wso2/api-manager/issues/2878