Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate usages of PathMatcher in Web Socket support #16500

Open
3 tasks
Tracked by #16417
jzheaux opened this issue Jan 29, 2025 · 0 comments
Open
3 tasks
Tracked by #16417

Deprecate usages of PathMatcher in Web Socket support #16500

jzheaux opened this issue Jan 29, 2025 · 0 comments
Labels
in: messaging An issue in spring-security-messaging type: enhancement A general enhancement
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Jan 29, 2025

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;
String parsed = parser.initFullPathPattern(pattern);
PathPattern pathPattern = parser.parse(parsed);

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);
@jzheaux jzheaux added in: messaging An issue in spring-security-messaging type: enhancement A general enhancement labels Jan 29, 2025
@jzheaux jzheaux added this to the 6.5.x milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging An issue in spring-security-messaging type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant