Ana içeriğe atla

Message Flow and Policy Management

The Development tab is the tab where policies to be applied to request and response messages during message flow are configured. The interface is also designed to display this flow. This way, users can visually see which policies are applied in what order before a request message is sent to the Backend API, and which policies are applied in what order before the response message returned from the Backend API is delivered to the client. The flow between the Client and Backend API is shown with . Details of policies will not be covered in this section. For detailed information about policies, you can refer to the Policies page. is shown in the frame on the left side of the interface. The Client is the stakeholder that sends requests to the API Proxy. It initiates the flow. The message from the client reaches the Backend API after policies are applied. The Backend API is the original API that is closed to direct access from the client and hidden from the client, receives requests from the API Proxy and returns responses to the API Proxy. It is shown with the frame on the right side of the interface. The response from the Backend API is sent to the Client after policies are applied. When the API link in the Backend API box is clicked, the API Definition Document of the Backend API is displayed. Policies are configurations made to describe operations such as security, filtering, validation, transformation or enrichment of messages, partial business logic implementation, error management, etc. to be performed on request and response messages. API Gateway executes the policies introduced to it through these configurations during the message flow between the Client and Backend API. This section generally describes the operations that can be performed on policies. To learn detailed information about any policy, you can refer to the documentation related to that policy from the Policies section. Policies can be added to 3 different points: A policy added to an API Proxy Group is executed only if the request comes through the API Proxy Group. A policy added to an API Proxy is executed for all methods/endpoints of that API Proxy. A policy added to a method/endpoint is executed only for that method/endpoint. The following image shows an example of policies added to all 3 points. In the image, it can be seen that the API Proxy with the selected method/endpoint named GET - findByStatus is added to an API Proxy Group named Proxy Group - 1. The marked areas are the places where policies are displayed depending on where they are added. If this API Proxy is added to any API Proxy Group, there are policies in the added API Proxy Group, and the request comes through the API Proxy Group, then those on the request line are applied, and then the policies on the response line are also applied. However, these are not shown on this page. If any policy is added for any method/endpoint of the API Proxy, a gear icon appears next to the method/endpoint. If a specific method/endpoint of the API Proxy is not selected (or All is selected), 2 regions appear as shown in the following image. Policies are executed during the message flow; . At each level, policies at that level are processed according to the flow direction order of the message. The following image summarizes this situation and shows the execution order of policies numbered. Policies to be executed in case of error are added with the “Add Error Policy” option. If there is an error at any point in the flow, the normal flow is interrupted and first, if any, the error response template is applied to the error message. Then, the policies added to the “Error Policies” line are executed from right to left in order. To add a policy; When an existing policy icon is clicked, a window opens where that policy’s information can be updated. A policy can be temporarily deactivated without being deleted from the method/endpoint or API Proxy to which it was added. For this, the policy is opened for update and the Deactivate button at the top of the opened window is clicked. In the method/endpoint section, the Disable All Policies link appears at the bottom of the middle section. When this link is clicked, if All is selected, all policies added to the API Proxy are deactivated; if you are in any method, only all policies added within that method are deactivated. Deactivated policies can later be reactivated individually from the policy update window or collectively by clicking the Activate All Policies link. When policies are deactivated, the colors of the icons change to a gray appearance. If the API Proxy is added to an API Proxy Group and policies are applied through this API Proxy Group, disabling all policies does not affect the policies coming from the API Proxy Group, these policies remain active. When the mouse is hovered over a policy to be deleted, an icon appears that will delete the policy. The policy can be deleted by clicking this icon. In the policy deletion operation performed in the Development tab;

Message Flow

Client

Backend API

Policy Management

Policy Location and Execution Order

Policy Execution Order

Policy Execution Order in Case of Error

Adding Policy to Flow

Updating Policy in Flow

Activating/Deactivating Selected Policy

Activating/Deactivating All Policies

Removing Policy from Flow