Older version2.8 ValvesInputInputParameterRegexValidatorValve

InputParameterRegexValidatorValve

Valve that validates an input parameter using a regular expression.

If input parameter is missing or the regular expression does not match, flow will fail ("Invalid request").

Uses java regex implementation: http://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html

Note: Escape requires double '\' ("regex" : ".+@example\\.com+").

Properties

Name Description Default value Mandatory Supports property expansion
param_name Name of input parameter to validate. Yes No
regex The regular expression. Yes No

Example Configuration

{      
  "name": "InputParameterRegexValidatorValve",
  "enabled": "true",
  "config": {
    "param_name": "mail",
    "regex": ".+@.+"
  }
}

Requirements