public class CodeSnifferSecurityAdapter extends Object implements SecurityAdapter<String>
REGEX_PROP_FILE| Constructor and Description |
|---|
CodeSnifferSecurityAdapter() |
| Modifier and Type | Method and Description |
|---|---|
String |
getChainDelim()
The delimeter within the chain
|
SecurityAdapter<String> |
getChainElementValidator() |
Pattern |
getChainRegionRegExPattern()
The region that defines the chain; inclusive of the literals ad delimiter
|
List<Character> |
getSingleEnclosureSymbols()
Single enclosures like ', ""
|
List<Character[]> |
getSymmetricEnclosureSymbols()
Symmetric enclosures like (),{},[]
Defines as List of Pairs (Arrays of 2 elements) |
Data<String> |
sanitize(Data<String> data)
Sanitize content, from malicious to harmless.
|
void |
setChainDelim(String chainDelim)
The delimiter within the chain
|
void |
setChainElementValidator(SecurityAdapter<String> chainElementValidator) |
void |
setChainRegionRegExPattern(Pattern chainRegionRegExPattern)
The region that defines the chain; inclusive of the literals ad delimiter
|
void |
setSingleEnclosureSymbols(List<Character> singleEnclosureSymbols)
Single enclosures like ', ""
|
void |
setSymmetricEnclosureSymbols(List<Character[]> symmetricEnclosureSymbols)
Symmetric enclosures like (),{},[]
Defines as List of Pairs (Arrays of 2 elements) |
void |
validate(Data<String> input)
Check if the input is safe or not
When used in a chained or a SecurityContext with other SecurityAdapters then the Adapters throwing
a OperationNotSupportedException will be ignored. |
public Data<String> sanitize(Data<String> data) throws Exception, 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>ExceptionOperationNotSupportedExceptionpublic void validate(Data<String> input) throws SecurityException, OperationNotSupportedException, 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/configsOperationNotSupportedExceptionpublic Pattern getChainRegionRegExPattern()
public void setChainRegionRegExPattern(Pattern chainRegionRegExPattern)
public String getChainDelim()
public void setChainDelim(String chainDelim)
public SecurityAdapter<String> getChainElementValidator()
SecurityAdapter.validate(Data) the chain element between the delimiterpublic void setChainElementValidator(SecurityAdapter<String> chainElementValidator)
SecurityAdapter.validate(Data) the chain element between the delimiterpublic List<Character> getSingleEnclosureSymbols()
public void setSingleEnclosureSymbols(List<Character> singleEnclosureSymbols)
public List<Character[]> getSymmetricEnclosureSymbols()
Copyright © 2018. All rights reserved.