- 02 Feb 2024
- 3 Minutes to read
- Updated on 02 Feb 2024
- 3 Minutes to read
The Akana API Gateway serves as the entry point for external and internal API traffic. It acts as a mediator between clients (such as applications or devices) and the APIs hosted on the backend. The gateway is responsible for enforcing security policies, managing traffic, and ensuring that API requests and responses adhere to specified protocols. The gateway helps manage the flow of API traffic, implementing policies for rate limiting, throttling, and caching.
Traceable integrates with Akana API Gateway by providing a policy that captures requests and responses. Following is a high-level diagram showing the traffic flow through Traceable’s policy in Akana.
The following is an explanation of the traffic flow:
The client sends a request to Akana. This request passes through the Traceable’s Akana policy.
The policy captures the request and sends it to the Traceable Platform agent.
The request is forwarded to the application.
The application sends a response.
The policy captures the response and sends it to the Traceable Platform agent.
The response is sent to the client.
The request and response are sent to Traceable Platform from the Traceable Platform agent.
Before you begin
Make a note of the following points before proceeding with the configuration:
Make sure that the Traceable Platform agent is already installed. For more information on installation, see Platform agent.
Make a note of the Platform agent’s IP address. This would be required during the configuration.
Download Traceable’s Akana policy from Traceable’s download site.
Make sure you have an account in Akana.
Configuring Traceable policy for Akana consists of a few steps, as mentioned below:
Add Traceable Platform agent endpoint in Akana.
Fetch the variable values.
Add the configuration.
Add the Traceable policy.
Add the policy to the API.
Add Traceable Platform agent endpoint
Complete the following steps to create an API, add a Traceable agent endpoint, and create resources.
Login to your Akana account and navigate to APIs → Add API to create a new API. Provide the following details:
Enter a name for the API.
In the Endpoint field, enter the IP address or hostname of the Traceable Platform agent with port number 5442. You had installed the Traceable Platform agent as part of the prerequisite.
Set the Pattern as a Proxy.
Set the Visibility as private.
Click on Save to save the API. The API page is displayed.
Add the following two resources to the API that you added in the previous steps. Click on Add Resource.
Delete the default GET resource and click on Save.
Unzip the policy folder that you downloaded earlier. Two files are downloaded:
config.js- This file is used to configure the policy.
traceable_policy.js- This file is used to capture the request and response data.
Gather variable information
To proceed further with the configuration, you need to collect the value of the following four variables:
The value of the first two variables,
tpa_res_cap_operation, can be found by navigating to My APIs → Implementations → Processes, as shown in the two screenshots.
Click on Implementations and then on Processes to display the Processes page. You can fetch the value of the variables by hovering the cursor over the process name, as shown below.
You can fetch the value of
tpa_interface from the Policy Manager.
Add the configuration
To add the configuration, complete the following steps:
Navigate to More → Organizations → All Organization.
Click on Tenant.
Click on the Scripts → Add button on the tenant page.
Click on the Edit button on the Script page.
In the source section, add the code from
config.jsfile that you had downloaded earlier. Make sure to update the variables' values you fetched in the previous section.
Add the policy
Add the policy to Akana after you have completed the configuration in the previous section. To add the policy, navigate to Tenant as you did in the previous section and click on Policies → Add. Provide the following to create the policy and click on Save:
Name - Provide a name for the policy.
Policy category - Choose Operational Policy from the drop-down list.
Policy sub-type - Choose Private Operational Script Policy from the drop-down list.
Policy description - Give a description of the policy.
Edit the policy once you have saved the policy.
On the Script Policy page, complete the following and click on Finish:
In the Imports section, import the configuration that you created in the previous section.
In the Source section, copy and paste the code from the
traceable_policy.jsfile that you downloaded earlier.
Finally, Activate the policy as shown below.
Add Policy to API
For Traceable policy to start collecting data, it needs to be attached to an API. Navigate to the API to which you wish to attach the policy and complete the following steps:
Navigate to Implementations → Policies.
Under Policies, click Edit and attach the policy you created in the previous section.
Click on Attach and Save.
To verify a successful configuration, send data to Akana and view it in the Traceable Platform.