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
jzheaux opened this issue Jan 29, 2025 · 2 comments · May be fixed by #16635
Open
3 tasks

Deprecate usages of PathMatcher in Web Socket support #16500

jzheaux opened this issue Jan 29, 2025 · 2 comments · May be fixed by #16635
Assignees
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;
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.

@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
@pat-mccusker
Copy link
Contributor

Hi @jzheaux, is this still up for grabs/not accounted for in the other mentioned issues? I'd like to work on it.

@jzheaux
Copy link
Contributor Author

jzheaux commented Feb 21, 2025

Hi, @pat-mccusker, yes, thanks for volunteering!

pat-mccusker added a commit to pat-mccusker/spring-security that referenced this issue Feb 23, 2025
@pat-mccusker pat-mccusker linked a pull request Feb 23, 2025 that will close this issue
pat-mccusker added a commit to pat-mccusker/spring-security that referenced this issue Feb 25, 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

Successfully merging a pull request may close this issue.

2 participants