Josh Cummings 531c5cafdc
Standardize Mocked Request Paths
Historically, Spring Security tests have set the servlet path
to indicate the path of a MockHttpServletRequest. This was needed
for AntPath and MvcRequestMatcher to correctly match the
specified request path.

This can leave MockHttpServletRequest in an inconsistent state
since requestURI is null while servletPath has a value.

For example, PathPatternRequestMatcher does not use the servlet path.
For tests to continue working both before and after the migration
from AntPath/MvcRequestMatcher to PathPatternRequestMatcher, the
mock requests should have a consistent representation of path
in getRequestURI and getServletPath.

This commit updates classes to use TestMockHttpServletRequests,
which ensures that the given path is applied to the servletPath and
requestURI, while also overriding with contextPath, servletPath,
and pathInfo when necessary.
2025-07-02 13:18:09 -06:00
2025-04-23 11:29:18 -06:00
2025-05-19 09:26:30 -06:00
2021-05-17 22:29:45 -05:00
2025-06-26 17:29:12 -05:00
2025-07-02 13:18:09 -06:00
2025-07-02 13:18:09 -06:00
2025-06-26 17:29:12 -05:00
2025-03-17 14:18:49 -05:00
2025-06-19 11:55:34 -06:00
2025-07-02 13:18:08 -06:00
2025-07-02 13:18:09 -06:00
2025-05-06 13:26:14 -05:00
2025-06-26 17:29:12 -05:00
2025-07-02 13:18:09 -06:00
2025-06-19 11:55:34 -06:00
2025-07-02 13:18:09 -06:00
2025-05-06 13:26:14 -05:00
2025-07-02 13:18:08 -06:00
2025-07-02 13:18:09 -06:00
2021-10-13 15:36:10 -06:00
2024-04-19 14:16:02 -05:00
2022-06-14 14:43:34 -05:00
2025-03-20 13:25:04 -06:00
2025-06-20 14:01:19 -06:00
2025-05-22 12:29:05 -06:00
2025-04-29 14:48:42 -06:00
2020-04-15 16:44:13 -05:00
2019-03-19 23:53:23 -05:00
2024-05-06 16:04:35 -05:00

image::https://badges.gitter.im/Join%20Chat.svg[Gitter,link=https://gitter.im/spring-projects/spring-security?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge]

image:https://github.com/spring-projects/spring-security/actions/workflows/continuous-integration-workflow.yml/badge.svg?branch=main["Build Status", link="https://github.com/spring-projects/spring-security/actions/workflows/continuous-integration-workflow.yml"]

image:https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Develocity", link="https://ge.spring.io/scans?search.rootProjectNames=spring-security"]

= Spring Security

Spring Security provides security services for the https://docs.spring.io[Spring IO Platform]. Spring Security 6.0 requires Spring 6.0 as
a minimum and also requires Java 17.

For a detailed list of features and access to the latest release, please visit https://spring.io/projects[Spring projects].

== Code of Conduct
Please see our https://github.com/spring-projects/.github/blob/main/CODE_OF_CONDUCT.md[code of conduct]

== Downloading Artifacts
See https://docs.spring.io/spring-security/reference/getting-spring-security.html[Getting Spring Security] for how to obtain Spring Security.

== Documentation
Be sure to read the https://docs.spring.io/spring-security/reference/[Spring Security Reference].
Extensive JavaDoc for the Spring Security code is also available in the https://docs.spring.io/spring-security/site/docs/current/api/[Spring Security API Documentation].

You may also want to check out https://docs.spring.io/spring-security/reference/whats-new.html[what's new in the latest release].

== Quick Start
See https://docs.spring.io/spring-security/reference/servlet/getting-started.html[Hello Spring Security] to get started with a "Hello, World" application.

== Building from Source
Spring Security uses a https://gradle.org[Gradle]-based build system.
In the instructions below, https://vimeo.com/34436402[`./gradlew`] is invoked from the root of the source tree and serves as
a cross-platform, self-contained bootstrap mechanism for the build.

=== Prerequisites
https://docs.github.com/en/get-started/quickstart/set-up-git[Git] and the https://www.oracle.com/java/technologies/downloads/#java17[JDK17 build].

Be sure that your `JAVA_HOME` environment variable points to the `jdk-17` folder extracted from the JDK download.

=== Check out sources
[indent=0]
----
git clone git@github.com:spring-projects/spring-security.git
----

=== Install all `spring-*.jar` into your local Maven repository.

[indent=0]
----
./gradlew publishToMavenLocal
----

=== Compile and test; build all JARs, distribution zips, and docs

[indent=0]
----
./gradlew build
----

The reference docs are not currently included in the distribution zip.
You can build the reference docs for this branch by running the following command:

----
./gradlew :spring-security-docs:antora
----

That command publishes the docs site to the `_docs/build/site_` directory.
The https://github.com/spring-projects/spring-security/tree/docs-build[playbook branch] describes how to build the reference docs in detail.

Discover more commands with `./gradlew tasks`.

== Getting Support
Check out the https://stackoverflow.com/questions/tagged/spring-security[Spring Security tags on Stack Overflow].
https://spring.io/support[Commercial support] is available too.

== Contributing
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request[Pull requests] are welcome; see the https://github.com/spring-projects/spring-security/blob/main/CONTRIBUTING.adoc[contributor guidelines] for details.

== License
Spring Security is Open Source software released under the
https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].
Description
Languages
Java 94.5%
Kotlin 4.7%
JavaScript 0.3%
Groovy 0.3%