Skip to content

Deprecate usages of PathMatcher in Web Socket support #16500

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

Closed
3 tasks
jzheaux opened this issue Jan 29, 2025 · 2 comments · Fixed by #16635 · May be fixed by GuusArts/spring-security#18 or GuusArts/spring-security#21
Closed
3 tasks

Deprecate usages of PathMatcher in Web Socket support #16500

jzheaux opened this issue Jan 29, 2025 · 2 comments · Fixed by #16635 · May be fixed by GuusArts/spring-security#18 or GuusArts/spring-security#21
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 added a commit to pat-mccusker/spring-security that referenced this issue Feb 25, 2025
pat-mccusker added a commit to pat-mccusker/spring-security that referenced this issue Mar 2, 2025
jzheaux added a commit to pat-mccusker/spring-security that referenced this issue Mar 18, 2025
jzheaux added a commit to pat-mccusker/spring-security that referenced this issue Mar 18, 2025
jzheaux added a commit to pat-mccusker/spring-security that referenced this issue Mar 18, 2025
jzheaux added a commit to pat-mccusker/spring-security that referenced this issue Mar 18, 2025
jzheaux pushed a commit to pat-mccusker/spring-security that referenced this issue Mar 18, 2025
jzheaux added a commit to pat-mccusker/spring-security that referenced this issue Mar 18, 2025
jzheaux pushed a commit that referenced this issue Mar 19, 2025
Closes gh-16500

Signed-off-by: Pat McCusker <[email protected]>
jzheaux added a commit that referenced this issue Mar 19, 2025
Issue gh-16500

Signed-off-by: Josh Cummings <[email protected]>
@jzheaux jzheaux modified the milestones: 6.5.x, 6.5.0-RC1 Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment