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.
On the Serverless page, click the Edit icon.
Enter the Client ID and Client Secret that pertain to the integration of the Serverless type.
Click the Apply icon.
The Serverless page opens. It will list serverless scripts that attribute to the serverless integration which Client ID and Client Secret you entered. 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.
You can switch to another integration of the serverless type by clicking the Edit icon and entering a different Client ID and Client Secret.
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.
Switching to another serverless integration
You may need to switch between integrations of the serverless type to execute serverless scripts or publish new ones.
On the Serverless page, click the Edit icon.
Enter the Client ID and Client Secret of another integration of the serverless type.
Click the Apply icon. InCountry Portal will load serverless scripts that attribute to the newly defined intgeration.