Skip to content

Deprecate usages of PathMatcher in Web Socket support #16500

Closed
@jzheaux

Description

@jzheaux

spring-security-messaging uses PathMatcher in two places:

  • SimpDestinationMessageMatcher should be deprecated and replaced
  • MessageMatcherDelegatingAuthorizationManager should deprecate and replace its use of PathMatcher
  • MessageMatcherAuthorizationManagerConfiguration should not retrieve and configuration a PathMatcher

To construct a PathPattern from a given pattern do:

PathPatternParser parser = PathPatternParser.defaultInstance;
PathPattern pathPattern = parser.parse(pattern);

To compare a PathPattern to a message destination, do:

String destination = SimpMessageHeaderAccessor.getDestination(message.getHeaders());
PathContainer pathContainer = PathContainer.parsePath(destination);
PathMatchInfo match = pathPattern.matchAndExtract(pathContainer);

Please take a look at PathPatternRequestMatcher for implementation guidance.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions