User-defined policies in IBM API Connect

Create user-defined policies to control extra processing features in the Gateway server, such as security, or routing of requests. The user-defined policies feature is available only with the on-premise offering of IBM® API Connect.

When would you need a user-defined policy?

Create a user-defined policy in IBM API Connect when you need to augment the actions or activities that are performed by the API gateway. For example, you might want to perform the following operations:
  • Implement your own proprietary logic for dynamic routing of requests.
  • Enforce extra security constraints to your API.
  • Make accessible an extra capability that is provided in DataPower® that is not yet accessible in the IBM API Connect policy catalog.

How do user-defined policies work?

A user-defined policy is implemented in one of the following ways depending on the platform:
  • For an IBM DataPower Gateway, as a DataPower processing rule.
  • [Available in beta] For a Micro Gateway, as a Node.js module.
Note: User-defined policies for the Micro Gateway are marked as [Available in beta] to indicate that the implementation might change in a future release. IBM API Connect Micro Gateway is deprecated in IBM API Connect Version 5.0.8 in favor of DataPower Gateway. From 1 April 2020, Micro Gateway, and associated toolkit CLI commands, will no longer be supported. Existing users can migrate their API definitions to IBM DataPower Gateways. For information on supported API policies, see Built-in policies.
After a policy is imported into an IBM API Connect Catalog, the policy is available to be placed into an assembly flow of an enforced API. When the API is published, and invoked by an application, the API Gateway executes all policies that are associated with this API depending on the platform:
  • An API Gateway that is running in DataPower calls the IBM DataPower Gateway processing rules that those policies implement.
  • [Available in beta] A Micro Gateway runs the Node.js module that implements the policy.
The following diagram provides an overview of how to create and execute a user-defined policy in IBM API Connect.
Figure 1. The user-defined policy process
Diagram showing an overview of how to create and execute a user-defined policy in IBM API Connect.