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

AbstractRequestMatcherRegistry#requestMatchers should pick MvcRequestMatcher when using MockMvc #13849

Closed
Tracked by #13568
jzheaux opened this issue Sep 19, 2023 · 2 comments
Assignees
Labels
in: config An issue in spring-security-config type: bug A general bug
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Sep 19, 2023

Because MockMvc's mock servlet context does not return any servlet registrations, Spring Security will pick AntPathRequestMatcher when requestMatchers(String) is used, even though an MvcRequestMatcher is likely the intended request matcher.

@jzheaux jzheaux added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Sep 19, 2023
@jzheaux jzheaux self-assigned this Sep 19, 2023
@jzheaux jzheaux added in: config An issue in spring-security-config and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 19, 2023
@jzheaux jzheaux added this to the 5.8.x milestone Sep 19, 2023
@jzheaux jzheaux modified the milestones: 5.8.x, 5.8.10 Feb 8, 2024
@jzheaux jzheaux changed the title Testing Support between Boot 2.7 and Security 5.8 AbstractRequestMatcherRegistry#requestMatchers should pick MvcRequestMatcher when using MockMvc Feb 8, 2024
@jzheaux
Copy link
Contributor Author

jzheaux commented Feb 9, 2024

There haven't been any reports yet of this causing an issue. I'm going to close this for now since seeing any behavioral problems will better inform the kind of change that should be made.

@jzheaux jzheaux closed this as completed Feb 9, 2024
@jzheaux jzheaux added status: invalid An issue that we don't feel is valid and removed type: bug A general bug labels Feb 9, 2024
@jzheaux jzheaux removed this from the 5.8.10 milestone Feb 9, 2024
jzheaux added a commit to jzheaux/spring-security that referenced this issue Feb 20, 2024
@jzheaux
Copy link
Contributor Author

jzheaux commented Jun 6, 2024

Given #14418, I'm reopening this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: config An issue in spring-security-config type: bug A general bug
Projects
Status: Done
Development

No branches or pull requests

1 participant