HTML Mask (HtmlMaskGenerator)
The HTML Mask generator masks text columns by parsing the contents as HTML, and applying sub-generators to specified path expressions.
If applying a sub-generator fails because of an error, the generator selected as the fallback generator is applied instead.
For the HTML Mask generator, there is a link object for each XPath expression value to assign a generator to.
pathExpression
contains the XPath expression, and subGeneratorId
identifies the generator to assign to the value for that XPath expression.The HTML Mask generator does not itself support consistency or differential privacy.
- The sub-generator type to apply to the value from
pathExpression
. - The
subGeneratorMetadata
object, which contains the generator configuration for the selected sub-generator.
{
"generatorId": "HtmlMaskGenerator",
"schema": "string",
"table": "string",
"column": "string",
"pathExpression": "string",
"subPresetId": "string",
"subGeneratorId": "string",
"metadata": {
"subPresetId": "string",
"subGeneratorId": "string",
"subGeneratorMetadata": {
//Metadata for the selected generator
}
}
"customValueProcessor": "string", //If custom value processor applied
"customSubGeneratorValueProcessor": "string" //If custom value processor applied to the sub-generator
}
In the following example replacement for the HTML Mask generator:
- The Character Scramble generator is assigned to the value of the XPath expression
//p
. Consistency is disabled. - The Company Name generator is assigned to the value of the XPath expression
//p/@data
. Consistency is disabled. - In the case of an error applying either of those generators, the fallback generator is the Constant generator, which sets the value to
10
.
{
"name": "html_data",
"schema": "public",
"table": "html_me",
"links": [
{
"generatorId": "HtmlMaskGenerator",
"presetId": "HtmlMaskGenerator",
"schema": "public",
"table": "html_me",
"column": "html_data",
"pathExpression": "//p",
"subPresetId": "TextMaskGenerator",
"subGeneratorId": "TextMaskGenerator",
"metadata": {
"subPresetId": "TextMaskGenerator",
"subGeneratorId": "TextMaskGenerator",
"subGeneratorMetadata": {
"isConsistent": false
}
}
},
{
"generatorId": "HtmlMaskGenerator",
"presetId": "HtmlMaskGenerator",
"schema": "public",
"table": "html_me",
"column": "html_data",
"pathExpression": "//p/@data",
"subPresetId": "CompanyNameGenerator",
"subGeneratorId": "CompanyNameGenerator",
"metadata": {
"subPresetId": "CompanyNameGenerator",
"subGeneratorId": "CompanyNameGenerator",
"subGeneratorMetadata": {
"isConsistent": false
}
}
}
],
"fallbackLinks": [
{
"presetId": "string",
"generatorId": "ConstantGenerator",
"schema": "public",
"table": "html_me",
"column": "html_data",
"metadata": {
"constant": "10"
}
}
]
}
Last modified 1mo ago