Package com.tnsai.guardrails.pii
Class PiiInputValidator
java.lang.Object
com.tnsai.guardrails.pii.PiiInputValidator
- All Implemented Interfaces:
InputValidator
Heuristic detector for common PII carried in action parameters.
The detector recognizes practical email and phone forms, IBAN-shaped identifiers, Luhn-valid 13–19 digit payment-card numbers, US SSN-shaped identifiers, and checksum-valid Turkish national identity numbers. It is deliberately not a legal or jurisdiction-complete PII classifier.
- Since:
- 0.14.0 (TAN-3016)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the value is safe to dispatch.booleanReturns whether this validator also protects parameter names before value validation.
-
Constructor Details
-
PiiInputValidator
public PiiInputValidator()Creates a stateless validator.
-
-
Method Details
-
isValid
Description copied from interface:InputValidatorReturns whether the value is safe to dispatch.- Specified by:
isValidin interfaceInputValidator- Parameters:
input- string parameter value, nevernull- Returns:
truewhen the value may continue through the action pipeline
-
validatesParameterNames
public boolean validatesParameterNames()Description copied from interface:InputValidatorReturns whether this validator also protects parameter names before value validation. Domain validators normally leave this disabled; security classifiers that treat keys as user-visible prompt data may opt in.- Specified by:
validatesParameterNamesin interfaceInputValidator- Returns:
truewhen parameter names must passInputValidator.isValid(String)
-