Compare commits

...

187 Commits

Author SHA1 Message Date
dependabot[bot]
56055605cd Bump @antora/collector-extension from 1.0.2 to 1.0.3 in /docs
---
updated-dependencies:
- dependency-name: "@antora/collector-extension"
  dependency-version: 1.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-06 00:45:34 +00:00
dependabot[bot]
de3c72735e Bump gradle-wrapper from 9.3.1 to 9.4.0
Bumps gradle-wrapper from 9.3.1 to 9.4.0.

---
updated-dependencies:
- dependency-name: gradle-wrapper
  dependency-version: 9.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-05 03:20:07 +00:00
skfkgla
96bf048dd2 Improve MockMvc testing documentation navigation
Closes gh-18844

Signed-off-by: skfkgla <narahim.lee@gmail.com>
2026-03-04 16:49:19 -07:00
wonderfulrosemari
07297e7a80 Add MessageExpressionAuthorizationManager
Closes gh-12650

Signed-off-by: wonderfulrosemari <whwlsgur1419@naver.com>
2026-03-03 18:56:47 -07:00
Josh Cummings
b1f4deafe6
Merge branch '7.0.x' 2026-03-03 18:52:06 -07:00
Josh Cummings
9893048ec9
Merge branch '6.5.x' into 7.0.x 2026-03-03 18:51:53 -07:00
Josh Cummings
e17d85e460
Add IDE Setup Documentation
Issue gh-17833

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-03-03 18:51:32 -07:00
Josh Cummings
94829a1551
Merge remote-tracking branch 'origin/7.0.x' 2026-03-03 18:18:24 -07:00
Andrey Litvitski
4f97217f68 Refine upgradeEncoding condition in DaoAuthenticationProvider
After adding jspecify support in the module that contains the
DaoAuthenticationProvider class, we actually changed the contract logic,
which is a good thing, and this commit fixes it.

Closes: gh-18781

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-03-03 18:18:13 -07:00
Josh Cummings
4907d56a04
Merge branch '7.0.x' 2026-03-03 18:17:15 -07:00
Josh Cummings
fdaa883fb7
Merge remote-tracking branch 'origin/6.5.x' into 7.0.x 2026-03-03 18:17:08 -07:00
dependabot[bot]
f12036db05 Bump actions/upload-artifact from 6.0.0 to 7.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b7c566a772...bbbca2ddaa)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 18:16:39 -07:00
Josh Cummings
b308c74c5e
Merge remote-tracking branch 'origin/7.0.x' 2026-03-03 17:48:41 -07:00
dependabot[bot]
fbd9880a33 Bump actions/upload-artifact from 6.0.0 to 7.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b7c566a772...bbbca2ddaa)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 17:48:29 -07:00
Josh Cummings
f14d2d2242
Merge branch '7.0.x' 2026-03-03 17:47:49 -07:00
Josh Cummings
5e38c2aa88
Merge remote-tracking branch 'origin/6.5.x' into 7.0.x 2026-03-03 17:47:40 -07:00
dependabot[bot]
7b5c502a97 Bump org.hibernate.orm:hibernate-core from 6.6.43.Final to 6.6.44.Final
Bumps [org.hibernate.orm:hibernate-core](https://github.com/hibernate/hibernate-orm) from 6.6.43.Final to 6.6.44.Final.
- [Release notes](https://github.com/hibernate/hibernate-orm/releases)
- [Changelog](https://github.com/hibernate/hibernate-orm/blob/6.6.44/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-orm/compare/6.6.43...6.6.44)

---
updated-dependencies:
- dependency-name: org.hibernate.orm:hibernate-core
  dependency-version: 6.6.44.Final
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 17:47:07 -07:00
Josh Cummings
e7bf4b561c
Ignore nullability plugin for 7.0.x
Since later versions of the nullability plugin require JDK 25,
this commit ignores the dependency on 7.0.x, which builds on
JDK 17

Closes gh-18831

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-03-03 17:37:46 -07:00
Tran Ngoc Nhan
41e3aeb246 Use site-url for reference link
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-03-03 16:51:25 -07:00
Tran Ngoc Nhan
89260a3a9c Use reference links from attributes
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-03-03 16:51:25 -07:00
Josh Cummings
a84b506196
Merge branch '7.0.x' 2026-03-03 16:49:10 -07:00
Andrey Litvitski
57434fc597
Update RestTemplateBuilder usage in opaque-token.adoc
We just now use a new form instead of the deprecate one.

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-03-03 16:48:22 -07:00
Josh Cummings
a01c0d003c
Merge branch '7.0.x' 2026-03-03 16:44:25 -07:00
Josh Cummings
20a7f96062
Merge branch '6.5.x' into 7.0.x 2026-03-03 16:44:12 -07:00
HaiYan
706b059ea8
Update logout.adoc
Directives should be Directive

Signed-off-by: HaiYan <haiyan_qi@hotmail.com>
2026-03-03 16:43:18 -07:00
Josh Cummings
f8d58fb267
Merge remote-tracking branch 'origin/7.0.x' 2026-03-03 15:53:33 -07:00
dependabot[bot]
7c49e0b457 Bump com.webauthn4j:webauthn4j-core
Bumps [com.webauthn4j:webauthn4j-core](https://github.com/webauthn4j/webauthn4j) from 0.31.0.RELEASE to 0.31.1.RELEASE.
- [Release notes](https://github.com/webauthn4j/webauthn4j/releases)
- [Commits](https://github.com/webauthn4j/webauthn4j/compare/0.31.0.RELEASE...0.31.1.RELEASE)

---
updated-dependencies:
- dependency-name: com.webauthn4j:webauthn4j-core
  dependency-version: 0.31.1.RELEASE
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 15:52:30 -07:00
Rob Winch
2ac079dd1a
Merge Fix Flaky Crypto Tests
Forward merge gh-18841
2026-03-03 16:11:48 -06:00
Rob Winch
04b270a0a3
Merge Fix Flaky Crypto Tests
Forward merge gh-18841
2026-03-03 16:02:33 -06:00
Robert Winch
7e4a926527
Merge Fix Flaky Crypto Tests 2026-03-03 15:58:41 -06:00
Rob Winch
ea3b112bea
Fix Flaky Crypto Tests 2026-03-03 15:58:17 -06:00
Robert Winch
17776e4738
Merge Fix Flaky Crypto Tests 2026-03-03 15:26:53 -06:00
Robert Winch
1261c229a3
Fix Flaky Crypto Tests
Previously the RsaSecretEncryptorTests were flaky because the assumed that a BadPaddigException would be thrown
when using things like different salt. However, given that the tests had random inputs (e.g. keys) there is the
possibility that, despite the fact that it can never be properly decrypted, the final bytes look like a valid
encrypted value.

This updates the tests to ensure that decrypt either throws an Exception or is not equal to the original
plaintext.
2026-03-03 14:52:28 -06:00
dependabot[bot]
25ccb1fd70 Bump org.hibernate.orm:hibernate-core from 7.2.5.Final to 7.2.6.Final
Bumps [org.hibernate.orm:hibernate-core](https://github.com/hibernate/hibernate-orm) from 7.2.5.Final to 7.2.6.Final.
- [Release notes](https://github.com/hibernate/hibernate-orm/releases)
- [Changelog](https://github.com/hibernate/hibernate-orm/blob/7.2.6/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-orm/compare/7.2.5...7.2.6)

---
updated-dependencies:
- dependency-name: org.hibernate.orm:hibernate-core
  dependency-version: 7.2.6.Final
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 00:25:03 +00:00
Josh Cummings
587ac2cbad Move Snippets to Compiled Code
Issue gh-18745

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-03-02 16:20:22 -07:00
Josh Cummings
498b0cb59c Make RestClientOpaqueTokenIntrospector final
Issue gh-18745

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-03-02 16:20:22 -07:00
Andrey Litvitski
b05b25f2d6 Update opaque-token.adoc for RestClientOpaqueTokenIntrospector
Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-03-02 16:20:22 -07:00
Andrey Litvitski
a5c0113ff0 Add postProcessr support to RestClientOpaqueTokenIntrospector
Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-03-02 16:20:22 -07:00
Andrey Litvitski
bafd4034a0 Provide RestClientSpringOpaqueTokenIntrospector
Since similar classes have alternative versions using RestClient instead
of RestTemplate, I think we should do the same with this class.

Closes: gh-18745

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-03-02 16:20:22 -07:00
kimyounguk1
ca34ec26d8 This commit fixes the @param tag typo in ClientAttributes.java
to ensure the Javadoc build passes.

Signed-off-by: kimyounguk1 <kyw020108@gmail.com>

Fix javadoc @param typo in ClientAttributes

Signed-off-by: kimyounguk1 <kyw020108@gmail.com>
2026-03-02 13:27:21 -07:00
Andrey Litvitski
30dd328272 Change ActiveDirectoryLdapAuthenticationProvider to use LdapClient
Replaces SpringSecurityLdapTemplate with LdapClient for user search
operations.

Closes: gh-17291

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-03-02 13:14:44 -07:00
Rob Winch
9f9bc0f729
Merge HttpMessageConverterAuthenticationSuccessHandler Supports Jackson 3 2026-03-02 11:49:33 -06:00
Rob Winch
9ce2d76508
Merge HttpMessageConverterAuthenticationSuccessHandler Supports Jackson 3 2026-03-02 11:48:14 -06:00
Robert Winch
0bb697c4a7
Merge HttpMessageConverterAuthenticationSuccessHandler Supports Jackson 3 2026-03-02 11:32:59 -06:00
Robert Winch
fb84e24893
HttpMessageConverterAuthenticationSuccessHandler Supports Jackson 3
Closes gh-18804
2026-03-02 11:31:52 -06:00
dependabot[bot]
b19e0e1ff3 Bump com.webauthn4j:webauthn4j-core
Bumps [com.webauthn4j:webauthn4j-core](https://github.com/webauthn4j/webauthn4j) from 0.31.0.RELEASE to 0.31.1.RELEASE.
- [Release notes](https://github.com/webauthn4j/webauthn4j/releases)
- [Commits](https://github.com/webauthn4j/webauthn4j/compare/0.31.0.RELEASE...0.31.1.RELEASE)

---
updated-dependencies:
- dependency-name: com.webauthn4j:webauthn4j-core
  dependency-version: 0.31.1.RELEASE
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 03:32:00 +00:00
dependabot[bot]
c869565ab6 Bump io.spring.nullability:io.spring.nullability.gradle.plugin
Bumps [io.spring.nullability:io.spring.nullability.gradle.plugin](https://github.com/spring-gradle-plugins/nullability-plugin) from 0.0.11 to 0.0.12.
- [Release notes](https://github.com/spring-gradle-plugins/nullability-plugin/releases)
- [Commits](https://github.com/spring-gradle-plugins/nullability-plugin/compare/v0.0.11...v0.0.12)

---
updated-dependencies:
- dependency-name: io.spring.nullability:io.spring.nullability.gradle.plugin
  dependency-version: 0.0.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 03:18:46 +00:00
dependabot[bot]
6118557b3e Bump org.mockito:mockito-bom from 5.21.0 to 5.22.0
Bumps [org.mockito:mockito-bom](https://github.com/mockito/mockito) from 5.21.0 to 5.22.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v5.21.0...v5.22.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-bom
  dependency-version: 5.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 03:17:36 +00:00
023-dev
b9f974b18f Remove compiler warnings for spring-security-config
Signed-off-by: 023-dev <0_2_3@naver.com>
2026-02-27 21:53:55 -06:00
dependabot[bot]
e43275d1db Bump minimatch from 3.1.2 to 3.1.5 in /javascript
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-27 00:58:57 +00:00
dependabot[bot]
18995c89ee Bump actions/upload-artifact from 6.0.0 to 7.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b7c566a772...bbbca2ddaa)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-27 00:45:15 +00:00
Josh Cummings
0c42016781
Merge branch '7.0.x' 2026-02-26 17:11:06 -07:00
Josh Cummings
1575610d49
Add Tests
Issue gh-18486

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-26 17:10:55 -07:00
Michael Lück
3a14745d92
Delegate calls of hasAuthority to AuthorizationManager#hasAuthority
Closes gh-18486

Signed-off-by: Michael Lück <michael@lueckonline.net>
2026-02-26 17:10:55 -07:00
Josh Cummings
bd51ecd691
Merge branch '7.0.x' 2026-02-26 17:10:28 -07:00
Josh Cummings
c29af014f4
Merge remote-tracking branch 'origin/6.5.x' into 7.0.x 2026-02-26 17:10:16 -07:00
Josh Cummings
4501ae7d1c Update Reactive Resource Server startup exceptations
Issue gh-16708

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-26 16:56:22 -07:00
Josh Cummings
48112d3d74 Polish Resource Server startup expectations
Issue gh-16708

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-26 16:56:22 -07:00
[CLOUD4] 한현
b8735abb63 Clarify Resource Server startup expectations
Clarify that Spring Boot defers OIDC discovery by default.

Closes gh-16708

Signed-off-by: [CLOUD4] 한현 <gusgus1467@naver.com>
2026-02-26 16:56:22 -07:00
Josh Cummings
50caf0cb28
Merge branch '7.0.x' 2026-02-26 15:57:27 -07:00
Tran Ngoc Nhan
7c3c8bbdcb Update Remember-Me example
Closes gh-18639

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-26 15:28:32 -07:00
Josh Cummings
b7dbb12c66
Merge branch '7.0.x' 2026-02-26 15:10:18 -07:00
Josh Cummings
731848d5d3
Merge branch '6.5.x' into 7.0.x 2026-02-26 15:09:45 -07:00
Josh Cummings
eb25bbaa24
Merge branch '7.0.x' 2026-02-26 15:09:03 -07:00
Guillaume Husta
68a02ff176 Update Link to CRSF Docs in FAQ
Signed-off-by: Guillaume Husta <guillaume.husta@gmail.com>
2026-02-26 14:47:21 -07:00
Menashe Eliezer
ee97c83042 Update request-matcher schema and XML tests to use path
Closes gh-18641

Signed-off-by: Menashe Eliezer <menashe.eliezer@gmail.com>
2026-02-26 14:42:09 -07:00
Josh Cummings
6304ea78cc
Merge branch '7.0.x' 2026-02-26 14:39:33 -07:00
Josh Cummings
10b835693c
Merge remote-tracking branch 'origin/6.5.x' into 7.0.x 2026-02-26 14:39:19 -07:00
dependabot[bot]
ba12f5e6d0 Bump org-apache-maven-resolver from 1.9.26 to 1.9.27
Bumps `org-apache-maven-resolver` from 1.9.26 to 1.9.27.

Updates `org.apache.maven.resolver:maven-resolver-connector-basic` from 1.9.26 to 1.9.27
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.26...maven-resolver-1.9.27)

Updates `org.apache.maven.resolver:maven-resolver-impl` from 1.9.26 to 1.9.27
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.26...maven-resolver-1.9.27)

Updates `org.apache.maven.resolver:maven-resolver-transport-http` from 1.9.26 to 1.9.27

---
updated-dependencies:
- dependency-name: org.apache.maven.resolver:maven-resolver-connector-basic
  dependency-version: 1.9.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-impl
  dependency-version: 1.9.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-transport-http
  dependency-version: 1.9.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-26 14:38:51 -07:00
dependabot[bot]
f37a706d62 Bump org-apache-maven-resolver from 1.9.26 to 1.9.27
Bumps `org-apache-maven-resolver` from 1.9.26 to 1.9.27.

Updates `org.apache.maven.resolver:maven-resolver-connector-basic` from 1.9.26 to 1.9.27
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.26...maven-resolver-1.9.27)

Updates `org.apache.maven.resolver:maven-resolver-impl` from 1.9.26 to 1.9.27
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.26...maven-resolver-1.9.27)

Updates `org.apache.maven.resolver:maven-resolver-transport-http` from 1.9.26 to 1.9.27

---
updated-dependencies:
- dependency-name: org.apache.maven.resolver:maven-resolver-connector-basic
  dependency-version: 1.9.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-impl
  dependency-version: 1.9.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-transport-http
  dependency-version: 1.9.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-26 14:38:30 -07:00
Josh Cummings
e30d9240c9 Add Docs for Custom Jwt Principal Converters
Issue gh-6237

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-26 12:28:50 -07:00
Josh Cummings
c208410a91 Polish Jwt Authentication Converter
- Replace conditional logic with adapter class
- Added tests

Issue gh-6237

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-26 12:28:50 -07:00
Andrey Litvitski
aabc9fc1cc Support Custom Principal in Jwt Authentication Flow
Closes gh-6237

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-02-26 12:28:50 -07:00
Rob Winch
d3474e704f
Merge Add Missing OnCommitedResponseWrapper Header Overrides
Add Missing OnCommitedResponseWrapper Header Overrides
2026-02-24 20:16:49 -06:00
Rob Winch
b48967eebc
Merge Add Missing OnCommitedResponseWrapper Header Overrides
Add Missing OnCommitedResponseWrapper Header Overrides
2026-02-24 20:16:39 -06:00
Rob Winch
522c48b3b5
Merge Add Missing OnCommitedResponseWrapper Header Overrides
Add Missing OnCommitedResponseWrapper Header Overrides
2026-02-24 20:16:24 -06:00
Robert Winch
9cc3161055
Merge Add Missing OnCommitedResponseWrapper Header Overrides 2026-02-24 19:51:53 -06:00
Robert Winch
6898de8003
Merge Add Missing OnCommitedResponseWrapper Header Overrides 2026-02-24 19:49:38 -06:00
Robert Winch
1dae9aa459
Add Missing OnCommitedResponseWrapper Header Overrides
Spring Security's `OnCommitedResponseWrapper` does not override the `setHeader`, `setIntHeader`, `addIntHeader`
methods. This means that if the `Content-Length` response header is specified using any of those methods then
the response body length is not tracked and can be committed before the response headers are written.

Spring Security should override the missing methods and track `Content-Length` as is already done for `addHeader`.

This issue is the underlying problem for spring-projects/spring-framework#36381

Closes gh-18797
2026-02-24 19:46:29 -06:00
Josh Cummings
4b0be84a0e Merge branch '7.0.x' 2026-02-24 17:10:26 -07:00
Josh Cummings
73ee893d98 Merge remote-tracking branch 'origin/6.5.x' into 7.0.x 2026-02-24 17:10:14 -07:00
Josh Cummings
bec25edeb0
Merge pull request #18566 from Hann244/docs/gh-16530-jsp-method-attribute
Clarify need for method attribute in JSP authorize tag
2026-02-24 17:08:14 -07:00
Josh Cummings
4d43edfb20 Polish Documentation
- Combined explanation of method attribute with usage recommendations
- Used one sentence per line format

Issue gh-16530

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-24 14:24:11 -07:00
onhann
9f9699f8a5 Clarify need for method attribute in JSP authorize tag
Closes gh-16530

This aligns the JSP documentation with the changes made in gh-16529.
Added a NOTE to clarify that the method attribute is required when the underlying RequestMatcher is method-specific.

Signed-off-by: onhann <gusgus1467@naver.com>
2026-02-24 14:24:11 -07:00
Andrey Litvitski
6d4726bfb7 Mark targetDomainObject as @Nullable in PermissionEvaluator
Closes: gh-18259

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-02-24 10:55:06 -06:00
Robert Winch
d31ca7a758 Fix SecurityContextLogoutHandler.logout @param response Javadoc (cannot be null)
Closes gh-18357
2026-02-24 10:06:04 -06:00
Robert Winch
ac06067d02
Revert "Mark targetDomainObject as @Nullable in PermissionEvaluator"
This reverts commit 9f1381c382515042b348078cbe53f412e39c38e1.
2026-02-24 09:40:54 -06:00
Andrey Litvitski
9f1381c382 Mark targetDomainObject as @Nullable in PermissionEvaluator
Closes: gh-18259

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-02-24 08:27:44 -06:00
dependabot[bot]
f700aeac0f Bump tools.jackson:jackson-bom from 3.0.4 to 3.1.0
Bumps [tools.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) from 3.0.4 to 3.1.0.
- [Commits](https://github.com/FasterXML/jackson-bom/compare/jackson-bom-3.0.4...jackson-bom-3.1.0)

---
updated-dependencies:
- dependency-name: tools.jackson:jackson-bom
  dependency-version: 3.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-24 03:17:58 +00:00
dependabot[bot]
41a8d6aca5 Bump org-apache-maven-resolver from 1.9.26 to 1.9.27
Bumps `org-apache-maven-resolver` from 1.9.26 to 1.9.27.

Updates `org.apache.maven.resolver:maven-resolver-connector-basic` from 1.9.26 to 1.9.27
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.26...maven-resolver-1.9.27)

Updates `org.apache.maven.resolver:maven-resolver-impl` from 1.9.26 to 1.9.27
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.26...maven-resolver-1.9.27)

Updates `org.apache.maven.resolver:maven-resolver-transport-http` from 1.9.26 to 1.9.27

---
updated-dependencies:
- dependency-name: org.apache.maven.resolver:maven-resolver-connector-basic
  dependency-version: 1.9.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-impl
  dependency-version: 1.9.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-transport-http
  dependency-version: 1.9.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-24 03:16:37 +00:00
Rob Winch
e81c64b94d
Merge Update servlet/architecture.adoc to use include-code
Update servlet/architecture.adoc to use include-code
2026-02-23 17:16:28 -06:00
Robert Winch
0c394696ce
Fix servlet/architecture.adoc disable Sample
- Switch `include-java` (does not exist) to `include-code`
- Update kotlin to have the `disable` tag
- Update to suppress deprecation use for User builder (allowed for samples)

Signed-off-by: Robert Winch <362503+rwinch@users.noreply.github.com>
2026-02-23 17:03:17 -06:00
Joe Kuhel
62d1bc86e3
Update servlet architecture docs to use include-code
Also update antora.xml to include-xml in docs/src/test/resources

Signed-off-by: Joe Kuhel <4983938+jkuhel@users.noreply.github.com>
2026-02-23 16:37:16 -06:00
Rob Winch
a4cadb5cc5
Merge Make PublicKeyCredentialCreationOptions Serializable
Make PublicKeyCredentialCreationOptions Serializable
2026-02-23 16:01:34 -06:00
Robert Winch
701736da5d
Fix checkstyle
Issue gh-18354

Signed-off-by: Robert Winch <362503+rwinch@users.noreply.github.com>
2026-02-23 15:43:55 -06:00
Mohammad Amin Pahlevani
9e5a425859
Make PublicKeyCredentialCreationOptions Serializable
Closes gh-16431

Signed-off-by: Mohammad Amin Pahlevani <pahlevani@live.com>
2026-02-23 15:43:40 -06:00
Rob Winch
1ab17d941a
Merge Improve error message for missing access attribute in intercept-url
Improve error message for missing access attribute in intercept-url
2026-02-23 15:31:34 -06:00
Robert Winch
53300be8d7
Fix checkstyle
Issue gh-18530
2026-02-23 15:16:02 -06:00
CHANHAN
d5ba9dcada
Add tests for intercept-url access attribute validation
Fixes gh-18503

Signed-off-by: CHANHAN <130114269+chanani@users.noreply.github.com>
2026-02-23 15:16:02 -06:00
CHANHAN
fa87c78edb
fix missing access attribute validation in FilterInvocationSecurityMetadataSourceParser
Fixes gh-18503

Signed-off-by: CHANHAN <130114269+chanani@users.noreply.github.com>
2026-02-23 15:16:02 -06:00
CHANHAN
f1e367f93d
fix missing access attribute validation in AuthorizationFilterParser
Fixes gh-18503

Signed-off-by: CHANHAN <130114269+chanani@users.noreply.github.com>
2026-02-23 15:16:02 -06:00
Rob Winch
4d0627e6c0
Merge pull request #18721 from coehgns/main
Add tests for PathPatternRequestMatcher request path caching
2026-02-23 11:58:27 -06:00
Rob Winch
3106f2be7b
Merge pull request #18757 from wonderfulrosemari/gh-4265-csrf-multipart-header
Document multipart CSRF header option
2026-02-23 11:51:54 -06:00
Rob Winch
b3e5f09eb3
Merge Document Keberose Dependency Coordinates
Document Keberose Dependency Coordinates
2026-02-23 11:47:06 -06:00
Robert Winch
e1436c39f0
Merge Document Keberose Dependency Coordinates 2026-02-23 11:33:25 -06:00
Robert Winch
311235f39e
Document Keberose Dependency Coordinates
Closes gh-18773
2026-02-23 11:32:37 -06:00
Robert Winch
fec988c82d
Add Kerberos Migration Section
This links to the updated dependency coordinates

Issue gh-18773

Signed-off-by: Robert Winch <362503+rwinch@users.noreply.github.com>
2026-02-23 11:29:50 -06:00
busoco-sjb
17b434c1c1
Document the change in dependency coordinates with Spring Security 7
Signed-off-by: busoco-sjb <169069865+busoco-sjb@users.noreply.github.com>
2026-02-23 11:21:59 -06:00
Rob Winch
b451739b5c
Merge pull request Fix GrantedAuthority.authority null in AuthoritiesAuthorizationManager
Fix GrantedAuthority.authority null in AuthoritiesAuthorizationManager
2026-02-23 11:17:21 -06:00
Rob Winch
0bb65411be
Merge pull request Fix GrantedAuthority.authority null in AuthoritiesAuthorizationManager
Fix GrantedAuthority.authority null in AuthoritiesAuthorizationManager
2026-02-23 11:17:06 -06:00
Rob Winch
d29c984881
Merge pull request #18544 from Khyojae/gh-18543
Fix GrantedAuthority.authority null in AuthoritiesAuthorizationManager
2026-02-23 11:16:42 -06:00
Robert Winch
cfb3bf38d8
Merge Fix: Handle null authority string in AuthoritiesAuthorizationManager into main 2026-02-23 10:54:00 -06:00
Robert Winch
151bcf3b0b
Merge Fix: Handle null authority string in AuthoritiesAuthorizationManager into 7.0.x 2026-02-23 10:53:40 -06:00
Robert Winch
1116241ee3
Fix Checks for NullPointerException in AuthoritiesAuthorizationManager
- Fix checkstyle
- Fix the test to use Collection that throws NullPointerException on .contains(null) to replicate the reported issue

Closes gh-18544

Signed-off-by: Robert Winch <362503+rwinch@users.noreply.github.com>
2026-02-23 10:47:11 -06:00
Khyojae
d87dc9ae57
Fix: Handle null authority string in AuthoritiesAuthorizationManager
This prevents NPE when GrantedAuthority.getAuthority() returns null. Closes gh-18543

Signed-off-by: Khyojae <khjae201@gmail.com>
2026-02-23 09:30:28 -06:00
Robert Winch
ea1b3d819b
Merge branch '7.0.x' 2026-02-23 08:17:27 -06:00
Robert Winch
2eb948d9b5
Ensure tests clear AuthorizationServerContextHolder
Closes gh-18768
2026-02-23 08:17:02 -06:00
Robert Winch
881ddf796a
Merge branch '7.0.x' 2026-02-23 08:13:58 -06:00
Robert Winch
f2aef5168c
Merge branch '6.5.x' into 7.0.x 2026-02-23 08:13:38 -06:00
dependabot[bot]
ac556a45f9 Bump org.hibernate.orm:hibernate-core from 6.6.42.Final to 6.6.43.Final
Bumps [org.hibernate.orm:hibernate-core](https://github.com/hibernate/hibernate-orm) from 6.6.42.Final to 6.6.43.Final.
- [Release notes](https://github.com/hibernate/hibernate-orm/releases)
- [Changelog](https://github.com/hibernate/hibernate-orm/blob/6.6.43/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-orm/compare/6.6.42...6.6.43)

---
updated-dependencies:
- dependency-name: org.hibernate.orm:hibernate-core
  dependency-version: 6.6.43.Final
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-23 08:12:23 -06:00
dependabot[bot]
c8731a8dc0 Bump com.fasterxml.jackson:jackson-bom from 2.18.5 to 2.18.6
Bumps [com.fasterxml.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) from 2.18.5 to 2.18.6.
- [Commits](https://github.com/FasterXML/jackson-bom/compare/jackson-bom-2.18.5...jackson-bom-2.18.6)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson:jackson-bom
  dependency-version: 2.18.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-23 08:12:09 -06:00
dependabot[bot]
d62cce5bfb Bump com.fasterxml.jackson:jackson-bom from 2.21.0 to 2.21.1
Bumps [com.fasterxml.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) from 2.21.0 to 2.21.1.
- [Commits](https://github.com/FasterXML/jackson-bom/compare/jackson-bom-2.21.0...jackson-bom-2.21.1)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson:jackson-bom
  dependency-version: 2.21.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-23 03:19:50 +00:00
dependabot[bot]
eca68b6cb3 Bump org.seleniumhq.selenium:selenium-java from 4.40.0 to 4.41.0
Bumps [org.seleniumhq.selenium:selenium-java](https://github.com/SeleniumHQ/selenium) from 4.40.0 to 4.41.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.40.0...selenium-4.41.0)

---
updated-dependencies:
- dependency-name: org.seleniumhq.selenium:selenium-java
  dependency-version: 4.41.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-23 03:18:09 +00:00
dependabot[bot]
3e60eeb74c Bump org.hibernate.orm:hibernate-core from 7.2.4.Final to 7.2.5.Final
Bumps [org.hibernate.orm:hibernate-core](https://github.com/hibernate/hibernate-orm) from 7.2.4.Final to 7.2.5.Final.
- [Release notes](https://github.com/hibernate/hibernate-orm/releases)
- [Changelog](https://github.com/hibernate/hibernate-orm/blob/7.2.5/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-orm/compare/7.2.4...7.2.5)

---
updated-dependencies:
- dependency-name: org.hibernate.orm:hibernate-core
  dependency-version: 7.2.5.Final
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-23 03:17:25 +00:00
Robert Winch
21978cab22 Fix Build Errors for Improve AOT RuntimeHits
- Saml2RuntimeHints consistently uses String in separate method for
  to ensure no classpath issues
- Fix Whitespace/Checkstyle
- Add Missing Nullability Annotations
2026-02-20 17:28:35 -06:00
Josh Long
2dd2863550 aot improvements
Signed-off-by: Josh Long <54473+joshlong@users.noreply.github.com>
2026-02-20 17:28:35 -06:00
dependabot[bot]
1fdfd45782 Bump spring-io/spring-security-release-tools/.github/workflows/test.yml
Bumps [spring-io/spring-security-release-tools/.github/workflows/test.yml](https://github.com/spring-io/spring-security-release-tools) from 1.0.13 to 1.0.14.
- [Release notes](https://github.com/spring-io/spring-security-release-tools/releases)
- [Changelog](https://github.com/spring-io/spring-security-release-tools/blob/main/RELEASE.adoc)
- [Commits](7d42d82298...729fed56d4)

---
updated-dependencies:
- dependency-name: spring-io/spring-security-release-tools/.github/workflows/test.yml
  dependency-version: 1.0.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-20 09:42:07 -06:00
Robert Winch
0dc1aa1126 Ensure tests clear AuthorizationServerContextHolder 2026-02-19 15:20:44 -06:00
Stefano Cordio
3cc707621f Prevent execution of scheduled GitHub Actions on forks
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
2026-02-19 14:41:12 -06:00
Robert Winch
f8ac095d48 Add nullability contract to PasswordEncoder#encode implementations
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>AbstractValidatingPasswordEncoder.java
2026-02-19 14:36:48 -06:00
Chen He
d65625e399 Update BCryptPasswordEncoder example in password-storage.adoc
Replaces the usage of BCryptPasswordEncoder with
BcryptPassword4jPasswordEncoder in documentation samples.

Signed-off-by: Chen He <nidhogg55555@gmail.com>
2026-02-19 14:29:53 -06:00
Minu Kim
18068c9099 fix compile warning in spring-security-test
Signed-off-by: Minu Kim <kmw106933@naver.com>
2026-02-19 14:26:20 -06:00
Tran Ngoc Nhan
a539f056f7 Add javadoc-warnings-error
Closes gh-18452

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-19 13:48:28 -06:00
Robert Winch
2b04177151
Merge branch '7.0.x' 2026-02-19 13:30:21 -06:00
Robert Winch
a4a6e9124c
Merge branch '6.5.x' into 7.0.x 2026-02-19 13:30:13 -06:00
Robert Winch
b21159f453
Bump org.junit:junit-bom from 6.0.2 to 6.0.3 2026-02-19 13:29:42 -06:00
Robert Winch
6f7c8cb352
Bump org-apache-maven-resolver from 1.9.25 to 1.9.26 2026-02-19 13:29:36 -06:00
Robert Winch
5973a66bb1
Bump ch.qos.logback:logback-classic from 1.5.29 to 1.5.32 2026-02-19 13:29:30 -06:00
Robert Winch
3e3eeda560
Bump ch.qos.logback:logback-classic from 1.5.29 to 1.5.32 2026-02-19 13:28:49 -06:00
Robert Winch
cc6a005aa5 Add InetAddressMatcher
Co-authored-by: Gábor Vaspöri <gabor.vaspori@gmail.com>
Co-authored-by: Kian Jamali <kianjamali123@gmail.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
2026-02-19 11:44:19 -06:00
Robert Winch
d4589c0fcb
Merge branch '7.0.x' 2026-02-19 11:00:16 -06:00
dependabot[bot]
e2486a2590 Bump org.springframework:spring-framework-bom from 7.0.4 to 7.0.5
Bumps [org.springframework:spring-framework-bom](https://github.com/spring-projects/spring-framework) from 7.0.4 to 7.0.5.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v7.0.4...v7.0.5)

---
updated-dependencies:
- dependency-name: org.springframework:spring-framework-bom
  dependency-version: 7.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-19 10:58:10 -06:00
Tran Ngoc Nhan
dbf7f4cfe5 Remove unused @Nullable
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-19 10:56:54 -06:00
dependabot[bot]
f27738c1f8 Bump org.springframework:spring-framework-bom from 7.0.4 to 7.0.5
Bumps [org.springframework:spring-framework-bom](https://github.com/spring-projects/spring-framework) from 7.0.4 to 7.0.5.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v7.0.4...v7.0.5)

---
updated-dependencies:
- dependency-name: org.springframework:spring-framework-bom
  dependency-version: 7.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-19 03:18:04 +00:00
wonderfulrosemari
8d76ae0844 Document multipart CSRF header option
Closes gh-4265

Signed-off-by: wonderfulrosemari <whwlsgur1419@naver.com>
2026-02-19 02:07:25 +09:00
dependabot[bot]
73b055baa9 Bump org-opensaml5 from 5.2.0 to 5.2.1
Bumps `org-opensaml5` from 5.2.0 to 5.2.1.

Updates `org.opensaml:opensaml-saml-api` from 5.2.0 to 5.2.1

Updates `org.opensaml:opensaml-saml-impl` from 5.2.0 to 5.2.1

---
updated-dependencies:
- dependency-name: org.opensaml:opensaml-saml-api
  dependency-version: 5.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.opensaml:opensaml-saml-impl
  dependency-version: 5.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-18 03:15:22 +00:00
earlgrey02
5194826606 implement single-line RSA key support
Signed-off-by: earlgrey02 <san06036@naver.com>
2026-02-17 17:29:04 -07:00
Josh Cummings
fc48088759 Polish
- Add @since version
- Change variable name to match method name

Issue gh-18623

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-17 17:19:42 -07:00
itsmevichu
d528be38bb Add postProcessor to Introspector Builder
Closes gh-18623

Signed-off-by: itsmevichu <vishnutheep@gmail.com>
2026-02-17 17:19:42 -07:00
Tran Ngoc Nhan
da0cd0bc68 Remove unused import
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Josh Cummings
410812c5bc Reduce Diff Size
This commit reorders the originally changed boolean logic so that it returns
false early, as it did before. This allows the change to remain small and also
keeps the most complex logical statements outside of the if statement.

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
329d9e2dfd Revert code
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
dc8ed8b168 Fix checkstyle
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
17933ddab3 Resolve feedback
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
deb6416c93 Fix checkstyle
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
9323775c5f Update javadoc and apply StringUtils#hasLength
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
4cc5f543ab Add author
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
67bc1d8d4a Polish some methods
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
17b5cdde55 Remove redundant check and exception
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
e91b098c7c Update javadoc
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan
21bef947b0 Use String#isEmpty
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Andrey Litvitski
6fcca39500 Mark CsrfTokenRequestAttributeHandler#setCsrfRequestAttributeName as Nullable
Closes: gh-18617

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-02-17 16:57:15 -07:00
Joe Grandja
544f635e9b Polish gh-17246 2026-02-17 16:35:57 -05:00
Evgeniy Cheban
e4dcffae8a Ensure ID Token is updated after refresh token (Reactive)
Closes gh-17188

Signed-off-by: Evgeniy Cheban <mister.cheban@gmail.com>
2026-02-17 14:38:15 -05:00
dependabot[bot]
f52f097a4d Bump ch.qos.logback:logback-classic from 1.5.31 to 1.5.32
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.31 to 1.5.32.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.5.31...v_1.5.32)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-version: 1.5.32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 03:16:46 +00:00
dependabot[bot]
1cd145d026 Bump org-apache-maven-resolver from 1.9.25 to 1.9.26
Bumps `org-apache-maven-resolver` from 1.9.25 to 1.9.26.

Updates `org.apache.maven.resolver:maven-resolver-connector-basic` from 1.9.25 to 1.9.26
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.25...maven-resolver-1.9.26)

Updates `org.apache.maven.resolver:maven-resolver-impl` from 1.9.25 to 1.9.26
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.25...maven-resolver-1.9.26)

Updates `org.apache.maven.resolver:maven-resolver-transport-http` from 1.9.25 to 1.9.26

---
updated-dependencies:
- dependency-name: org.apache.maven.resolver:maven-resolver-connector-basic
  dependency-version: 1.9.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-impl
  dependency-version: 1.9.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-transport-http
  dependency-version: 1.9.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 03:16:31 +00:00
dependabot[bot]
3c55f057b1
Bump ch.qos.logback:logback-classic from 1.5.29 to 1.5.32
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.29 to 1.5.32.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.5.29...v_1.5.32)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-version: 1.5.32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 03:10:25 +00:00
dependabot[bot]
6d2a414022
Bump org-apache-maven-resolver from 1.9.25 to 1.9.26
Bumps `org-apache-maven-resolver` from 1.9.25 to 1.9.26.

Updates `org.apache.maven.resolver:maven-resolver-connector-basic` from 1.9.25 to 1.9.26
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.25...maven-resolver-1.9.26)

Updates `org.apache.maven.resolver:maven-resolver-impl` from 1.9.25 to 1.9.26
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.25...maven-resolver-1.9.26)

Updates `org.apache.maven.resolver:maven-resolver-transport-http` from 1.9.25 to 1.9.26

---
updated-dependencies:
- dependency-name: org.apache.maven.resolver:maven-resolver-connector-basic
  dependency-version: 1.9.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-impl
  dependency-version: 1.9.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-transport-http
  dependency-version: 1.9.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 03:09:56 +00:00
dependabot[bot]
58df50c3a3
Bump org-apache-maven-resolver from 1.9.25 to 1.9.26
Bumps `org-apache-maven-resolver` from 1.9.25 to 1.9.26.

Updates `org.apache.maven.resolver:maven-resolver-connector-basic` from 1.9.25 to 1.9.26
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.25...maven-resolver-1.9.26)

Updates `org.apache.maven.resolver:maven-resolver-impl` from 1.9.25 to 1.9.26
- [Release notes](https://github.com/apache/maven-resolver/releases)
- [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.25...maven-resolver-1.9.26)

Updates `org.apache.maven.resolver:maven-resolver-transport-http` from 1.9.25 to 1.9.26

---
updated-dependencies:
- dependency-name: org.apache.maven.resolver:maven-resolver-connector-basic
  dependency-version: 1.9.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-impl
  dependency-version: 1.9.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.resolver:maven-resolver-transport-http
  dependency-version: 1.9.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 03:06:35 +00:00
dependabot[bot]
79156b2387
Bump ch.qos.logback:logback-classic from 1.5.29 to 1.5.32
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.29 to 1.5.32.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.5.29...v_1.5.32)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-version: 1.5.32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 03:06:15 +00:00
dependabot[bot]
4aa9ff99f5 Bump org.junit:junit-bom from 6.0.2 to 6.0.3
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](https://github.com/junit-team/junit-framework/compare/r6.0.2...r6.0.3)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 03:18:27 +00:00
dependabot[bot]
9b978ae70b Bump ch.qos.logback:logback-classic from 1.5.29 to 1.5.31
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.29 to 1.5.31.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.5.29...v_1.5.31)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-version: 1.5.31
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 03:17:59 +00:00
dependabot[bot]
3abb69d5a9
Bump org.junit:junit-bom from 6.0.2 to 6.0.3
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](https://github.com/junit-team/junit-framework/compare/r6.0.2...r6.0.3)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 03:15:44 +00:00
github-actions[bot]
6c2b2a7611 Next development version 2026-02-13 18:24:26 +00:00
github-actions[bot]
0fab34f359 Release 6.5.8 2026-02-13 17:54:05 +00:00
Joe Grandja
73dff1f8a3 Next development version 2026-02-13 12:23:48 -05:00
Josh Cummings
e5906d97ea Remove Typo in Java Version Declaration
Issue gh-18512

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-13 10:04:03 -07:00
github-actions[bot]
c0da8b390b Next development version 2026-02-13 15:57:31 +00:00
github-actions[bot]
ffe73b4920 Release 7.0.3 2026-02-13 15:26:51 +00:00
Joe Grandja
f0ffda89e0 Update to spring-data-bom 2025.1.3
Closes gh-18735
2026-02-13 08:18:47 -05:00
dependabot[bot]
746c6e124e Bump org.springframework:spring-framework-bom from 7.0.3 to 7.0.4
Bumps [org.springframework:spring-framework-bom](https://github.com/spring-projects/spring-framework) from 7.0.3 to 7.0.4.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v7.0.3...v7.0.4)

---
updated-dependencies:
- dependency-name: org.springframework:spring-framework-bom
  dependency-version: 7.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-13 06:48:23 -05:00
dependabot[bot]
08e5b375ac Bump io.projectreactor:reactor-bom from 2024.0.14 to 2024.0.15
Bumps [io.projectreactor:reactor-bom](https://github.com/reactor/reactor) from 2024.0.14 to 2024.0.15.
- [Release notes](https://github.com/reactor/reactor/releases)
- [Commits](https://github.com/reactor/reactor/compare/2024.0.14...2024.0.15)

---
updated-dependencies:
- dependency-name: io.projectreactor:reactor-bom
  dependency-version: 2024.0.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-13 06:41:17 -05:00
dependabot[bot]
123a2d79cf Bump io.projectreactor:reactor-bom from 2025.0.2 to 2025.0.3
Bumps [io.projectreactor:reactor-bom](https://github.com/reactor/reactor) from 2025.0.2 to 2025.0.3.
- [Release notes](https://github.com/reactor/reactor/releases)
- [Commits](https://github.com/reactor/reactor/compare/2025.0.2...2025.0.3)

---
updated-dependencies:
- dependency-name: io.projectreactor:reactor-bom
  dependency-version: 2025.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-13 06:40:14 -05:00
dependabot[bot]
f9c32afb6f Bump org.springframework:spring-framework-bom from 6.2.15 to 6.2.16
Bumps [org.springframework:spring-framework-bom](https://github.com/spring-projects/spring-framework) from 6.2.15 to 6.2.16.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.15...v6.2.16)

---
updated-dependencies:
- dependency-name: org.springframework:spring-framework-bom
  dependency-version: 6.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-13 06:33:08 -05:00
dependabot[bot]
0c3e483432 Bump org.springframework.ldap:spring-ldap-core from 4.0.1 to 4.0.2
Bumps [org.springframework.ldap:spring-ldap-core](https://github.com/spring-projects/spring-ldap) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/spring-projects/spring-ldap/releases)
- [Changelog](https://github.com/spring-projects/spring-ldap/blob/main/changelog.txt)
- [Commits](https://github.com/spring-projects/spring-ldap/compare/4.0.1...4.0.2)

---
updated-dependencies:
- dependency-name: org.springframework.ldap:spring-ldap-core
  dependency-version: 4.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-13 06:31:35 -05:00
dependabot[bot]
3d61276a1a Bump io.spring.gradle:spring-security-release-plugin
Bumps [io.spring.gradle:spring-security-release-plugin](https://github.com/spring-io/spring-security-release-tools) from 1.0.13 to 1.0.14.
- [Release notes](https://github.com/spring-io/spring-security-release-tools/releases)
- [Changelog](https://github.com/spring-io/spring-security-release-tools/blob/main/RELEASE.adoc)
- [Commits](https://github.com/spring-io/spring-security-release-tools/compare/v1.0.13...v1.0.14)

---
updated-dependencies:
- dependency-name: io.spring.gradle:spring-security-release-plugin
  dependency-version: 1.0.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-12 10:31:30 -07:00
coehgns
0d3a5d210a Add tests for PathPatternRequestMatcher path caching
Verify parsed request path is cleared when matcher parses it, and preserved when already present.

Signed-off-by: coehgns <modooboiroo@gmail.com>
2026-02-12 11:13:02 +09:00
269 changed files with 7879 additions and 891 deletions

View File

@ -64,6 +64,7 @@ updates:
- shibboleth
ignore:
- dependency-name: com.nimbusds:nimbus-jose-jwt
- dependency-name: io.spring.nullability:*
- dependency-name: org.python:jython
- dependency-name: org.apache.directory.server:*
- dependency-name: org.apache.directory.shared:*

View File

@ -14,7 +14,7 @@ permissions:
jobs:
snapshot-test:
name: Test Against Snapshots
uses: spring-io/spring-security-release-tools/.github/workflows/test.yml@7d42d82298553f123a9dad622e0eac725aaf52ef # v1.0.13
uses: spring-io/spring-security-release-tools/.github/workflows/test.yml@729fed56d42122f88583aff1be35c0800b7d77e9 # v1.0.14
strategy:
matrix:
include:

View File

@ -55,7 +55,7 @@ jobs:
release-repo-url: https://repo1.maven.org/maven2
artifact-path: org/springframework/security/spring-security-core
slack-announcing-id: spring-security-announcing
java-version: 25:q
java-version: 25
secrets: inherit
send-notification:
name: Send Notification

View File

@ -9,6 +9,7 @@ permissions:
jobs:
upgrade_wrapper:
name: Execution
if: ${{ github.repository == 'spring-projects/spring-security' }}
runs-on: ubuntu-latest
steps:
- name: Set up Git configuration

View File

@ -34,7 +34,7 @@ jobs:
run: ./gradlew -PbuildSrc.skipTests=true :spring-security-docs:antora
- name: Upload Docs
id: upload
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: docs
path: docs/build/site

View File

@ -12,8 +12,9 @@ permissions:
jobs:
update-antora-ui-spring:
runs-on: ubuntu-latest
name: Update on Supported Branches
if: ${{ github.repository == 'spring-projects/spring-security' }}
runs-on: ubuntu-latest
strategy:
matrix:
branch: [ '6.5.x', '7.0.x', 'main' ]
@ -25,8 +26,9 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
antora-file-path: 'docs/antora-playbook.yml'
update-antora-ui-spring-docs-build:
runs-on: ubuntu-latest
name: Update on docs-build
if: ${{ github.repository == 'spring-projects/spring-security' }}
runs-on: ubuntu-latest
steps:
- uses: spring-io/spring-doc-actions/update-antora-spring-ui@415e2b11a766ba64799fffb5c97a4f7e17f677cf
name: Update

View File

@ -68,6 +68,27 @@ The https://github.com/spring-projects/spring-security/tree/docs-build[playbook
Discover more commands with `./gradlew tasks`.
=== IDE setup (IntelliJ)
No special steps are needed to open Spring Security in IntelliJ.
=== IDE setup (Eclipse and VS Code)
To work in Eclipse or VS Code, first generate Eclipse metadata so you can import the project into Eclipse or VS Code:
[indent=0]
----
./gradlew cleanEclipse eclipse
----
If you have not built the project yet, run `./gradlew publishToMavenLocal` first so dependencies are resolved.
*VS Code:* Open the repository root as a folder. The repository includes `.vscode/settings.json` which disables automatic Gradle import so that the generated Eclipse metadata (`.classpath`, `.project`) is used. Do not use the Gradle for Java extension to import the project.
*Eclipse:* File → Import → General → Existing Projects into Workspace, then select the repository root.
The build uses a custom Eclipse plugin to work around Gradle dependency cycles that confuse IDE metadata generation. You may see Eclipse warnings about `xml-apis` from some test dependencies; those are excluded in the build and can be ignored.
== 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.

View File

@ -31,6 +31,7 @@ import org.jspecify.annotations.Nullable;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.method.AbstractFallbackMethodSecurityMetadataSource;
import org.springframework.util.StringUtils;
/**
* Sources method security metadata from major JSR 250 security annotations.
@ -108,7 +109,7 @@ public class Jsr250MethodSecurityMetadataSource extends AbstractFallbackMethodSe
if (role == null) {
return role;
}
if (this.defaultRolePrefix == null || this.defaultRolePrefix.length() == 0) {
if (!StringUtils.hasLength(this.defaultRolePrefix)) {
return role;
}
if (role.startsWith(this.defaultRolePrefix)) {

View File

@ -23,6 +23,7 @@ import java.util.Locale;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jspecify.annotations.Nullable;
import org.springframework.core.log.LogMessage;
import org.springframework.security.access.PermissionEvaluator;
@ -73,7 +74,7 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
* be overridden using a null check in the expression itself).
*/
@Override
public boolean hasPermission(Authentication authentication, Object domainObject, Object permission) {
public boolean hasPermission(Authentication authentication, @Nullable Object domainObject, Object permission) {
if (domainObject == null) {
return false;
}

View File

@ -0,0 +1,79 @@
/*
* Copyright 2004-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.acls.aot.hint;
import java.util.stream.Stream;
import org.jspecify.annotations.Nullable;
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeReference;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.security.acls.domain.AclImpl;
import org.springframework.security.acls.domain.AuditLogger;
import org.springframework.security.acls.domain.BasePermission;
import org.springframework.security.acls.domain.GrantedAuthoritySid;
import org.springframework.security.acls.domain.ObjectIdentityImpl;
import org.springframework.security.acls.domain.PrincipalSid;
import org.springframework.security.acls.model.AccessControlEntry;
import org.springframework.security.acls.model.Acl;
import org.springframework.security.acls.model.AuditableAccessControlEntry;
import org.springframework.security.acls.model.ObjectIdentity;
import org.springframework.security.acls.model.Sid;
/**
* {@link RuntimeHintsRegistrar} for ACL (Access Control List) classes.
*
* @author Josh Long
*/
class AclRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
registerAclDomainHints(hints);
registerJdbcSchemaHints(hints);
}
private void registerAclDomainHints(RuntimeHints hints) {
// Register core ACL domain types
Stream
.of(Acl.class, AccessControlEntry.class, AuditableAccessControlEntry.class, ObjectIdentity.class, Sid.class,
AclImpl.class, AccessControlEntry.class, AuditLogger.class, ObjectIdentityImpl.class,
PrincipalSid.class, GrantedAuthoritySid.class, BasePermission.class)
.forEach((c) -> hints.reflection()
.registerType(TypeReference.of(c),
(builder) -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.ACCESS_DECLARED_FIELDS)));
}
private void registerJdbcSchemaHints(RuntimeHints hints) {
String[] sqlFiles = new String[] { "createAclSchema.sql", "createAclSchemaMySQL.sql",
"createAclSchemaOracle.sql", "createAclSchemaPostgres.sql", "createAclSchemaSqlServer.sql",
"createAclSchemaWithAclClassIdType.sql", "select.sql" };
for (String sqlFile : sqlFiles) {
Resource sqlResource = new ClassPathResource(sqlFile);
if (sqlResource.exists()) {
hints.resources().registerResource(sqlResource);
}
}
}
}

View File

@ -0,0 +1,23 @@
/*
* Copyright 2004-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* AOT and native image hint support for ACLs.
*/
@NullMarked
package org.springframework.security.acls.aot.hint;
import org.jspecify.annotations.NullMarked;

View File

@ -0,0 +1,2 @@
org.springframework.aot.hint.RuntimeHintsRegistrar=\
org.springframework.security.acls.aot.hint.AclRuntimeHints

View File

@ -8,3 +8,4 @@ tasks.withType(JavaCompile) {
tasks.withType(KotlinCompile) {
kotlinOptions.allWarningsAsErrors = true
}

View File

@ -34,6 +34,7 @@ import org.springframework.util.Assert;
* and using the current URL minus the artifact and the corresponding value.
*
* @author Rob Winch
* @author Ngoc Nhan
*/
final class DefaultServiceAuthenticationDetails extends WebAuthenticationDetails
implements ServiceAuthenticationDetails {
@ -74,10 +75,9 @@ final class DefaultServiceAuthenticationDetails extends WebAuthenticationDetails
if (this == obj) {
return true;
}
if (!super.equals(obj) || !(obj instanceof DefaultServiceAuthenticationDetails)) {
if (!super.equals(obj) || !(obj instanceof DefaultServiceAuthenticationDetails that)) {
return false;
}
ServiceAuthenticationDetails that = (ServiceAuthenticationDetails) obj;
return this.serviceUrl.equals(that.getServiceUrl());
}
@ -101,7 +101,11 @@ final class DefaultServiceAuthenticationDetails extends WebAuthenticationDetails
/**
* If present, removes the artifactParameterName and the corresponding value from the
* query String.
* @param request
* @param request the current {@link HttpServletRequest} to obtain the
* {@link #getServiceUrl()} from.
* @param artifactPattern the {@link Pattern} that will be used to clean up the query
* string from containing the artifact name and value. This can be created using
* {@link #createArtifactPattern(String)}.
* @return the query String minus the artifactParameterName and the corresponding
* value.
*/
@ -111,7 +115,7 @@ final class DefaultServiceAuthenticationDetails extends WebAuthenticationDetails
return null;
}
String result = artifactPattern.matcher(query).replaceFirst("");
if (result.length() == 0) {
if (result.isEmpty()) {
return null;
}
// strip off the trailing & only if the artifact was the first query param
@ -122,8 +126,9 @@ final class DefaultServiceAuthenticationDetails extends WebAuthenticationDetails
* Creates a {@link Pattern} that can be passed into the constructor. This allows the
* {@link Pattern} to be reused for every instance of
* {@link DefaultServiceAuthenticationDetails}.
* @param artifactParameterName
* @return
* @param artifactParameterName the artifactParameterName that is removed from the
* current URL. The result becomes the service url. Cannot be null or an empty String.
* @return a {@link Pattern}
*/
static Pattern createArtifactPattern(String artifactParameterName) {
Assert.hasLength(artifactParameterName, "artifactParameterName is expected to have a length");

View File

@ -5,6 +5,7 @@ apply plugin: 'io.spring.convention.spring-module'
apply plugin: 'trang'
apply plugin: 'security-kotlin'
apply plugin: 'test-compile-target-jdk25'
apply plugin: 'compile-warnings-error'
apply plugin: 'javadoc-warnings-error'
configurations {

View File

@ -36,6 +36,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
import org.springframework.core.log.LogMessage;
import org.springframework.lang.Contract;
import org.springframework.security.authentication.AuthenticationEventPublisher;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.DefaultAuthenticationEventPublisher;
@ -302,6 +303,7 @@ public class AuthenticationConfiguration {
}
@Override
@Contract("!null -> !null; null -> null")
public String encode(CharSequence rawPassword) {
return getPasswordEncoder().encode(rawPassword);
}

View File

@ -30,6 +30,7 @@ import org.springframework.context.annotation.Scope;
import org.springframework.core.MethodParameter;
import org.springframework.core.ResolvableType;
import org.springframework.core.io.support.SpringFactoriesLoader;
import org.springframework.lang.Contract;
import org.springframework.security.authentication.AuthenticationEventPublisher;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.DefaultAuthenticationEventPublisher;
@ -293,6 +294,7 @@ class HttpSecurityConfiguration {
}
@Override
@Contract("!null -> !null; null -> null")
public String encode(CharSequence rawPassword) {
return getPasswordEncoder().encode(rawPassword);
}

View File

@ -521,8 +521,10 @@ public final class OAuth2ResourceServerConfigurer<H extends HttpSecurityBuilder<
public OpaqueTokenConfigurer introspectionUri(String introspectionUri) {
Assert.notNull(introspectionUri, "introspectionUri cannot be null");
this.introspectionUri = introspectionUri;
this.introspector = () -> new SpringOpaqueTokenIntrospector(this.introspectionUri, this.clientId,
this.clientSecret);
this.introspector = () -> SpringOpaqueTokenIntrospector.withIntrospectionUri(this.introspectionUri)
.clientId(this.clientId)
.clientSecret(this.clientSecret)
.build();
return this;
}
@ -531,8 +533,10 @@ public final class OAuth2ResourceServerConfigurer<H extends HttpSecurityBuilder<
Assert.notNull(clientSecret, "clientSecret cannot be null");
this.clientId = clientId;
this.clientSecret = clientSecret;
this.introspector = () -> new SpringOpaqueTokenIntrospector(this.introspectionUri, this.clientId,
this.clientSecret);
this.introspector = () -> SpringOpaqueTokenIntrospector.withIntrospectionUri(this.introspectionUri)
.clientId(this.clientId)
.clientSecret(this.clientSecret)
.build();
return this;
}

View File

@ -124,6 +124,10 @@ class AuthorizationFilterParser implements BeanDefinitionParser {
List<Element> interceptMessages = DomUtils.getChildElementsByTagName(element, Elements.INTERCEPT_URL);
for (Element interceptMessage : interceptMessages) {
String accessExpression = interceptMessage.getAttribute(ATT_ACCESS);
if (!StringUtils.hasText(accessExpression)) {
parserContext.getReaderContext().error("access attribute cannot be empty or null", interceptMessage);
continue;
}
BeanDefinitionBuilder authorizationManager = BeanDefinitionBuilder
.rootBeanDefinition(WebExpressionAuthorizationManager.class);
authorizationManager.addPropertyReference("expressionHandler", expressionHandlerRef);

View File

@ -142,10 +142,11 @@ public class FilterInvocationSecurityMetadataSourceParser implements BeanDefinit
ManagedMap<BeanMetadataElement, BeanDefinition> filterInvocationDefinitionMap = new ManagedMap<>();
for (Element urlElt : urlElts) {
String access = urlElt.getAttribute(ATT_ACCESS);
String path = urlElt.getAttribute(ATT_PATTERN);
if (!StringUtils.hasText(access)) {
parserContext.getReaderContext().error("access attribute cannot be empty or null", urlElt);
continue;
}
String path = urlElt.getAttribute(ATT_PATTERN);
String matcherRef = urlElt.getAttribute(HttpSecurityBeanDefinitionParser.ATT_REQUEST_MATCHER_REF);
boolean hasMatcherRef = StringUtils.hasText(matcherRef);
if (!hasMatcherRef && !StringUtils.hasText(path)) {

View File

@ -23,9 +23,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Supplier;
import org.jspecify.annotations.Nullable;
import org.w3c.dom.Element;
import org.springframework.beans.BeansException;
@ -44,25 +42,18 @@ import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.beans.factory.xml.XmlReaderContext;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.messaging.Message;
import org.springframework.messaging.simp.SimpMessageType;
import org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler;
import org.springframework.security.access.expression.ExpressionUtils;
import org.springframework.security.access.expression.SecurityExpressionHandler;
import org.springframework.security.access.vote.ConsensusBased;
import org.springframework.security.authorization.AuthorizationDecision;
import org.springframework.security.authorization.AuthorizationManager;
import org.springframework.security.authorization.AuthorizationResult;
import org.springframework.security.config.Elements;
import org.springframework.security.config.http.MessageMatcherFactoryBean;
import org.springframework.security.config.web.messaging.PathPatternMessageMatcherBuilderFactoryBean;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.context.SecurityContextHolderStrategy;
import org.springframework.security.messaging.access.expression.ExpressionBasedMessageSecurityMetadataSourceFactory;
import org.springframework.security.messaging.access.expression.MessageAuthorizationContextSecurityExpressionHandler;
import org.springframework.security.messaging.access.expression.MessageExpressionAuthorizationManager;
import org.springframework.security.messaging.access.expression.MessageExpressionVoter;
import org.springframework.security.messaging.access.intercept.AuthorizationChannelInterceptor;
import org.springframework.security.messaging.access.intercept.ChannelSecurityInterceptor;
@ -75,7 +66,6 @@ import org.springframework.security.messaging.util.matcher.SimpMessageTypeMatche
import org.springframework.security.messaging.web.csrf.XorCsrfChannelInterceptor;
import org.springframework.security.messaging.web.socket.server.CsrfTokenHandshakeInterceptor;
import org.springframework.util.AntPathMatcher;
import org.springframework.util.Assert;
import org.springframework.util.PathMatcher;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;
@ -219,9 +209,15 @@ public final class WebSocketMessageBrokerSecurityBeanDefinitionParser implements
String messageType = interceptMessage.getAttribute(TYPE_ATTR);
BeanDefinition matcher = createMatcher(matcherPattern, messageType, parserContext, interceptMessage);
BeanDefinitionBuilder authorizationManager = BeanDefinitionBuilder
.rootBeanDefinition(ExpressionBasedAuthorizationManager.class);
.rootBeanDefinition(MessageExpressionAuthorizationManager.class);
if (StringUtils.hasText(expressionHandlerRef)) {
authorizationManager.addConstructorArgReference(expressionHandlerRef);
BeanDefinitionBuilder authorizationManagerBuilder = BeanDefinitionBuilder
.rootBeanDefinition(MessageExpressionAuthorizationManager.class);
authorizationManagerBuilder.setFactoryMethod("withSecurityExpressionHandler");
authorizationManagerBuilder.addConstructorArgReference(expressionHandlerRef);
String authorizationManagerBuilderRef = context
.registerWithGeneratedName(authorizationManagerBuilder.getBeanDefinition());
authorizationManager.setFactoryMethodOnBean("expression", authorizationManagerBuilderRef);
}
authorizationManager.addConstructorArgValue(accessExpression);
matcherToExpression.put(matcher, authorizationManager.getBeanDefinition());
@ -439,35 +435,6 @@ public final class WebSocketMessageBrokerSecurityBeanDefinitionParser implements
}
private static final class ExpressionBasedAuthorizationManager
implements AuthorizationManager<MessageAuthorizationContext<?>> {
private final SecurityExpressionHandler<MessageAuthorizationContext<?>> expressionHandler;
private final Expression expression;
private ExpressionBasedAuthorizationManager(String expression) {
this(new MessageAuthorizationContextSecurityExpressionHandler(), expression);
}
private ExpressionBasedAuthorizationManager(
SecurityExpressionHandler<MessageAuthorizationContext<?>> expressionHandler, String expression) {
Assert.notNull(expressionHandler, "expressionHandler cannot be null");
Assert.notNull(expression, "expression cannot be null");
this.expressionHandler = expressionHandler;
this.expression = this.expressionHandler.getExpressionParser().parseExpression(expression);
}
@Override
public AuthorizationResult authorize(Supplier<? extends @Nullable Authentication> authentication,
MessageAuthorizationContext<?> object) {
EvaluationContext context = this.expressionHandler.createEvaluationContext(authentication, object);
boolean granted = ExpressionUtils.evaluateAsBoolean(this.expression, context);
return new AuthorizationDecision(granted);
}
}
private static class MessageMatcherDelegatingAuthorizationManagerFactory {
private static AuthorizationManager<Message<?>> createMessageMatcherDelegatingAuthorizationManager(

View File

@ -286,7 +286,7 @@ class AuthorizeHttpRequestsDsl : AbstractRequestMatcherDsl {
if (factoryOfRequestAuthorizationContext != null) {
return factoryOfRequestAuthorizationContext
}
val factoryOfObjectType = ResolvableType.forClassWithGenerics(AuthorizationManagerFactory::class.java, Object::class.java)
val factoryOfObjectType = ResolvableType.forClassWithGenerics(AuthorizationManagerFactory::class.java, Any::class.java)
val factoryOfAny = context.getBeanProvider<AuthorizationManagerFactory<Any>>(factoryOfObjectType).getIfUnique()
if (factoryOfAny != null) {
return factoryOfAny
@ -303,20 +303,20 @@ class AuthorizeHttpRequestsDsl : AbstractRequestMatcherDsl {
return defaultFactory
}
private fun resolveRolePrefix(context: ApplicationContext): String {
private fun resolveRolePrefix(context: ApplicationContext): String? {
val beanNames = context.getBeanNamesForType(GrantedAuthorityDefaults::class.java)
if (beanNames.isNotEmpty()) {
return context.getBean(GrantedAuthorityDefaults::class.java).rolePrefix
}
return "ROLE_";
return null
}
private fun resolveRoleHierarchy(context: ApplicationContext): RoleHierarchy {
private fun resolveRoleHierarchy(context: ApplicationContext): RoleHierarchy? {
val beanNames = context.getBeanNamesForType(RoleHierarchy::class.java)
if (beanNames.isNotEmpty()) {
return context.getBean(RoleHierarchy::class.java)
}
return NullRoleHierarchy()
return null
}
}

View File

@ -37,9 +37,11 @@ class HeadersDsl {
private var cacheControl: ((HeadersConfigurer<HttpSecurity>.CacheControlConfig) -> Unit)? = null
private var hsts: ((HeadersConfigurer<HttpSecurity>.HstsConfig) -> Unit)? = null
private var frameOptions: ((HeadersConfigurer<HttpSecurity>.FrameOptionsConfig) -> Unit)? = null
@Suppress("DEPRECATION")
private var hpkp: ((HeadersConfigurer<HttpSecurity>.HpkpConfig) -> Unit)? = null
private var contentSecurityPolicy: ((HeadersConfigurer<HttpSecurity>.ContentSecurityPolicyConfig) -> Unit)? = null
private var referrerPolicy: ((HeadersConfigurer<HttpSecurity>.ReferrerPolicyConfig) -> Unit)? = null
@Suppress("DEPRECATION")
private var featurePolicyDirectives: String? = null
private var permissionsPolicy: ((HeadersConfigurer<HttpSecurity>.PermissionsPolicyConfig) -> Unit)? = null
private var crossOriginOpenerPolicy: ((HeadersConfigurer<HttpSecurity>.CrossOriginOpenerPolicyConfig) -> Unit)? = null
@ -120,6 +122,7 @@ class HeadersDsl {
* @deprecated see <a href="https://owasp.org/www-community/controls/Certificate_and_Public_Key_Pinning">Certificate and Public Key Pinning</a> for more context
*/
@Deprecated(message = "as of 5.8 with no replacement")
@Suppress("DEPRECATION")
fun httpPublicKeyPinning(hpkpConfig: HttpPublicKeyPinningDsl.() -> Unit) {
this.hpkp = HttpPublicKeyPinningDsl().apply(hpkpConfig).get()
}
@ -167,6 +170,7 @@ class HeadersDsl {
* @param policyDirectives policyDirectives the security policy directive(s)
*/
@Deprecated("Use 'permissionsPolicy { }' instead.")
@Suppress("DEPRECATION")
fun featurePolicy(policyDirectives: String) {
this.featurePolicyDirectives = policyDirectives
}

View File

@ -614,6 +614,7 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* @see [RequiresChannelDsl]
* @deprecated please use [redirectToHttps] instead
*/
@Suppress("DEPRECATION")
@Deprecated(message="since 6.5 use redirectToHttps instead")
fun requiresChannel(requiresChannelConfiguration: RequiresChannelDsl.() -> Unit) {
val requiresChannelCustomizer = RequiresChannelDsl().apply(requiresChannelConfiguration).get()

View File

@ -14,6 +14,8 @@
* limitations under the License.
*/
@file:Suppress("DEPRECATION")
package org.springframework.security.config.annotation.web
import org.springframework.security.config.annotation.web.builders.HttpSecurity

View File

@ -62,6 +62,7 @@ class X509Dsl {
authenticationDetailsSource?.also { x509.authenticationDetailsSource(authenticationDetailsSource) }
userDetailsService?.also { x509.userDetailsService(userDetailsService) }
authenticationUserDetailsService?.also { x509.authenticationUserDetailsService(authenticationUserDetailsService) }
@Suppress("DEPRECATION")
subjectPrincipalRegex?.also { x509.subjectPrincipalRegex(subjectPrincipalRegex) }
}
}

View File

@ -14,6 +14,8 @@
* limitations under the License.
*/
@file:Suppress("DEPRECATION")
package org.springframework.security.config.annotation.web.headers
import org.springframework.security.config.annotation.web.builders.HttpSecurity

View File

@ -68,12 +68,11 @@ class SessionFixationDsl {
internal fun get(): (SessionManagementConfigurer<HttpSecurity>.SessionFixationConfigurer) -> Unit {
return { sessionFixation ->
strategy?.also {
when (strategy) {
when (it) {
SessionFixationStrategy.NEW -> sessionFixation.newSession()
SessionFixationStrategy.MIGRATE -> sessionFixation.migrateSession()
SessionFixationStrategy.CHANGE_ID -> sessionFixation.changeSessionId()
SessionFixationStrategy.NONE -> sessionFixation.none()
null -> null
}
}
}

View File

@ -12,8 +12,8 @@ base64 =
## Whether a string should be base64 encoded
attribute base64 {xsd:boolean}
request-matcher =
## Defines the strategy use for matching incoming requests. Currently the options are 'mvc' (for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions and 'ciRegex' for case-insensitive regular expressions.
attribute request-matcher {"mvc" | "ant" | "regex" | "ciRegex"}
## Defines the strategy use for matching incoming requests. Currently the options are 'path' (for PathPatternRequestMatcher), 'regex' for regular expressions and 'ciRegex' for case-insensitive regular expressions.
attribute request-matcher {"path" | "regex" | "ciRegex"}
port =
## Specifies an IP port number. Used to configure an embedded LDAP server, for example.
attribute port { xsd:nonNegativeInteger }

View File

@ -27,15 +27,14 @@
<xs:attributeGroup name="request-matcher">
<xs:attribute name="request-matcher" use="required">
<xs:annotation>
<xs:documentation>Defines the strategy use for matching incoming requests. Currently the options are 'mvc'
(for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions
and 'ciRegex' for case-insensitive regular expressions.
<xs:documentation>Defines the strategy use for matching incoming requests. Currently the options are 'path'
(for PathPatternRequestMatcher), 'regex' for regular expressions and 'ciRegex' for
case-insensitive regular expressions.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="mvc"/>
<xs:enumeration value="ant"/>
<xs:enumeration value="path"/>
<xs:enumeration value="regex"/>
<xs:enumeration value="ciRegex"/>
</xs:restriction>
@ -1306,15 +1305,14 @@
</xs:attribute>
<xs:attribute name="request-matcher">
<xs:annotation>
<xs:documentation>Defines the strategy use for matching incoming requests. Currently the options are 'mvc'
(for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions
and 'ciRegex' for case-insensitive regular expressions.
<xs:documentation>Defines the strategy use for matching incoming requests. Currently the options are 'path'
(for PathPatternRequestMatcher), 'regex' for regular expressions and 'ciRegex' for
case-insensitive regular expressions.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="mvc"/>
<xs:enumeration value="ant"/>
<xs:enumeration value="path"/>
<xs:enumeration value="regex"/>
<xs:enumeration value="ciRegex"/>
</xs:restriction>
@ -2474,15 +2472,14 @@
<xs:attributeGroup name="filter-chain-map.attlist">
<xs:attribute name="request-matcher">
<xs:annotation>
<xs:documentation>Defines the strategy use for matching incoming requests. Currently the options are 'mvc'
(for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions
and 'ciRegex' for case-insensitive regular expressions.
<xs:documentation>Defines the strategy use for matching incoming requests. Currently the options are 'path'
(for PathPatternRequestMatcher), 'regex' for regular expressions and 'ciRegex' for
case-insensitive regular expressions.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="mvc"/>
<xs:enumeration value="ant"/>
<xs:enumeration value="path"/>
<xs:enumeration value="regex"/>
<xs:enumeration value="ciRegex"/>
</xs:restriction>
@ -2580,15 +2577,14 @@
</xs:attribute>
<xs:attribute name="request-matcher">
<xs:annotation>
<xs:documentation>Defines the strategy use for matching incoming requests. Currently the options are 'mvc'
(for Spring MVC matcher), 'ant' (for ant path patterns), 'regex' for regular expressions
and 'ciRegex' for case-insensitive regular expressions.
<xs:documentation>Defines the strategy use for matching incoming requests. Currently the options are 'path'
(for PathPatternRequestMatcher), 'regex' for regular expressions and 'ciRegex' for
case-insensitive regular expressions.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="mvc"/>
<xs:enumeration value="ant"/>
<xs:enumeration value="path"/>
<xs:enumeration value="regex"/>
<xs:enumeration value="ciRegex"/>
</xs:restriction>

View File

@ -20,6 +20,7 @@ import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.security.Principal;
import java.time.Duration;
import java.time.Instant;
import java.util.Collection;
import java.util.Date;
@ -245,12 +246,15 @@ import org.springframework.security.web.savedrequest.SimpleSavedRequest;
import org.springframework.security.web.server.firewall.ServerExchangeRejectedException;
import org.springframework.security.web.session.HttpSessionCreatedEvent;
import org.springframework.security.web.session.HttpSessionIdChangedEvent;
import org.springframework.security.web.webauthn.api.AttestationConveyancePreference;
import org.springframework.security.web.webauthn.api.AuthenticationExtensionsClientInputs;
import org.springframework.security.web.webauthn.api.AuthenticationExtensionsClientOutputs;
import org.springframework.security.web.webauthn.api.AuthenticatorAssertionResponse;
import org.springframework.security.web.webauthn.api.AuthenticatorAttachment;
import org.springframework.security.web.webauthn.api.AuthenticatorSelectionCriteria;
import org.springframework.security.web.webauthn.api.AuthenticatorTransport;
import org.springframework.security.web.webauthn.api.Bytes;
import org.springframework.security.web.webauthn.api.COSEAlgorithmIdentifier;
import org.springframework.security.web.webauthn.api.CredProtectAuthenticationExtensionsClientInput;
import org.springframework.security.web.webauthn.api.CredentialPropertiesOutput;
import org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientInput;
@ -258,12 +262,17 @@ import org.springframework.security.web.webauthn.api.ImmutableAuthenticationExte
import org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientOutputs;
import org.springframework.security.web.webauthn.api.ImmutablePublicKeyCredentialUserEntity;
import org.springframework.security.web.webauthn.api.PublicKeyCredential;
import org.springframework.security.web.webauthn.api.PublicKeyCredentialCreationOptions;
import org.springframework.security.web.webauthn.api.PublicKeyCredentialDescriptor;
import org.springframework.security.web.webauthn.api.PublicKeyCredentialParameters;
import org.springframework.security.web.webauthn.api.PublicKeyCredentialRequestOptions;
import org.springframework.security.web.webauthn.api.PublicKeyCredentialRpEntity;
import org.springframework.security.web.webauthn.api.PublicKeyCredentialType;
import org.springframework.security.web.webauthn.api.PublicKeyCredentialUserEntity;
import org.springframework.security.web.webauthn.api.ResidentKeyRequirement;
import org.springframework.security.web.webauthn.api.TestAuthenticationAssertionResponses;
import org.springframework.security.web.webauthn.api.TestBytes;
import org.springframework.security.web.webauthn.api.TestPublicKeyCredentialCreationOptions;
import org.springframework.security.web.webauthn.api.TestPublicKeyCredentialRequestOptions;
import org.springframework.security.web.webauthn.api.TestPublicKeyCredentialUserEntities;
import org.springframework.security.web.webauthn.api.TestPublicKeyCredentials;
@ -271,6 +280,7 @@ import org.springframework.security.web.webauthn.api.UserVerificationRequirement
import org.springframework.security.web.webauthn.authentication.WebAuthnAuthentication;
import org.springframework.security.web.webauthn.authentication.WebAuthnAuthenticationRequestToken;
import org.springframework.security.web.webauthn.management.RelyingPartyAuthenticationRequest;
import org.springframework.security.web.webauthn.management.TestPublicKeyCredentialRpEntities;
import org.springframework.util.ReflectionUtils;
final class SerializationSamples {
@ -284,6 +294,14 @@ final class SerializationSamples {
Authentication authentication = TestAuthentication.authenticated(user);
SecurityContext securityContext = new SecurityContextImpl(authentication);
instancioByClassName.put(OneTimeTokenAuthenticationToken.class, () -> {
@SuppressWarnings("removal")
InstancioOfClassApi<?> instancio = Instancio.of(OneTimeTokenAuthenticationToken.class);
instancio.supply(Select.all(OneTimeTokenAuthenticationToken.class),
(r) -> applyDetails(new OneTimeTokenAuthenticationToken("token")));
return instancio;
});
// oauth2-core
generatorByClassName.put(DefaultOAuth2User.class, (r) -> TestOAuth2Users.create());
generatorByClassName.put(OAuth2AuthorizationRequest.class,
@ -597,8 +615,7 @@ final class SerializationSamples {
token.setDetails(details);
return token;
});
generatorByClassName.put(OneTimeTokenAuthenticationToken.class,
(r) -> applyDetails(new OneTimeTokenAuthenticationToken("username", "token")));
generatorByClassName.put(OneTimeTokenAuthentication.class,
(r) -> applyDetails(new OneTimeTokenAuthentication("username", authentication.getAuthorities())));
generatorByClassName.put(AccessDeniedException.class,
@ -879,6 +896,36 @@ final class SerializationSamples {
generatorByClassName.put(CredentialPropertiesOutput.ExtensionOutput.class,
(r) -> new CredentialPropertiesOutput(true).getOutput());
AttestationConveyancePreference attestationConveyancePreference = AttestationConveyancePreference.DIRECT;
ResidentKeyRequirement residentKeyRequirement = ResidentKeyRequirement.REQUIRED;
AuthenticatorSelectionCriteria authenticatorSelectionCriteria = AuthenticatorSelectionCriteria.builder()
.authenticatorAttachment(AuthenticatorAttachment.PLATFORM)
.residentKey(residentKeyRequirement)
.userVerification(UserVerificationRequirement.REQUIRED)
.build();
PublicKeyCredentialParameters publicKeyCredentialParameters = PublicKeyCredentialParameters.RS256;
PublicKeyCredentialRpEntity publicKeyCredentialRpEntity = TestPublicKeyCredentialRpEntities.createRpEntity()
.build();
generatorByClassName.put(AttestationConveyancePreference.class, (r) -> attestationConveyancePreference);
generatorByClassName.put(ResidentKeyRequirement.class, (r) -> residentKeyRequirement);
generatorByClassName.put(AuthenticatorSelectionCriteria.class, (r) -> authenticatorSelectionCriteria);
generatorByClassName.put(COSEAlgorithmIdentifier.class, ((r) -> COSEAlgorithmIdentifier.RS256));
generatorByClassName.put(PublicKeyCredentialParameters.class, (r) -> publicKeyCredentialParameters);
generatorByClassName.put(PublicKeyCredentialRpEntity.class, (r) -> publicKeyCredentialRpEntity);
generatorByClassName.put(PublicKeyCredentialCreationOptions.class,
(o) -> TestPublicKeyCredentialCreationOptions.createPublicKeyCredentialCreationOptions()
.extensions(inputs)
.attestation(attestationConveyancePreference)
.authenticatorSelection(authenticatorSelectionCriteria)
.challenge(TestBytes.get())
.excludeCredentials(List.of(descriptor))
.rp(publicKeyCredentialRpEntity)
.pubKeyCredParams(publicKeyCredentialParameters)
.timeout(Duration.ofMinutes(5))
.user(TestPublicKeyCredentialUserEntities.userEntity().id(TestBytes.get()).build())
.build());
// One-Time Token
DefaultOneTimeToken oneTimeToken = new DefaultOneTimeToken(UUID.randomUUID().toString(), "user",
Instant.now().plusSeconds(300));

View File

@ -222,7 +222,8 @@ public class WebSecurityConfigurationTests {
// SEC-2773
@Test
public void getMethodDelegatingApplicationListenerWhenWebSecurityConfigurationThenIsStatic() {
Method method = ClassUtils.getMethod(WebSecurityConfiguration.class, "delegatingApplicationListener", null);
Method method = ClassUtils.getMethod(WebSecurityConfiguration.class, "delegatingApplicationListener",
(Class<?>[]) null);
assertThat(Modifier.isStatic(method.getModifiers())).isTrue();
}

View File

@ -1201,6 +1201,7 @@ public class HeadersConfigurerTests {
@Configuration
@EnableWebSecurity
@SuppressWarnings("removal")
static class PermissionsPolicyConfig {
@Bean
@ -1221,6 +1222,7 @@ public class HeadersConfigurerTests {
static class PermissionsPolicyStringConfig {
@Bean
@SuppressWarnings("removal")
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
// @formatter:off
http
@ -1235,6 +1237,7 @@ public class HeadersConfigurerTests {
@Configuration
@EnableWebSecurity
@SuppressWarnings("removal")
static class PermissionsPolicyInvalidConfig {
@Bean
@ -1252,6 +1255,7 @@ public class HeadersConfigurerTests {
@Configuration
@EnableWebSecurity
@SuppressWarnings("removal")
static class PermissionsPolicyInvalidStringConfig {
@Bean

View File

@ -1257,6 +1257,7 @@ public class OAuth2AuthorizationCodeGrantTests {
}
@Bean
@SuppressWarnings("removal")
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
jdbcOperations);

View File

@ -561,6 +561,7 @@ public class OAuth2ClientCredentialsGrantTests {
}
@Bean
@SuppressWarnings("removal")
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
jdbcOperations);

View File

@ -647,6 +647,7 @@ public class OAuth2ClientRegistrationTests {
// @formatter:on
@Bean
@SuppressWarnings("removal")
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
RegisteredClient registeredClient = TestRegisteredClients.registeredClient().build();
RegisteredClientParametersMapper registeredClientParametersMapper = new RegisteredClientParametersMapper();

View File

@ -469,6 +469,7 @@ public class OAuth2RefreshTokenGrantTests {
}
@Bean
@SuppressWarnings("removal")
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
jdbcOperations);

View File

@ -515,6 +515,7 @@ public class OAuth2TokenIntrospectionTests {
}
@Bean
@SuppressWarnings("removal")
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
jdbcOperations);

View File

@ -318,6 +318,7 @@ public class OAuth2TokenRevocationTests {
}
@Bean
@SuppressWarnings("removal")
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
jdbcOperations);

View File

@ -778,6 +778,7 @@ public class OidcClientRegistrationTests {
// @formatter:on
@Bean
@SuppressWarnings("removal")
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
RegisteredClient registeredClient = TestRegisteredClients.registeredClient().build();
RegisteredClientParametersMapper registeredClientParametersMapper = new RegisteredClientParametersMapper();

View File

@ -633,6 +633,7 @@ public class OidcTests {
}
@Bean
@SuppressWarnings("removal")
RegisteredClientRepository registeredClientRepository(JdbcOperations jdbcOperations) {
JdbcRegisteredClientRepository jdbcRegisteredClientRepository = new JdbcRegisteredClientRepository(
jdbcOperations);

View File

@ -337,6 +337,54 @@ public class InterceptUrlConfigTests {
assertThat(this.spring.getContext().getBean(AuthorizationManager.class)).isNotNull();
}
/**
* gh-18503
*/
@Test
public void configWhenInterceptUrlMissingAccessThenException() {
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> this.spring.configLocations(this.xml("MissingAccess")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
}
/**
* gh-18503
*/
@Test
public void configWhenInterceptUrlEmptyAccessThenException() {
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> this.spring.configLocations(this.xml("EmptyAccess")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
}
/**
* gh-18503
*/
@Test
public void configWhenInterceptUrlValidAccessThenLoads() {
assertThatNoException().isThrownBy(() -> this.spring.configLocations(this.xml("ValidAccess")).autowire());
}
/**
* gh-18503
*/
@Test
public void configWhenUseAuthorizationManagerFalseAndMissingAccessThenException() {
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> this.spring.configLocations(this.xml("MissingAccessLegacy")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
}
/**
* gh-18503
*/
@Test
public void configWhenUseAuthorizationManagerFalseAndEmptyAccessThenException() {
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> this.spring.configLocations(this.xml("EmptyAccessLegacy")).autowire())
.withMessageContaining("access attribute cannot be empty or null");
}
private static RequestPostProcessor adminCredentials() {
return httpBasic("admin", "password");
}

View File

@ -100,6 +100,7 @@ import static org.mockito.Mockito.verify;
* {@link org.springframework.security.config.web.server.ServerHttpSecurity.OAuth2ResourceServerSpec}
*/
@ExtendWith({ SpringTestContextExtension.class })
@SuppressWarnings("removal")
public class OAuth2ResourceServerSpecTests {
private String expired = "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE1MzUwMzc4OTd9.jqZDDjfc2eysX44lHXEIr9XFd2S8vjIZHCccZU-dRWMRJNsQ1QN5VNnJGklqJBXJR4qgla6cmVqPOLkUHDb0sL0nxM5XuzQaG5ZzKP81RV88shFyAiT0fD-6nl1k-Fai-Fu-VkzSpNXgeONoTxDaYhdB-yxmgrgsApgmbOTE_9AcMk-FQDXQ-pL9kynccFGV0lZx4CA7cyknKN7KBxUilfIycvXODwgKCjj_1WddLTCNGYogJJSg__7NoxzqbyWd3udbHVjqYq7GsMMrGB4_2kBD4CkghOSNcRHbT_DIXowxfAVT7PAg7Q0E5ruZsr2zPZacEUDhJ6-wbvlA0FAOUg";

View File

@ -167,6 +167,7 @@ public class OidcLogoutSpecTests {
}
@Test
@SuppressWarnings("removal")
void logoutWhenInvalidLogoutTokenThenBadRequest() {
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, DefaultConfig.class).autowire();
this.test.get().uri("/token/logout").exchange().expectStatus().isUnauthorized();
@ -209,6 +210,7 @@ public class OidcLogoutSpecTests {
}
@Test
@SuppressWarnings("removal")
void logoutWhenLogoutTokenSpecifiesOneSessionThenRemotelyInvalidatesOnlyThatSession() throws Exception {
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, DefaultConfig.class).autowire();
String registrationId = this.clientRegistration.getRegistrationId();
@ -252,6 +254,7 @@ public class OidcLogoutSpecTests {
}
@Test
@SuppressWarnings("removal")
void logoutWhenRemoteLogoutUriThenUses() {
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, LogoutUriConfig.class).autowire();
String registrationId = this.clientRegistration.getRegistrationId();
@ -302,6 +305,7 @@ public class OidcLogoutSpecTests {
}
@Test
@SuppressWarnings("removal")
void logoutWhenDifferentCookieNameThenUses() {
this.spring.register(OidcProviderConfig.class, CookieConfig.class).autowire();
String registrationId = this.clientRegistration.getRegistrationId();
@ -325,6 +329,7 @@ public class OidcLogoutSpecTests {
}
@Test
@SuppressWarnings("removal")
void logoutWhenRemoteLogoutFailsThenReportsPartialLogout() {
this.spring.register(WebServerConfig.class, OidcProviderConfig.class, WithBrokenLogoutConfig.class).autowire();
ServerLogoutHandler logoutHandler = this.spring.getContext().getBean(ServerLogoutHandler.class);

View File

@ -737,6 +737,7 @@ public class ServerHttpSecurityTests {
}
@Test
@SuppressWarnings("removal")
void resourcesWhenLoginPageConfiguredThenServesCss() {
this.http.formLogin(withDefaults());
this.http.authenticationManager(this.authenticationManager);

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION", "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")
/*
* Copyright 2004-present the original author or authors.
*

View File

@ -24,7 +24,7 @@
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http request-matcher="ant" use-authorization-manager="false">
<http request-matcher="path" use-authorization-manager="false">
<intercept-url pattern="/path" access="denyAll" servlet-path="/spring"/>
<http-basic/>
</http>

View File

@ -24,7 +24,7 @@
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http request-matcher="ant">
<http request-matcher="path">
<intercept-url pattern="/path" access="denyAll" servlet-path="/spring"/>
<http-basic/>
</http>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<b:beans xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security
https://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http>
<intercept-url pattern="/admin/**" access="" />
</http>
<user-service>
<user name="user" password="{noop}password" authorities="ROLE_USER"/>
</user-service>
</b:beans>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<b:beans xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security
https://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http use-authorization-manager="false">
<intercept-url pattern="/admin/**" access=""/>
</http>
<user-service>
<user name="user" password="{noop}password" authorities="ROLE_USER"/>
</user-service>
</b:beans>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<b:beans xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security
https://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http>
<intercept-url pattern="/admin/**"/>
</http>
<user-service>
<user name="user" password="{noop}password" authorities="ROLE_USER"/>
</user-service>
</b:beans>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<b:beans xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security
https://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http use-authorization-manager="false">
<intercept-url pattern="/admin/**"/>
</http>
<user-service>
<user name="user" password="{noop}password" authorities="ROLE_USER"/>
</user-service>
</b:beans>

View File

@ -27,7 +27,7 @@
http://www.springframework.org/schema/mvc
https://www.springframework.org/schema/mvc/spring-mvc.xsd">
<http auto-config="true" request-matcher="mvc" use-authorization-manager="false">
<http auto-config="true" request-matcher="path" use-authorization-manager="false">
<intercept-url pattern="/path" access="denyAll"/>
<http-basic/>
</http>

View File

@ -27,7 +27,7 @@
http://www.springframework.org/schema/mvc
https://www.springframework.org/schema/mvc/spring-mvc.xsd">
<http auto-config="true" request-matcher="mvc">
<http auto-config="true" request-matcher="path">
<intercept-url pattern="/path" access="denyAll"/>
<http-basic/>
</http>

View File

@ -27,7 +27,7 @@
http://www.springframework.org/schema/mvc
https://www.springframework.org/schema/mvc/spring-mvc.xsd">
<http auto-config="true" request-matcher="mvc" use-authorization-manager="false">
<http auto-config="true" request-matcher="path" use-authorization-manager="false">
<intercept-url pattern="/path" access="denyAll" servlet-path="/spring"/>
<http-basic/>
</http>

View File

@ -27,7 +27,7 @@
http://www.springframework.org/schema/mvc
https://www.springframework.org/schema/mvc/spring-mvc.xsd">
<http auto-config="true" request-matcher="mvc">
<http auto-config="true" request-matcher="path">
<intercept-url pattern="/path" access="denyAll" servlet-path="/spring"/>
<http-basic/>
</http>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<b:beans xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security
https://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<http>
<intercept-url pattern="/admin/**" access="hasRole('ADMIN')" />
<http-basic />
</http>
<user-service>
<user name="user" password="{noop}password" authorities="ROLE_USER"/>
</user-service>
</b:beans>

View File

@ -18,6 +18,8 @@ package org.springframework.security.access;
import java.io.Serializable;
import org.jspecify.annotations.Nullable;
import org.springframework.aop.framework.AopInfrastructureBean;
import org.springframework.security.core.Authentication;
@ -39,7 +41,7 @@ public interface PermissionEvaluator extends AopInfrastructureBean {
* expression system. Not null.
* @return true if the permission is granted, false otherwise
*/
boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission);
boolean hasPermission(Authentication authentication, @Nullable Object targetDomainObject, Object permission);
/**
* Alternative method for evaluating a permission where only the identifier of the

View File

@ -20,6 +20,7 @@ import java.io.Serializable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jspecify.annotations.Nullable;
import org.springframework.core.log.LogMessage;
import org.springframework.security.access.PermissionEvaluator;
@ -40,7 +41,7 @@ public class DenyAllPermissionEvaluator implements PermissionEvaluator {
* @return false always
*/
@Override
public boolean hasPermission(Authentication authentication, Object target, Object permission) {
public boolean hasPermission(Authentication authentication, @Nullable Object target, Object permission) {
this.logger.warn(LogMessage.format("Denying user %s permission '%s' on object %s", authentication.getName(),
permission, target));
return false;

View File

@ -38,6 +38,7 @@ import org.springframework.util.function.SingletonSupplier;
* @author Luke Taylor
* @author Evgeniy Cheban
* @author Steve Riesenberg
* @author Ngoc Nhan
* @since 3.0
*/
public abstract class SecurityExpressionRoot<T extends @Nullable Object> implements SecurityExpressionOperations {
@ -116,7 +117,7 @@ public abstract class SecurityExpressionRoot<T extends @Nullable Object> impleme
@Override
public final boolean hasAuthority(String authority) {
return isGranted(this.authorizationManagerFactory.hasAnyAuthority(authority));
return isGranted(this.authorizationManagerFactory.hasAuthority(authority));
}
@Override
@ -208,7 +209,8 @@ public abstract class SecurityExpressionRoot<T extends @Nullable Object> impleme
/**
* Convenience method to access {@link Authentication#getPrincipal()} from
* {@link #getAuthentication()}
* @return
* @return the {@code Principal} being authenticated or the authenticated principal
* after authentication.
*/
public @Nullable Object getPrincipal() {
return getAuthentication().getPrincipal();

View File

@ -35,6 +35,8 @@ import org.springframework.security.authentication.CredentialsExpiredException;
import org.springframework.security.authentication.DisabledException;
import org.springframework.security.authentication.LockedException;
import org.springframework.security.authentication.ProviderNotFoundException;
import org.springframework.security.authentication.RememberMeAuthenticationToken;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.authentication.event.AuthenticationFailureBadCredentialsEvent;
import org.springframework.security.authentication.event.AuthenticationFailureCredentialsExpiredEvent;
import org.springframework.security.authentication.event.AuthenticationFailureDisabledEvent;
@ -43,6 +45,7 @@ import org.springframework.security.authentication.event.AuthenticationFailureLo
import org.springframework.security.authentication.event.AuthenticationFailureProviderNotFoundEvent;
import org.springframework.security.authentication.event.AuthenticationFailureProxyUntrustedEvent;
import org.springframework.security.authentication.event.AuthenticationFailureServiceExceptionEvent;
import org.springframework.security.authentication.ott.OneTimeTokenAuthentication;
import org.springframework.security.core.context.SecurityContextImpl;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl;
@ -60,6 +63,7 @@ class CoreSecurityRuntimeHints implements RuntimeHintsRegistrar {
registerExceptionEventsHints(hints);
registerExpressionEvaluationHints(hints);
registerMethodSecurityHints(hints);
registerAdditionalAuthenticationTypes(hints);
hints.resources().registerResourceBundle("org.springframework.security.messages");
registerDefaultJdbcSchemaFileHint(hints);
registerSecurityContextHints(hints);
@ -114,4 +118,17 @@ class CoreSecurityRuntimeHints implements RuntimeHintsRegistrar {
(builder) -> builder.withMembers(MemberCategory.INVOKE_PUBLIC_METHODS));
}
private void registerAdditionalAuthenticationTypes(RuntimeHints hints) {
// RememberMeAuthenticationToken can be stored in the HTTP session and
// deserialized via Jackson (RememberMeAuthenticationTokenMixin exists for both
// Jackson 2 and 3), so it needs reflection hints in all native image scenarios.
Stream
.of(RememberMeAuthenticationToken.class, OneTimeTokenAuthentication.class,
UsernamePasswordAuthenticationToken.class)
.map(TypeReference::of)
.forEach((it) -> hints.reflection()
.registerType(it, (builder) -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.ACCESS_DECLARED_FIELDS)));
}
}

View File

@ -16,6 +16,7 @@
package org.springframework.security.authentication.dao;
import java.util.Objects;
import java.util.function.Supplier;
import org.jspecify.annotations.Nullable;
@ -43,6 +44,7 @@ import org.springframework.util.function.SingletonSupplier;
*
* @author Ben Alex
* @author Rob Winch
* @author Andrey Litvitski
*/
public class DaoAuthenticationProvider extends AbstractUserDetailsAuthenticationProvider {
@ -131,7 +133,8 @@ public class DaoAuthenticationProvider extends AbstractUserDetailsAuthentication
throw new CompromisedPasswordException("The provided password is compromised, please change your password");
}
String existingEncodedPassword = user.getPassword();
boolean upgradeEncoding = existingEncodedPassword != null && this.userDetailsPasswordService != null
boolean upgradeEncoding = existingEncodedPassword != null
&& !Objects.equals(this.userDetailsPasswordService, UserDetailsPasswordService.NOOP)
&& this.passwordEncoder.get().upgradeEncoding(existingEncodedPassword);
if (upgradeEncoding) {
String newPassword = this.passwordEncoder.get().encode(presentedPassword);

View File

@ -69,7 +69,11 @@ public final class AuthoritiesAuthorizationManager implements AuthorizationManag
private boolean isAuthorized(Authentication authentication, Collection<String> authorities) {
for (GrantedAuthority grantedAuthority : getGrantedAuthorities(authentication)) {
if (authorities.contains(grantedAuthority.getAuthority())) {
String authority = grantedAuthority.getAuthority();
if (authority == null) {
continue;
}
if (authorities.contains(authority)) {
return true;
}
}

View File

@ -87,9 +87,17 @@ public final class RsaKeyConverters {
"Key is not in PEM-encoded PKCS#8 format, please check that the header begins with "
+ PKCS8_PEM_HEADER);
StringBuilder base64Encoded = new StringBuilder();
for (String line : lines) {
if (RsaKeyConverters.isNotPkcs8Wrapper(line)) {
base64Encoded.append(line);
if (lines.size() == 1) {
base64Encoded.append(lines.get(0)
.replace(PKCS8_PEM_HEADER, "")
.replace(PKCS8_PEM_FOOTER, "")
.replaceAll("\\s+", ""));
}
else {
for (String line : lines) {
if (RsaKeyConverters.isNotPkcs8Wrapper(line)) {
base64Encoded.append(line);
}
}
}
byte[] pkcs8 = Base64.getDecoder().decode(base64Encoded.toString());
@ -165,9 +173,15 @@ public final class RsaKeyConverters {
@Override
public @NonNull RSAPublicKey convert(List<String> lines) {
StringBuilder base64Encoded = new StringBuilder();
for (String line : lines) {
if (isNotX509PemWrapper(line)) {
base64Encoded.append(line);
if (lines.size() == 1) {
base64Encoded.append(
lines.get(0).replace(X509_PEM_HEADER, "").replace(X509_PEM_FOOTER, "").replaceAll("\\s+", ""));
}
else {
for (String line : lines) {
if (isNotX509PemWrapper(line)) {
base64Encoded.append(line);
}
}
}
byte[] x509 = Base64.getDecoder().decode(base64Encoded.toString());
@ -196,9 +210,17 @@ public final class RsaKeyConverters {
@Override
public @NonNull RSAPublicKey convert(List<String> lines) {
StringBuilder base64Encoded = new StringBuilder();
for (String line : lines) {
if (isNotX509CertificateWrapper(line)) {
base64Encoded.append(line);
if (lines.size() == 1) {
base64Encoded.append(lines.get(0)
.replace(X509_CERT_HEADER, "")
.replace(X509_CERT_FOOTER, "")
.replaceAll("\\s+", ""));
}
else {
for (String line : lines) {
if (isNotX509CertificateWrapper(line)) {
base64Encoded.append(line);
}
}
}
byte[] x509 = Base64.getDecoder().decode(base64Encoded.toString());

View File

@ -88,7 +88,6 @@ public final class FactorGrantedAuthority implements GrantedAuthority {
private final Instant issuedAt;
@SuppressWarnings("NullAway")
private FactorGrantedAuthority(String authority, Instant issuedAt) {
Assert.notNull(authority, "authority cannot be null");
Assert.notNull(issuedAt, "issuedAt cannot be null");

View File

@ -21,6 +21,9 @@ import org.junit.jupiter.api.Test;
import org.springframework.security.authentication.AuthenticationTrustResolver;
import org.springframework.security.authentication.TestingAuthenticationToken;
import org.springframework.security.authorization.AuthorizationManager;
import org.springframework.security.authorization.AuthorizationManagerFactory;
import org.springframework.security.authorization.SingleResultAuthorizationManager;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.authority.AuthorityUtils;
@ -28,6 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
/**
* @author Luke Taylor
@ -174,4 +178,148 @@ public class SecurityExpressionRootTests {
assertThat(this.root.isAuthenticated()).isTrue();
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void hasAuthorityDelegatesToAuthorizationManagerFactoryHasAuthority() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.hasAuthority("CUSTOM_AUTHORITY")).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.hasAuthority("CUSTOM_AUTHORITY")).isFalse();
verify(factory).hasAuthority("CUSTOM_AUTHORITY");
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void hasAnyAuthorityDelegatesToAuthorizationManagerFactoryHasAnyAuthority() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.hasAnyAuthority("CUSTOM_AUTHORITY")).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.hasAnyAuthority("CUSTOM_AUTHORITY")).isFalse();
verify(factory).hasAnyAuthority("CUSTOM_AUTHORITY");
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void hasAllAuthoritiesDelegatesToAuthorizationManagerFactoryHasAllAuthorities() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.hasAllAuthorities("A", "B")).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.hasAllAuthorities("A", "B")).isFalse();
verify(factory).hasAllAuthorities("A", "B");
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void hasRoleDelegatesToAuthorizationManagerFactoryHasRole() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.hasRole("CUSTOM_ROLE")).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.hasRole("CUSTOM_ROLE")).isFalse();
verify(factory).hasRole("CUSTOM_ROLE");
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void hasAnyRoleDelegatesToAuthorizationManagerFactoryHasAnyRole() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.hasAnyRole("A", "B")).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.hasAnyRole("A", "B")).isFalse();
verify(factory).hasAnyRole("A", "B");
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void hasAllRolesDelegatesToAuthorizationManagerFactoryHasAllRoles() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.hasAllRoles("A", "B")).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.hasAllRoles("A", "B")).isFalse();
verify(factory).hasAllRoles("A", "B");
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void permitAllDelegatesToAuthorizationManagerFactoryPermitAll() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.permitAll()).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.permitAll()).isFalse();
verify(factory).permitAll();
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void denyAllDelegatesToAuthorizationManagerFactoryDenyAll() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.denyAll()).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.denyAll()).isFalse();
verify(factory).denyAll();
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void isAnonymousDelegatesToAuthorizationManagerFactoryAnonymous() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.anonymous()).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.isAnonymous()).isFalse();
verify(factory).anonymous();
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void isAuthenticatedDelegatesToAuthorizationManagerFactoryAuthenticated() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.authenticated()).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.isAuthenticated()).isFalse();
verify(factory).authenticated();
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void isRememberMeDelegatesToAuthorizationManagerFactoryRememberMe() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.rememberMe()).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.isRememberMe()).isFalse();
verify(factory).rememberMe();
}
// gh-18486
@Test
@SuppressWarnings("unchecked")
public void isFullyAuthenticatedDelegatesToAuthorizationManagerFactoryFullyAuthenticated() {
AuthorizationManagerFactory<Object> factory = mock(AuthorizationManagerFactory.class);
AuthorizationManager<Object> manager = SingleResultAuthorizationManager.denyAll();
given(factory.fullyAuthenticated()).willReturn(manager);
this.root.setAuthorizationManagerFactory(factory);
assertThat(this.root.isFullyAuthenticated()).isFalse();
verify(factory).fullyAuthenticated();
}
}

View File

@ -31,6 +31,7 @@ class OneTimeTokenAuthenticationTokenTests {
// gh-18095
@Test
@SuppressWarnings("removal")
void shouldBeAbleToDeserializeFromJsonWithDefaultTypingActivated() throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModules(SecurityJackson2Modules.getModules(getClass().getClassLoader()));

View File

@ -59,6 +59,7 @@ public class OneTimeTokenReactiveAuthenticationManagerTests {
private static final String TOKEN = "token";
@Test
@SuppressWarnings("removal")
public void constructorWhenOneTimeTokenServiceNullThenIllegalArgumentException() {
ReactiveUserDetailsService userDetailsService = mock(ReactiveUserDetailsService.class);
// @formatter:off
@ -68,6 +69,7 @@ public class OneTimeTokenReactiveAuthenticationManagerTests {
}
@Test
@SuppressWarnings("removal")
public void constructorWhenUserDetailsServiceNullThenIllegalArgumentException() {
ReactiveOneTimeTokenService oneTimeTokenService = mock(ReactiveOneTimeTokenService.class);
// @formatter:off
@ -77,6 +79,7 @@ public class OneTimeTokenReactiveAuthenticationManagerTests {
}
@Test
@SuppressWarnings("removal")
void authenticateWhenOneTimeTokenAuthenticationTokenIsPresentThenSuccess() {
ReactiveOneTimeTokenService oneTimeTokenService = mock(ReactiveOneTimeTokenService.class);
given(oneTimeTokenService.consume(ArgumentMatchers.any(OneTimeTokenAuthenticationToken.class)))
@ -103,6 +106,7 @@ public class OneTimeTokenReactiveAuthenticationManagerTests {
}
@Test
@SuppressWarnings("removal")
void authenticateWhenInvalidOneTimeTokenAuthenticationTokenIsPresentThenFail() {
ReactiveOneTimeTokenService oneTimeTokenService = mock(ReactiveOneTimeTokenService.class);
given(oneTimeTokenService.consume(ArgumentMatchers.any(OneTimeTokenAuthenticationToken.class)))
@ -120,6 +124,7 @@ public class OneTimeTokenReactiveAuthenticationManagerTests {
}
@Test
@SuppressWarnings("removal")
void authenticateWhenIncorrectTypeOfAuthenticationIsPresentThenFail() {
ReactiveOneTimeTokenService oneTimeTokenService = mock(ReactiveOneTimeTokenService.class);
given(oneTimeTokenService.consume(ArgumentMatchers.any(OneTimeTokenAuthenticationToken.class)))

View File

@ -17,7 +17,9 @@
package org.springframework.security.authorization;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import java.util.function.Supplier;
import org.junit.jupiter.api.Test;
@ -30,11 +32,13 @@ import org.springframework.security.core.Authentication;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatNullPointerException;
/**
* Tests for {@link AuthoritiesAuthorizationManager}.
*
* @author Evgeniy Cheban
* @author Khyojae
*/
class AuthoritiesAuthorizationManagerTests {
@ -83,4 +87,20 @@ class AuthoritiesAuthorizationManagerTests {
assertThat(manager.authorize(authentication, Collections.singleton("ROLE_USER")).isGranted()).isTrue();
}
@Test
// gh-18543
void authorizeWhenAuthorityIsNullThenDoesNotThrowNullPointerException() {
AuthoritiesAuthorizationManager manager = new AuthoritiesAuthorizationManager();
Authentication authentication = new TestingAuthenticationToken("user", "password",
Collections.singletonList(() -> null));
Collection<String> authoritiesContainsThrowsNPE = Set.of("ROLE_USER");
// must be Collection that throws NPE when .contains(null) is invoked
// to replicate the issue in gh-18543
assertThatNullPointerException().isThrownBy(() -> authoritiesContainsThrowsNPE.contains(null));
assertThat(manager.authorize(() -> authentication, authoritiesContainsThrowsNPE).isGranted()).isFalse();
}
}

View File

@ -61,7 +61,7 @@ public class AuthorityAuthorizationManagerTests {
@Test
public void hasAnyRoleWhenNullThenException() {
assertThatIllegalArgumentException().isThrownBy(() -> AuthorityAuthorizationManager.hasAnyRole(null))
assertThatIllegalArgumentException().isThrownBy(() -> AuthorityAuthorizationManager.hasAnyRole((String[]) null))
.withMessage("roles cannot be empty");
}
@ -97,7 +97,8 @@ public class AuthorityAuthorizationManagerTests {
@Test
public void hasAnyAuthorityWhenNullThenException() {
assertThatIllegalArgumentException().isThrownBy(() -> AuthorityAuthorizationManager.hasAnyAuthority(null))
assertThatIllegalArgumentException()
.isThrownBy(() -> AuthorityAuthorizationManager.hasAnyAuthority((String[]) null))
.withMessage("authorities cannot be empty");
}

Some files were not shown because too many files have changed in this diff Show More