Mutators (write paths)
Introduction
Mutators are configurable APIs that allow a client to write data to the User Store. Mutators (setters) can be thought of as the complement to accessors (getters). Mutators serve two functions:
- Storing sensitive user data in the store
- Storing user consents to data processing purposes alongside that data
How Mutators Work
Writing data and consents through mutators involves several key steps:
- The initiating application or client sends a request to write data. This request includes:
- An array of SelectorValues, to be evaluated by the mutator's selector
- Client context data to be evaluated by the mutator's access policy
- User data
- User consents
- Utilizing the provided SelectorValues, the mutator's selector identifies the relevant user records to be updated. For a detailed explanation, visit our selector documentation.
- Two access policies are applied to each selected user record: the global baseline policy for mutators (learn more here) and the mutator's own access policy composition. This step may involve evaluating the provided client context or any user-specific data already present in the User Store to determine if the write operation is permitted for each selector user record.
- For those records that pass the access policy check, the mutator proceeds to validate and transform the incoming data to ensure it meets the required standards
- Finally, the processed data, along with the associated user consents, are securely stored in the User Store
Structure of a Mutator
At creation time, each mutator is associated with a user record selector, a set of columns, a set of data transformers and an access policy.
- The record selector is a SQL-like clause that specifies which records the mutator should edit data for, based on an array of values that are passed at execution time.
- The columns indicate which data field the mutator will edit.
- Each column is associated with a transformer which validates and normalizes the format of the data
- The access policy determines the circumstances in which the write is allowed. Access policies run on each user record and prevent writes to user records which fail the access policy.
Learn More
For more info on mutators, see:
Updated 3 months ago
What’s Next