Resident Functions - Portal
A resident function is a script (program code) that allows you to perform some operations on regulated data without its leaving the country of origin, so that you do not violate any local requirements on handling personal data.
You can perform the following operations on resident functions:
The general requirements for a resident function:
-
The script should be written in JavaScript.
-
The script should define a function which performs some business logic on regulated data.
When to use resident functions
You need to use resident functions for implementing custom scenarios for the redaction and restriction data regulation models. If you are using the replication data regulation model, you do not need to use resident functions.
Primary use cases for resident functions are the following:
-
Validation of record uniqueness by full name and/or email address.
-
Custom calculations of values for specific profiles.
Resident functions 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 resident functions
-
Expand the environment and country in the left sidebar where you have created the
Resident Functions
service. -
Click the Services menu item.
-
On the list with services, locate the service of the
Resident Functions
type. -
Click the Resident functions icon. You may be prompted to enter the Client Secret pertaining to the service of the
Resident Functions
type. -
On the opened page, enter the Client Secret that you received upon the service creation. Upon the entry of a valid Client Secret, the New Function button becomes active and the list of resident functions is displayed if any functions exist.
Here you can view the following information about the available resident functions:
Attribute | Description |
---|---|
Name | Name of a resident function. |
Created | Date when a resident function was created. |
Updated | Date when a resident function was updated. |
Adding a new resident function
-
Expand the environment and country in the left sidebar where you want to add a resident function.
-
Click the Services menu item.
-
On the list with services, locate the service of the
Resident Functions
type. -
Click the Resident functions icon.
-
On the opened page, enter the client secret that you received upon the service creation. Upon the entry of the valid client secret, you will see the list of resident functions or a page with the empty state.
-
Click Add function.
-
On the opened page, specify the following information:
-
Function name - enter the name of a resident function.
-
Function body - enter the code of the resident function.
-
-
When complete, click Publish.
Once you have published a resident function, you can call it and execute against regulated data stored on InCountry DRaaS.
When you publish a resident function, it is saved on InCountry Portal, then passed to REST API which saves it further to PoP API on the InCountry platform.
Editing the resident function
-
On the list with resident functions, locate the resident function you want to edit.
-
Click the Configure icon.
-
On the opened page, update the resident function’s code as required.
-
When complete, click Update.
Once the resident function has been published, you cannot modify its name.
Executing the resident function
-
On the list with resident functions, locate the resident function you want to edit.
-
Click the Configure icon.
-
On the opened page, add the parameters required for the execution of the resident function by clicking Add parameter.
-
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 Remove icon.
-
When complete, click Execute. The resident function will output the execution results into the console.
When you execute a resident function, the REST API fetches the required resident function by its name from PoP API and executes its code against records stored on the InCountry platform.
Deleting the resident function
-
On the list with resident functions, locate the resident function you want to delete.
-
Click the Delete icon.
-
Confirm the removal of the resident function.