Transformers allow you to retain select structure and information from the raw data for different use cases, like sorting alphabetically, common domain analysis or simply flowing through your systems without triggering validation errors. For example, if you want to conduct analysis assessing the differences in behavior between children and adults, you may use a data transformer to pass a string indicating
adult, instead of pulling raw Date of Birth from the store.
Transformers are used in two places:
- Each accessor (read API) is associated with a transformer per column, dictating how the data in that column is obscured or minimized when the accessor is called
- When a token is created, a data transformer is specified to dictate how the token should be generated from the raw data (and therefore what information, if any, should be retained in the token)
Let’s look at four possible transformers, to see how transformers work.
There are four types of transformers:
- PassThrough Transformers pass through the raw data, unchanged
- Data Transformers mask, categorize, inject noise or group raw data. They are used to retain the minimum characteristics of a piece of raw data for a particular task, without being resolvable back into the raw data.
- Tokenize By Value Transformers create a resolvable token with an associated access policy. If the value of the raw data later changes, the token will resolve to the value of the data at the point of transformation.
- Tokenize By Reference Transformers create a resolvable token with an associated access policy. If the value of the raw data later changes, the token will resolve to the latest value of the data.
A transformer consists of:
id- a unique transformer identifier, which can be used as a reference when creating accessors and tokens
Transform Type- as described above
Transform Function- a transform function with the signature
func(data Object, parameters Object) (Token | error)
Transform Parameters- a static JSON object (not containing un-encoded PII) that is available at runtime, allowing you to parameterize and reuse functions like "obfuscate all but the first X letters of these emails"
UserClouds has several off-the-shelf transformers for common use cases, like masking emails, national ID numbers and credit card details. However you can also create custom functions, in three ways:
- Call the CreateTransformer() API
- Create functions in the UserClouds UI
For more info on creating transformers, see our How To Guide on Creating a Transformer.
Updated 29 days ago