public class MessageSecurityMetadataSourceRegistry extends Object
MessageMatcher to the security
expressions.| Modifier and Type | Class and Description |
|---|---|
class |
MessageSecurityMetadataSourceRegistry.Constraint
Represents the security constraint to be applied to the
MessageMatcher
instances. |
| Constructor and Description |
|---|
MessageSecurityMetadataSourceRegistry() |
| Modifier and Type | Method and Description |
|---|---|
MessageSecurityMetadataSourceRegistry.Constraint |
anyMessage()
Maps any
Message to a security expression. |
protected boolean |
containsMapping()
Allows determining if a mapping was added.
|
protected org.springframework.security.messaging.access.intercept.MessageSecurityMetadataSource |
createMetadataSource()
Allows subclasses to create creating a
MessageSecurityMetadataSource. |
MessageSecurityMetadataSourceRegistry |
expressionHandler(org.springframework.security.access.expression.SecurityExpressionHandler<org.springframework.messaging.Message<Object>> expressionHandler)
The
SecurityExpressionHandler to be used. |
protected boolean |
isSimpDestPathMatcherConfigured()
Determines if the
simpDestPathMatcher(PathMatcher) has been explicitly set. |
MessageSecurityMetadataSourceRegistry.Constraint |
matchers(org.springframework.security.messaging.util.matcher.MessageMatcher<?>... matchers)
Maps a
List of MessageMatcher instances to a security expression. |
MessageSecurityMetadataSourceRegistry.Constraint |
nullDestMatcher()
Maps any
Message that has a null SimpMessageHeaderAccessor destination
header (i.e. |
MessageSecurityMetadataSourceRegistry.Constraint |
simpDestMatchers(String... patterns)
|
MessageSecurityMetadataSourceRegistry |
simpDestPathMatcher(PathMatcher pathMatcher)
The
PathMatcher to be used with the
simpDestMatchers(String...). |
MessageSecurityMetadataSourceRegistry.Constraint |
simpMessageDestMatchers(String... patterns)
|
MessageSecurityMetadataSourceRegistry.Constraint |
simpSubscribeDestMatchers(String... patterns)
|
MessageSecurityMetadataSourceRegistry.Constraint |
simpTypeMatchers(org.springframework.messaging.simp.SimpMessageType... typesToMatch)
Maps a
List of SimpDestinationMessageMatcher instances. |
public MessageSecurityMetadataSourceRegistry()
public MessageSecurityMetadataSourceRegistry.Constraint anyMessage()
Message to a security expression.public MessageSecurityMetadataSourceRegistry.Constraint nullDestMatcher()
Message that has a null SimpMessageHeaderAccessor destination
header (i.e. CONNECT, CONNECT_ACK, HEARTBEAT, UNSUBSCRIBE, DISCONNECT,
DISCONNECT_ACK, OTHER)public MessageSecurityMetadataSourceRegistry.Constraint simpTypeMatchers(org.springframework.messaging.simp.SimpMessageType... typesToMatch)
List of SimpDestinationMessageMatcher instances.typesToMatch - the SimpMessageType instance to match onMessageSecurityMetadataSourceRegistry.Constraint associated to the matchers.public MessageSecurityMetadataSourceRegistry.Constraint simpDestMatchers(String... patterns)
List of SimpDestinationMessageMatcher instances without
regard to the SimpMessageType. If no destination is found on the Message,
then the Matcher returns false.patterns - the patterns to create
SimpDestinationMessageMatcher
from. Uses
simpDestPathMatcher(PathMatcher) .MessageSecurityMetadataSourceRegistry.Constraint that is associated to the MessageMatchersimpDestPathMatcher(PathMatcher)public MessageSecurityMetadataSourceRegistry.Constraint simpMessageDestMatchers(String... patterns)
List of SimpDestinationMessageMatcher instances that match
on SimpMessageType.MESSAGE. If no destination is found on the Message, then
the Matcher returns false.patterns - the patterns to create
SimpDestinationMessageMatcher
from. Uses
simpDestPathMatcher(PathMatcher).MessageSecurityMetadataSourceRegistry.Constraint that is associated to the MessageMatchersimpDestPathMatcher(PathMatcher)public MessageSecurityMetadataSourceRegistry.Constraint simpSubscribeDestMatchers(String... patterns)
List of SimpDestinationMessageMatcher instances that match
on SimpMessageType.SUBSCRIBE. If no destination is found on the Message,
then the Matcher returns false.patterns - the patterns to create
SimpDestinationMessageMatcher
from. Uses
simpDestPathMatcher(PathMatcher).MessageSecurityMetadataSourceRegistry.Constraint that is associated to the MessageMatchersimpDestPathMatcher(PathMatcher)public MessageSecurityMetadataSourceRegistry simpDestPathMatcher(PathMatcher pathMatcher)
PathMatcher to be used with the
simpDestMatchers(String...). The
default is to use the default constructor of AntPathMatcher.pathMatcher - the PathMatcher to use. Cannot be null.MessageSecurityMetadataSourceRegistry for further
customization.protected boolean isSimpDestPathMatcherConfigured()
simpDestPathMatcher(PathMatcher) has been explicitly set.simpDestPathMatcher(PathMatcher) has been explicitly set, else false.public MessageSecurityMetadataSourceRegistry.Constraint matchers(org.springframework.security.messaging.util.matcher.MessageMatcher<?>... matchers)
List of MessageMatcher instances to a security expression.matchers - the MessageMatcher instances to map.MessageSecurityMetadataSourceRegistry.Constraint that is associated to the MessageMatcher
instancespublic MessageSecurityMetadataSourceRegistry expressionHandler(org.springframework.security.access.expression.SecurityExpressionHandler<org.springframework.messaging.Message<Object>> expressionHandler)
SecurityExpressionHandler to be used. The
default is to use DefaultMessageSecurityExpressionHandler.expressionHandler - the SecurityExpressionHandler to use. Cannot be null.MessageSecurityMetadataSourceRegistry for further
customization.protected org.springframework.security.messaging.access.intercept.MessageSecurityMetadataSource createMetadataSource()
MessageSecurityMetadataSource.
This is not exposed so as not to confuse users of the API, which should never invoke this method.
MessageSecurityMetadataSource to useprotected boolean containsMapping()
This is not exposed so as not to confuse users of the API, which should never need to invoke this method.