Class DefaultDeserializationTypeValidator
- java.lang.Object
-
- org.camunda.bpm.engine.impl.runtime.DefaultDeserializationTypeValidator
-
- All Implemented Interfaces:
DeserializationTypeValidator,WhitelistingDeserializationTypeValidator
public class DefaultDeserializationTypeValidator extends Object implements WhitelistingDeserializationTypeValidator
Validate a type against a list of allowed packages and classes. Allows a basic set of packages and classes without known security issues based on Jackson Databind's SubTypeValidator.
-
-
Field Summary
Fields Modifier and Type Field Description protected static Collection<String>ALLOWED_CLASSESprotected static Collection<String>ALLOWED_PACKAGESprotected Set<String>allowedClassesprotected Set<String>allowedPackages
-
Constructor Summary
Constructors Constructor Description DefaultDeserializationTypeValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidextractElements(String allowedElements, Set<String> set)protected booleanisClassNameAllowed(String className)protected booleanisPackageAllowed(String className)protected booleanisPackageAllowed(String className, Collection<String> allowedPackages)voidsetAllowedClasses(String deserializationAllowedClasses)Set the allowed class namesvoidsetAllowedPackages(String deserializationAllowedPackages)Set the allowed package namesbooleanvalidate(String className)Validate the class name
-
-
-
Field Detail
-
ALLOWED_PACKAGES
protected static final Collection<String> ALLOWED_PACKAGES
-
ALLOWED_CLASSES
protected static final Collection<String> ALLOWED_CLASSES
-
-
Method Detail
-
setAllowedClasses
public void setAllowedClasses(String deserializationAllowedClasses)
Description copied from interface:WhitelistingDeserializationTypeValidatorSet the allowed class names- Specified by:
setAllowedClassesin interfaceWhitelistingDeserializationTypeValidator
-
setAllowedPackages
public void setAllowedPackages(String deserializationAllowedPackages)
Description copied from interface:WhitelistingDeserializationTypeValidatorSet the allowed package names- Specified by:
setAllowedPackagesin interfaceWhitelistingDeserializationTypeValidator
-
validate
public boolean validate(String className)
Description copied from interface:DeserializationTypeValidatorValidate the class name- Specified by:
validatein interfaceDeserializationTypeValidator
-
isPackageAllowed
protected boolean isPackageAllowed(String className)
-
isPackageAllowed
protected boolean isPackageAllowed(String className, Collection<String> allowedPackages)
-
isClassNameAllowed
protected boolean isClassNameAllowed(String className)
-
-