public abstract class WhiteBlackExpressionSecurityAdapter extends Object implements SecurityAdapter<String>
| Modifier and Type | Field and Description | 
|---|---|
| protected Pattern | blackRegExPattern | 
| protected Pattern | whiteRegExPattern | 
REGEX_PROP_FILE| Constructor and Description | 
|---|
| WhiteBlackExpressionSecurityAdapter() | 
| WhiteBlackExpressionSecurityAdapter(Pattern blackRegExPattern,
                                   Pattern whiteRegExPattern) | 
| WhiteBlackExpressionSecurityAdapter(String blackRegEx,
                                   String whiteRegEx) | 
| Modifier and Type | Method and Description | 
|---|---|
| Pattern | getBlackRegExPattern() | 
| Pattern | getWhiteRegExPattern() | 
| protected void | processInvalidQuery(Data<String> input) | 
| protected void | processNameValue(String name,
                String value)Used by  processParams(Data) | 
| protected void | processParams(Data<String> input)If there are param pairs then process them pair wise | 
| Data<String> | sanitize(Data<String> input)Sanitize content, from malicious to harmless. | 
| void | setBlackRegExPattern(Pattern blackRegExPattern) | 
| void | setWhiteRegExPattern(Pattern whiteRegExPattern) | 
| void | validate(Data<String> input)Check if the input is safe or not
  When used in a chained or a SecurityContextwith otherSecurityAdapters then the Adapters throwing
 aOperationNotSupportedExceptionwill be ignored. | 
| protected void | validateAgainstBlackRegEx(Data<String> input) | 
| protected void | validateAgainstWhiteRegEx(Data<String> input) | 
protected Pattern blackRegExPattern
protected Pattern whiteRegExPattern
public WhiteBlackExpressionSecurityAdapter()
public WhiteBlackExpressionSecurityAdapter(String blackRegEx, String whiteRegEx)
public Data<String> sanitize(Data<String> input) throws org.owasp.validator.html.ScanException, org.owasp.validator.html.PolicyException, OperationNotSupportedException
SecurityAdapterOperationNotSupportedException.
 When used in a chained or a SecurityContext with other SecurityAdapters then the Adapters throwing
 a OperationNotSupportedException will be ignored. Any other exception will be thrown if there is
 an issue in the executionof the sanitization process.sanitize in interface SecurityAdapter<String>org.owasp.validator.html.ScanExceptionorg.owasp.validator.html.PolicyExceptionOperationNotSupportedExceptionpublic void validate(Data<String> input) throws SecurityException, IOException
SecurityAdapterSecurityContext with other SecurityAdapters then the Adapters throwing
 a OperationNotSupportedException will be ignored.validate in interface SecurityAdapter<String>input - as DataSecurityException - is its is not safe. This is to provide additional details about the failure that te return param cannot.IOException - for any type of setup, reading, infra related issue with files/configsprotected void validateAgainstBlackRegEx(Data<String> input) throws SecurityException, IOException
SecurityExceptionIOExceptionprotected void validateAgainstWhiteRegEx(Data<String> input) throws SecurityException, IOException
SecurityExceptionIOExceptionprotected void processParams(Data<String> input) throws SecurityException, IOException
input - SecurityExceptionIOExceptionprotected void processNameValue(String name, String value) throws SecurityException, IOException
processParams(Data)name - value - SecurityExceptionIOExceptionprotected void processInvalidQuery(Data<String> input) throws SecurityException, IOException
SecurityExceptionIOExceptionpublic Pattern getBlackRegExPattern()
public void setBlackRegExPattern(Pattern blackRegExPattern)
public Pattern getWhiteRegExPattern()
public void setWhiteRegExPattern(Pattern whiteRegExPattern)
Copyright © 2018. All rights reserved.