You can use the resource-filtering
policy to filter REST resources. By applying this filter, you can restrict or allow access to
a specific resource determined by a path and a method (or an array of methods).
This policy is mainly used in plan configuration, to limit subscriber access to specific resources only.
A typical usage would be to allow access to all paths (/**
) but in read-only mode (GET method).
Warning
|
You can’t apply whitelisting and blacklisting to the same resource. Whitelisting takes precedence over blacklisting. |
Property | Required | Description | Type | Default |
---|---|---|---|---|
whitelist |
- |
List of allowed resources |
array of |
- |
blacklist |
- |
List of restricted resources |
array of |
- |
A resource is defined as follows:
Property | Required | Description | Type | Default |
---|---|---|---|---|
pattern |
X |
string |
- |
|
methods |
- |
List of HTTP methods for which filter is applied. |
array of HTTP methods |
All HTTP methods |
Code | Message |
---|---|
|
Access to the resource is forbidden according to resource-filtering rules |
|
Method not allowed while accessing this resource |
You can use the response template feature to override the default responses provided by the policy. These templates must be defined at the API level (see the API Console Response Templates option in the API Proxy menu).