Managing resident functions
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:
publishing new resident functions
re-publishing the existing resident functions
executing the published 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
Open the environment where you have created the
Resident Functions
service.Click the Services block.
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 integration creation. Upon the entry of the valid Client Secret, the New Function button becomes active and the list with resident functions is displayed.
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. |
Publishing a new resident function
Open the environment where you have created the
Resident Functions
service.Click the Services block.
On the list with services, locate the integration 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, the New Function button becomes active.
Click New 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.
You can switch to another service of the Resident Functions
type by selecting another service in the corresponding dropdown box and entering an appropriate Client Secret for this newly selected service.
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 Point-of-Presence.
Editing the resident function
On the list with resident functions, locate the resident function you want to edit.
Click the Edit icon.
On the opened page, update the resident function as required.
When complete, click Update.
Executing the resident function
On the list with resident functions, locate the resident function you want to edit.
Click the Execute 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, REST API fetches the required resident function by its name from PoP API and executes its code against records stored in the Point-of-Presence.
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.