PropertySplitByIndexValve

Splits a value (source) in two using index (position), new values are put in two separate attributes (destination_attribute_one & destination_attribute_two).

This valve was intended to be used in an authentication scenario where the user enters both password and otp in the same field.

Properties

Name Description Default value Mandatory Supports property expansion
source The name of the source property. Yes Yes
destination_attribute_one The destination attribute property for the first value after split. Yes No
destination_attribute_two The destination attribute property for the second value after split. Yes No
position Indicates at which character (including) the value should be split. Yes No

Example Configuration

{
        "name": "PropertySplitByIndexValve",
        "config": { 
              "source":"{{request.User-Password}}",
              "destination_attribute_one":"password",
              "destination_attribute_two":"otp",
              "position":"-6"
        }
}

More on position

The value set for position indicates both the length of the OTP and if the OTP is entered before or after the password.

The postion value -6 means an OTP with the length of 6 is placed after the password. (i.e. supersecret123456)

To set the OTP before the password the position value should be 6. (i.e. 123456secretsuper)

Requirements

item set must have exactly one entry.