Skip to main content
Skip table of contents

Segment mapping

See Segment Mapping for more information about this algorithm framework.

Creating a segment mapping algorithm via API

  1. Retrieve the frameworkIdfor the Segment Mapping Framework. This information can be retrieved using the following endpoint:

    CODE
    algorithm       GET /algorithm/frameworks

    The framework information should look similar to the following:

    CODE
    {
        "frameworkId": 6,
        "frameworkName": "Segment Mapping",
        "frameworkType": "STRING",
        "description": "The Segment Mapping Algorithm will ... [truncated for brevity].",
        "plugin": {
            "pluginId": 7,
            "pluginName": "dlpx-core",
            "pluginAuthor": "Delphix Engineering",
            "pluginType": "EXTENDED_ALGORITHM"
        }
    }
  2. Create a Segment Mapping algorithm instance via the following endpoint:

    CODE
    algorithm   POST /algorithms

    Configure a new algorithm using the JSON formatted input similar to the following:

    CODE
    {
        "algorithmName": "SegmentMappingTest",
        "algorithmType": "COMPONENT",
        "frameworkId": 6,
        "algorithmExtension": {
            "segments": [
                {
                    "length": 4,
                    "segmentType": "MASK_NUMERIC",
                    "inputValues": null,
                    "maskValues": null
                },
                {
                    "length": 1,
                    "segmentType": "PRESERVE"
                },
                {
                    "length": 2,
                    "segmentType": "MASK_ALPHANUMERIC",
                    "inputValues": "A,B,C,F-G",
                    "maskValues": "Q-S,X,Y,Z"
                }
            ],
            "ignoreCharacters": [],
            "autoIgnoreCharacters": true,
            "allowShortSegments": false,
            "processPreserveBeforeIgnore": false
        }
    }

Segment mapping algorithm extension

  • segments (required, minimum=1, maximum=10)

Array of Segment objects A list of Segment Mapping Segments defining the masking behavior in order. See Segment Mapping Segment Extension below for more information.

  • ignoreCharacters (optional)

Array of Integers A list of integer ASCII values of characters to ignore. For example, [44, 65] would ignore commas and the letter 'A'. These are removed from input value before masking and restored to their original positions after masking.

  • autoIgnoreCharacters (default=false)

Boolean Whether or not to ignore all non alpha-numeric characters. Use this as an alternative to specifying individual characters in ignoreCharacters.

  • allowShortSegments (default=false)

Boolean Whether or not to allow masking of short MASK_NUMERIC segments. When set to false, a MASK_NUMERIC segment cannot be masked if it is shorter than the defined segment length. If a short MASK_NUMERIC segment is encountered, a NonConformantDataException will be triggered. When set to true, a short MASK_NUMERIC segment may be masked. Note: If set to true and a MASK_NUMERIC segment is defined, the algorithm is not reversible and cannot be used for tokenization/re-identification.

  • processPreserveBeforeIgnore (default=false)

Boolean Whether or not to process PRESERVE segments before removing ignore characters. When set to false, ignore characters are removed from the input string first, and then all segments are processed in the order in which they are defined. When set to true, PRESERVE segment are processed first, before removing ignore characters, so the preserved segment positions are based on the original input string, which may include ignore characters. Afterwards, ignore characters are removed and the remaining string is masked according to the other segment definitions. Setting this to true is not recommended, as it may cause some segments to be processed out of order.

Segment mapping segment extension

  • length (required, minimum=1, maximum=6)

Integer The length of the segment in characters.

  • segmentType (required)

String The masking behavior for this segment. Enum values: - MASK_ALPHANUMERIC - mask letters to letters and digits to digits. Mappings are configured for each character position independently (e.g. AA -> GC, 'A' does not always mask to the same letter at each position) - MASK_NUMERIC - mask the entire segment as a single integer value to another integer value - PRESERVE - do not mask this segment - CONSTANT - mask any input value to a constant value

  • inputValues

String Defines the input values to mask in this segment, provided as either individual values, ranges, or a combination thereof. This field is optional for MASK_ALPHANUMERIC and MASK_NUMERIC, and if left blank or omitted (null), the default value ranges are used. This field is not used for PRESERVE or CONSTANT. For a MASK_ALPHANUMERIC segment, the default value range is '0-9,A-Z'. You can specify something like 'A-F,P,R,1-5,7,9'. For a MASK_NUMERIC segment, the default value range is 0 to the max integer that can fit into the segment length (ex: 000-999 for a segment of length 3). You can specify integer values and ranges, like '10,30,50-875'. The masking will only look to mask these values and will preserve any other values.

  • maskValues

String Defines the values to mask to for this segment. This is defined the same way as inputValues and has the same default value ranges. This field is optional for MASK_ALPHANUMERIC and MASK_NUMERIC, and if left blank or omitted (null), the default value ranges are used. This field is required for CONSTANT and not used for PRESERVE. Note: if the inputValues and maskValues are not the same, then the algorithm is not reversible and cannot be used for tokenization/re-identification.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.