Managing Serverless Scripts
A serverless script is a script (program code) which allows you to perform some operations on regulated data without its leaving the origin country, so that you do not violate any local requirements on handling personal data.
You can perform the following operations on serverless scripts:
publishing new serverless scripts
re-publishing the existing serverless scripts
executing the published serverless scripts
note
The general requirements for a serverless script:
The script should be written in JavaScript.
The script should define a function which performs some business logic on regulated data.
When to use serverless scripts
You need to use serverless scripts for implementing custom scenarios for the redaction and restrictions data regulation models. If you are using the replication data regulation model, you do not need to use serverless scripts .
Primary use cases for serverless scripts are the following:
validation of record uniqueness by full name and/or email address
custom calculations of values for specific profiles
Serverless scripts allow you to execute custom operations on regulated data within the Point-of-Presence where it is originally stored and do not transfer it to your application server, which may automatically cause violation of the local compliance requirements and regulations.
Viewing serverless scripts
note
If you have no published scripts, the system will transition you to the page for publishing a new serverless script at the first opening of the Serverless section.
On the sidebar, select Serverless. The Upload certificate and private key form opens.
In the Upload certificate and private key form, upload the certificate and the private key you got when you created a serverless integration.
The Serverless page opens.
Here you can view the following information about the available serverless scripts:
Attribute | Description |
---|---|
Script Name | Name of a serverless script. |
Updated | Date and time of the latest serverless script update. |
Published | Date and time of the serverless script publication. |
Publishing a new serverless script
On the Serverless page, click Publish a new script.
On the opened page, specify the following information:
Script Name - name of a serverless script.
Country - select the country which a serverless script will be published to.
Rewrite existing script - check the box if you want to rewrite the already published script having the same name. If you are publishing a new script, leave this checkbox as is.
Script body - enter the serverless script.
When complete, click Publish.
Once you have published the script, within the breadcrumbs click Serverless. You will return to the list of published serverless scripts.
note
When you publish a serverless script, it is saved on InCountry Portal, then passed to REST API which saves it further to PoP API on the Point-of-Presence.
Republishing the serverless script
On the Serverless page, locate the serverless script you want to republish.
Click the Republish icon.
On the opened page, update the serverless script and check the Rewrite existing script box.
When complete, click Publish.
Executing the serverless script
On the Serverless page, locate the serverless script you want to execute.
Click the Execute icon.
On the opened page, add the parameters required for execution of the serverless script by clicking the plus icon.
For each added parameter, specify the following information:
Name - name of the parameter.
Value - value of the parameter.
If you have added some parameter by mistake, delete it by clicking the Delete icon.
When complete, click Execute.
note
When you execute a serverless script, REST API fetches the required serverless script by its name from PoP API and executes its code.
Changing integration keys
You may need to switch between serverless scripts that are mapped to different certificates and private keys to edit them and re-publish their modified versions.
On the Serverless page, click the Change integration keys icon.
You will be prompted to load the certificate and the private key.