-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
Rob Winch opened SPR-12845 and commented
Spring Security should be able to default to using the same PathMatcher that Spring WebSockets is using. This is ideal so that they both use the same PathMatcher (i.e. using . or / separators).
Using SimpAnnotationMethodMessageHandler PathMatcher property does not work because it fails with a circular bean reference. This happens because:
- stompWebSocketHandlerMapping requests subProtocolWebSocketHandler
- subProtocolWebSocketHandler requests clientInboundChannel
- clientInboundChannel requests clientInboundChannelExecutor
- clientInboundChannelExecutor requests simpAnnotationMethodMessageHandler. This is due to the fact the creation of clientInboundChannelExecutor invokes configureClientInboundChannel and in order to configureClientInboundChannel, we must lookup simpAnnotationMethodMessageHandler to determine the PatternMatcher
- simpAnnotationMethodMessageHandler then looks up clientInboundChannel (which is a cycle)
You can find my attempt at https://github.com/rwinch/spring-security/tree/SEC-2864 The exact test is AbstractSecurityWebSocketMessageBrokerConfigurerTests#msmsRegistryCustomPatternMatcher
Note that I cannot use MessageBrokerRegistry directly because it is not exposed as a Bean and the accessor is protected.
Issue Links:
- SEC-2864 Default PathMatcher for WebSocket Destination Matching
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement