Class SecurityConstraintMapping
java.lang.Object
org.apache.camel.component.netty.http.SecurityConstraintMapping
- All Implemented Interfaces:
SecurityConstraint
A default
SecurityConstraint
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 uses
PatternHelper.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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExclusion
(String constraint) void
addInclusion
(String constraint) void
addInclusion
(String constraint, String roles) restricted
(String url) Performs a security restricted check for the given web resource.void
setExclusions
(Set<String> exclusions) void
setInclusions
(Map<String, String> inclusions)
-
Constructor Details
-
SecurityConstraintMapping
public SecurityConstraintMapping()
-
-
Method Details
-
restricted
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
-
addInclusion
-
addExclusion
-
setInclusions
-
setExclusions
-