Class SecurityConstraintMapping
- java.lang.Object
-
- org.apache.camel.component.netty.http.SecurityConstraintMapping
-
- All Implemented Interfaces:
SecurityConstraint
public class SecurityConstraintMapping extends Object implements SecurityConstraint
A defaultSecurityConstraint
which can be used to define a set of mappings to as constraints. This constraint will match as true if no inclusions has been defined. First all the inclusions is check for matching. If a inclusion matches, then the exclusion is checked, and if any of them matches, then the exclusion will override the match and force returning false. Wildcards and regular expressions is supported as this implementation usesPatternHelper.matchPattern(String, String)
method for matching. This restricted constraint allows you to setup context path rules that will restrict access to paths, and then override and have exclusions that may allow access to public paths.
-
-
Constructor Summary
Constructors Constructor Description SecurityConstraintMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExclusion(String constraint)
void
addInclusion(String constraint)
void
addInclusion(String constraint, String roles)
String
restricted(String url)
Performs a security restricted check for the given web resource.void
setExclusions(Set<String> exclusions)
void
setInclusions(Map<String,String> inclusions)
-
-
-
Method Detail
-
restricted
public String restricted(String url)
Description copied from interface:SecurityConstraint
Performs a security restricted check for the given web resource. The returned value indicates which roles the user must be in to access the restricted resource.- Specified by:
restricted
in interfaceSecurityConstraint
- Parameters:
url
- the web resource- Returns:
- null if not restricted, otherwise * (wildcard) matches any roles, otherwise a comma separated String with roles
-
addInclusion
public void addInclusion(String constraint)
-
addExclusion
public void addExclusion(String constraint)
-
-