Deploy PingIntelligence policies
Deploying PingIntelligence policies in Akana API gateway is divided into three parts:
-
Adding an input script (config.js).
-
Adding PingIntelligence policy and applying the policy to APIs.
-
Adding RetainerHeader policy and applying the policy to APIs.
Complete the following steps to download and extract the PingIntelligence policy:
-
Download the PingIntelligence policy.
-
Extract the policies by using the following command:
# tar –zxvf <<file name>>
For example,
# tar –zxvf pi-api-akana-policy-4.1.1.tar.gz
Add Input script
Complete the following steps to add input script to API gateway:
-
Sign on to Akana Policy Manager, navigate to the Tenant, and click Scripts.
-
Click Add Script.
-
Enter Script Name and Script Description, and click Next.
-
Select JavaScript as Language from the list.
-
Copy the contents ofconfig.js script provided by PingIntelligence, and paste them into the Source.
-
Substitute the values of ‘Service_QName’, ‘Interface_Name’, and ‘Operation_Name’ that were captured in Capture ASE details step.This needs to be performed for both primary and secondary ASE nodes. The following table lists the variables in config.js that needs to be populated.
Variable Purpose ase_token
Variable to hold ASE sideband authentication token.
primary_ase_service
Service QName for primary ASE.
primary_ase_interface
Interface name for primary ASE.
primary_ase_request_operation
Operation Name for posting Request Metadata in primary ASE.
primary_ase_response_operation
Operation Name for posting Response Metadata in primary ASE.
secondry_ase_service
Service QName for secondary ASE
secondary_ase_interface
Interface name for secondary ASE
secondary_ase_request_operation
Operation Name for posting Request Metadata in secondary ASE.
secondary_ase_response_operation
Operation Name for posting Response Metadata in secondary ASE.
Here is a sample substitution snippet for reference:
var ase_token = "ASE-Token-123"; /Primary ASE Configuration/ var primary_ase_service = "{pi-as-ase-primary_0.0.0}svc_314492f1-ecdc-4184-93a0-57ee2258154b.smshargi.sandbox"; var primary_ase_interface = "{pi-as-ase-primary_0.0.0}pi-as-ase-primary_PortType_0"; var primary_ase_request_operation = "postRequestMetadata"; var primary_ase_response_operation = "postResponseMetadata"; /**/ /Secondary ASE Configuration/ var secondry_ase_service = "{pi-as-ase-primary_0.0.0}svc_314492f1-ecdc-4184-93a0-57ee2258154b.smshargi.sandbox"; var secondary_ase_interface = "{pi-as-ase-primary_0.0.0}pi-as-ase-primary_PortType_0"; var secondary_ase_request_operation = "postRequestMetadata"; var secondary_ase_response_operation = "postResponseMetadata";
-
Click Finish, and then click Close.
Add PingIntelligence policy
Complete the following steps to add a PingIntelligence policy to Akana gateway:
-
Sign on to Akana Policy Manager and navigate to the Tenant. Under Policies, click Operational Policies.
-
Select Add Policy option. Select Policy Type as Private Operational Script Policy from the list, and click Next.
-
Provide Policy Name and Description, click Finish and then click Close.
-
Navigate to Workbench.
-
In the Private Operational Script Policy section, select the policy name, and click Modify.
-
Click on Imports. Select the script added in Add Input Script step above and import it by clicking <<.
-
Select JavaScript as language Language from the list.
-
Copy the contents of pi_policy.js script, and paste them into Expression inSource.
-
Click Finish and then click Close.
-
In the WorkFlow Actions click Activate Policy to activate the PingIntelligence policy.
Apply the PingIntelligence policy to APIs
The PingIntelligence Policy can be applied at tenant level, org level and at individual API level. The following steps explain the process of adding a policy at API level.
-
Login to Akana Portal.
-
To apply policy at per API level:
-
Click on the API name.
-
In the left window pane, click Implementation.
-
Click API implementation name icon. Possible values for API implementation could be (Live/Sandbox/Development).
-
Click Edit in Policies section.
-
Find the PingIntelligence policy in the Available Policies pane, and click Attach under PingIntelligence policy.
-
Click Save.
-
Add RetainHeader policy
Complete the following steps to add RetainHeader Policy to Akana Gateway:
-
Login to Akana Policy Manager, and navigate to the Tenant. Under Policies, click Operational Policies.
-
Select Add Policy option.
-
Select Policy Type as Private Operational Script Policy from the list, and click Next.
-
Provide Policy Name and Description, click Finish and then click Close
-
Navigate to Workbench.
-
In the Private Operational Script Policy section, select the policy name, and click Modify.
-
Select JavaScript as language in ScriptLanguage from the list.
-
Copy the contents of retain-header-policy.js script and paste them into Expression.
-
Select Pre-policy auditing from Function.
-
Click Finish and then click Close.
-
In the WorkFlow Actions click Activate Policy to activate the RetainHeader policy.
Apply the RetainHeader policy to APIs
The RetainHeader Policy can be applied at tenant level, org level and at individual API level. The following steps explain the process of adding a policy at API level.
-
Sign on to Akana Portal.
-
To apply policy at per API level:
-
Click on the API name.
-
In the left window pane, click Implementation on the left pane.
-
Click API implementation name icon. Possible values for API implementation could be (Live/Sandbox/Development).
-
Click Edit in Policies section.
-
Find the RetainHeader Policy in Available Policies pane, and click Attach under RetainHeader Policy.
-
Click Save.
-