Mutators (write APIs)

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:

  1. The initiating application or client sends a request to write data. This request includes:
    1. An array of SelectorValues, to be evaluated by the mutator's selector
    2. Client context data to be evaluated by the mutator's access policy
    3. User data
    4. User consents
  2. Utilizing the provided SelectorValues, the mutator's selector identifies the relevant user records to be updated. For a detailed explanation, visit our selector documentation.
  3. The mutator's access policy is then applied to each selected user record. 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.
  4. 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
  5. 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: