Class DefaultFilterInvocationSecurityMetadataSource
- All Implemented Interfaces:
org.springframework.aop.framework.AopInfrastructureBean
,SecurityMetadataSource
,FilterInvocationSecurityMetadataSource
- Direct Known Subclasses:
ExpressionBasedFilterInvocationSecurityMetadataSource
Stores an ordered map of RequestMatcher
s to ConfigAttribute
collections and provides matching of FilterInvocation
s against the items stored
in the map.
The order of the RequestMatcher
s in the map is very important. The first
one which matches the request will be used. Later matchers in the map will not be
invoked if a match has already been found. Accordingly, the most specific matchers
should be registered first, with the most general matches registered last.
The most common method creating an instance is using the Spring Security namespace. For
example, the pattern
and access
attributes of the
<intercept-url>
elements defined as children of the <http>
element are
combined to build the instance used by the FilterSecurityInterceptor
.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultFilterInvocationSecurityMetadataSource
(LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap) Sets the internal request map from the supplied map. -
Method Summary
Modifier and TypeMethodDescriptionIf available, returns all of theConfigAttribute
s defined by the implementing class.getAttributes
(Object object) Accesses theConfigAttribute
s that apply to a given secure object.boolean
Indicates whether theSecurityMetadataSource
implementation is able to provideConfigAttribute
s for the indicated secure object type.
-
Field Details
-
logger
protected final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
DefaultFilterInvocationSecurityMetadataSource
public DefaultFilterInvocationSecurityMetadataSource(LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap) Sets the internal request map from the supplied map. The key elements should be of typeRequestMatcher
, which. The path stored in the key will depend on the type of the supplied UrlMatcher.- Parameters:
requestMap
- order-preserving map of request definitions to attribute lists
-
-
Method Details
-
getAllConfigAttributes
Description copied from interface:SecurityMetadataSource
If available, returns all of theConfigAttribute
s defined by the implementing class.This is used by the
AbstractSecurityInterceptor
to perform startup time validation of eachConfigAttribute
configured against it.- Specified by:
getAllConfigAttributes
in interfaceSecurityMetadataSource
- Returns:
- the
ConfigAttribute
s ornull
if unsupported
-
getAttributes
Description copied from interface:SecurityMetadataSource
Accesses theConfigAttribute
s that apply to a given secure object.- Specified by:
getAttributes
in interfaceSecurityMetadataSource
- Parameters:
object
- the object being secured- Returns:
- the attributes that apply to the passed in secured object. Should return an empty collection if there are no applicable attributes.
-
supports
Description copied from interface:SecurityMetadataSource
Indicates whether theSecurityMetadataSource
implementation is able to provideConfigAttribute
s for the indicated secure object type.- Specified by:
supports
in interfaceSecurityMetadataSource
- Parameters:
clazz
- the class that is being queried- Returns:
- true if the implementation can process the indicated class
-