Policies - Overview
Policy
A policy is a set of rules or actions applied to your API during runtime. It controls
how the API behaves when running. Policies can help secure your API, limit calls,
transform data, or log what is happening during the process.
Policy Templates
Policy templates are predefined collections of policies that can be applied to
multiple API proxies. They help save time and keep configurations consistent. For
example, you can build a template from an existing API proxy and reuse it across
others.
Proxy Endpoint
The proxy endpoint is the entry point where clients send their requests. It defines
how your API is exposed to the outside world. This includes configuring the URL,
applying security settings, and managing how requests and responses are
processed.
Target Endpoint
The target endpoint is where the API proxy forwards the request to the backend
system, such as an SAP CPI iFlow, a database, or another API. It defines the
backend destination and how the response is handled.
Flow
A flow is the processing pipeline that controls how the API handles requests and
responses. It consists of two parts: the request flow for incoming requests and the
response flow for outgoing responses. Each flow has three stages: Preflow,
Conditional Flow, and Postflow. Preflow runs first for initial actions, Conditional
Flow runs only if certain conditions are met, and Postflow runs last to complete the
process.
Preflow
Preflow runs first and is used for actions that must be executed at the very
beginning, such as security validation or adding headers.
https://www.linkedin.com/in/sandeep371
Conditional Flow
Conditional Flow runs after Preflow and only executes if a specific condition is
met. The system evaluates conditions in order and executes the first matching flow.
Postflow
Postflow runs after all other processing steps and is used for cleanup, final
modifications, or logging. A special case called PostClientFlow is used to log
details that are only available after the response has been sent to the client.
Scripts
Scripts allow you to add custom logic where built-in policies do not meet your
needs. You can write scripts using JavaScript or Python to modify message
content, add headers, or perform calculations.
https://www.linkedin.com/in/sandeep371