1
0
mirror of synced 2026-07-20 01:55:08 +00:00

Compare commits

...

198 Commits

Author SHA1 Message Date
Josh Cummings 0d5b0c4627 Use java-version 2026-02-11 13:07:06 -07:00
Josh Cummings 45ce971d6c Use releases/v1 2026-02-10 11:12:27 -07:00
Josh Cummings 095cc3bf74 Merge remote-tracking branch 'origin/7.0.x' 2026-02-10 10:50:04 -07:00
dependabot[bot] 92fd945b02 Bump org.hibernate.orm:hibernate-core from 7.2.3.Final to 7.2.4.Final
Bumps [org.hibernate.orm:hibernate-core](https://github.com/hibernate/hibernate-orm) from 7.2.3.Final to 7.2.4.Final.
- [Release notes](https://github.com/hibernate/hibernate-orm/releases)
- [Changelog](https://github.com/hibernate/hibernate-orm/blob/7.2.4/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-orm/compare/7.2.3...7.2.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 09:58:20 -07:00
dependabot[bot] d0b0b5a252 Bump gradle-wrapper from 9.2.1 to 9.3.1
Bumps gradle-wrapper from 9.2.1 to 9.3.1.

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 09:57:59 -07:00
dependabot[bot] 601dfb2764 Bump io.micrometer:context-propagation from 1.2.0 to 1.2.1
Bumps [io.micrometer:context-propagation](https://github.com/micrometer-metrics/context-propagation) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/micrometer-metrics/context-propagation/releases)
- [Commits](https://github.com/micrometer-metrics/context-propagation/compare/v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: io.micrometer:context-propagation
  dependency-version: 1.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 09:57:12 -07:00
Josh Cummings b88ddc8d0d Enable Dependabot Auto-Merge on Main
Closes gh-18712

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-10 09:56:02 -07:00
Josh Cummings 688b6ca733 Add Documentation for ExpressionJwtGrantedAuthoritiesConverter
Closes gh-18300
2026-02-10 09:11:26 -07:00
dependabot[bot] 6b028cfe8e Bump ch.qos.logback:logback-classic from 1.5.27 to 1.5.28
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.27 to 1.5.28.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.5.27...v_1.5.28)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 16:39:24 -06:00
dependabot[bot] d912393280 Bump com.fasterxml.jackson:jackson-bom from 2.20.2 to 2.21.0
Bumps [com.fasterxml.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) from 2.20.2 to 2.21.0.
- [Commits](https://github.com/FasterXML/jackson-bom/compare/jackson-bom-2.20.2...jackson-bom-2.21.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 16:25:51 -06:00
dependabot[bot] ba8360671c Bump org.hibernate.orm:hibernate-core from 7.0.10.Final to 7.2.3.Final
Bumps [org.hibernate.orm:hibernate-core](https://github.com/hibernate/hibernate-orm) from 7.0.10.Final to 7.2.3.Final.
- [Release notes](https://github.com/hibernate/hibernate-orm/releases)
- [Changelog](https://github.com/hibernate/hibernate-orm/blob/7.2.3/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-orm/compare/7.0.10...7.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 16:25:36 -06:00
Robert Winch bf7d86722f Merge Remove unnecessary Gradle wrapper from buildSrc 2026-02-06 13:23:39 -06:00
Robert Winch e37f83884b Merge Remove unnecessary Gradle wrapper from buildSrc
Closes gh-18694
2026-02-06 13:13:10 -06:00
dependabot[bot] 3071459fe4 Bump io.micrometer:micrometer-observation from 1.14.14 to 1.16.2
Bumps [io.micrometer:micrometer-observation](https://github.com/micrometer-metrics/micrometer) from 1.14.14 to 1.16.2.
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.14.14...v1.16.2)

---
updated-dependencies:
- dependency-name: io.micrometer:micrometer-observation
  dependency-version: 1.16.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 13:03:14 -06:00
dependabot[bot] 03c081bb46 Bump com.jayway.jsonpath:json-path from 2.9.0 to 2.10.0
Bumps [com.jayway.jsonpath:json-path](https://github.com/jayway/JsonPath) from 2.9.0 to 2.10.0.
- [Release notes](https://github.com/jayway/JsonPath/releases)
- [Changelog](https://github.com/json-path/JsonPath/blob/master/changelog.md)
- [Commits](https://github.com/jayway/JsonPath/compare/json-path-2.9.0...json-path-2.10.0)

---
updated-dependencies:
- dependency-name: com.jayway.jsonpath:json-path
  dependency-version: 2.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 13:02:51 -06:00
dependabot[bot] 540fbdb189 Bump jakarta.xml.bind:jakarta.xml.bind-api from 4.0.4 to 4.0.5
Bumps [jakarta.xml.bind:jakarta.xml.bind-api](https://github.com/jakartaee/jaxb-api) from 4.0.4 to 4.0.5.
- [Release notes](https://github.com/jakartaee/jaxb-api/releases)
- [Commits](https://github.com/jakartaee/jaxb-api/compare/4.0.4...4.0.5)

---
updated-dependencies:
- dependency-name: jakarta.xml.bind:jakarta.xml.bind-api
  dependency-version: 4.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 13:02:15 -06:00
dependabot[bot] cea004b555 Bump io.micrometer:context-propagation from 1.1.3 to 1.2.0
Bumps [io.micrometer:context-propagation](https://github.com/micrometer-metrics/context-propagation) from 1.1.3 to 1.2.0.
- [Release notes](https://github.com/micrometer-metrics/context-propagation/releases)
- [Commits](https://github.com/micrometer-metrics/context-propagation/compare/v1.1.3...v1.2.0)

---
updated-dependencies:
- dependency-name: io.micrometer:context-propagation
  dependency-version: 1.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 12:22:44 -06:00
dependabot[bot] 4c011887bd Bump org.htmlunit:htmlunit from 4.11.1 to 4.21.0
Bumps [org.htmlunit:htmlunit](https://github.com/HtmlUnit/htmlunit) from 4.11.1 to 4.21.0.
- [Release notes](https://github.com/HtmlUnit/htmlunit/releases)
- [Commits](https://github.com/HtmlUnit/htmlunit/compare/4.11.1...4.21.0)

---
updated-dependencies:
- dependency-name: org.htmlunit:htmlunit
  dependency-version: 4.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 12:21:08 -06:00
dependabot[bot] 938d1f38b9 Bump org-jetbrains-kotlin from 2.3.0 to 2.3.10
Bumps `org-jetbrains-kotlin` from 2.3.0 to 2.3.10.

Updates `org.jetbrains.kotlin:kotlin-bom` from 2.3.0 to 2.3.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.3.0...v2.3.10)

Updates `org.jetbrains.kotlin:kotlin-gradle-plugin` from 2.3.0 to 2.3.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.3.0...v2.3.10)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-bom
  dependency-version: 2.3.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin
  dependency-version: 2.3.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 12:20:45 -06:00
Robert Winch 54f294fe6e Merge branch '7.0.x' 2026-02-06 12:16:15 -06:00
Robert Winch fa10e74d76 Consistent Dependabot Configuration Across Supported Branches
- Ensure 'type: dependency-upgrade'
- Ensure that every ecosystem is ran on all supported branches
- Consistent ordering per branch (allows adding/removing branches easier)
2026-02-06 11:50:46 -06:00
Robert Winch 0a8cdc32d5 Merge branch '7.0.x' 2026-02-06 10:05:47 -06:00
Robert Winch 5a51d63419 Update to Spring Framework 7.0.3 2026-02-06 09:06:34 -06:00
Robert Winch ee7c579644 Merge branch '7.0.x' 2026-02-06 09:03:00 -06:00
Robert Winch b92f4e7ed2 Merge branch '7.0.x' 2026-02-06 09:01:24 -06:00
Robert Winch 9dff826c9f Bump org.seleniumhq.selenium:selenium-java from 4.31.0 to 4.40.0 2026-02-06 08:59:12 -06:00
Robert Winch ee2702254e Bump org.mockito:mockito-bom from 5.17.0 to 5.21.0 2026-02-06 08:57:05 -06:00
Robert Winch f0ad037099 Bump org.seleniumhq.selenium:htmlunit3-driver from 4.30.0 to 4.40.0 2026-02-06 08:56:59 -06:00
Robert Winch 8d426bd28f Bump org-bouncycastle from 1.80 to 1.83 2026-02-06 08:56:53 -06:00
dependabot[bot] a8a859ec0e Bump io.freefair.gradle:aspectj-plugin from 8.13.1 to 8.14.4
Bumps [io.freefair.gradle:aspectj-plugin](https://github.com/freefair/gradle-plugins) from 8.13.1 to 8.14.4.
- [Release notes](https://github.com/freefair/gradle-plugins/releases)
- [Commits](https://github.com/freefair/gradle-plugins/compare/8.13.1...8.14.4)

---
updated-dependencies:
- dependency-name: io.freefair.gradle:aspectj-plugin
  dependency-version: 8.14.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 03:05:22 +00:00
dependabot[bot] d467da7717 Bump org-bouncycastle from 1.80 to 1.83
Bumps `org-bouncycastle` from 1.80 to 1.83.

Updates `org.bouncycastle:bcpkix-jdk18on` from 1.80 to 1.83
- [Changelog](https://github.com/bcgit/bc-java/blob/main/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

Updates `org.bouncycastle:bcprov-jdk18on` from 1.80 to 1.83
- [Changelog](https://github.com/bcgit/bc-java/blob/main/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

---
updated-dependencies:
- dependency-name: org.bouncycastle:bcpkix-jdk18on
  dependency-version: '1.83'
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.bouncycastle:bcprov-jdk18on
  dependency-version: '1.83'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 03:04:58 +00:00
dependabot[bot] 55ef3ce477 Bump org.seleniumhq.selenium:htmlunit3-driver from 4.30.0 to 4.40.0
Bumps [org.seleniumhq.selenium:htmlunit3-driver](https://github.com/SeleniumHQ/htmlunit-driver) from 4.30.0 to 4.40.0.
- [Release notes](https://github.com/SeleniumHQ/htmlunit-driver/releases)
- [Commits](https://github.com/SeleniumHQ/htmlunit-driver/compare/4.30.0...4.40.0)

---
updated-dependencies:
- dependency-name: org.seleniumhq.selenium:htmlunit3-driver
  dependency-version: 4.40.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 03:04:41 +00:00
arianna 3386e077e6 Fix typos in SAML 2.0 Documentation
- Fix wrong docs link in Servlet - SAML2 Log In Overview
- Fix examples in Servlet - SAML2 Authentication Responses
- Fix examples in Servlet - SAML2 Logout

Signed-off-by: arianna <arianna.comi03@gmail.com>
2026-02-05 17:35:25 -07:00
arianna 10490a7b92 Fix typos in OAuth 2.0 Resource Server
Signed-off-by: arianna <arianna.comi03@gmail.com>
2026-02-05 17:35:25 -07:00
arianna f1e742dfc5 Fix typos in Authorization Documentation
Signed-off-by: arianna <arianna.comi03@gmail.com>
2026-02-05 17:35:25 -07:00
arianna 8e9480545e Fix issue reports
Closes gh-18376

Signed-off-by: arianna <arianna.comi03@gmail.com>
2026-02-05 17:35:25 -07:00
dependabot[bot] 0eb5d8f356 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.10 to 0.0.11.
- [Release notes](https://github.com/spring-gradle-plugins/nullability-plugin/releases)
- [Commits](https://github.com/spring-gradle-plugins/nullability-plugin/compare/v0.0.10...v0.0.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-05 17:27:40 -07:00
dependabot[bot] 3e238af024 Bump ch.qos.logback:logback-classic from 1.5.26 to 1.5.27
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.26 to 1.5.27.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.5.26...v_1.5.27)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-05 17:26:49 -07:00
dependabot[bot] 29ed4dd724 Bump spring-io/spring-doc-actions from 0.0.20 to 0.0.22
Bumps [spring-io/spring-doc-actions](https://github.com/spring-io/spring-doc-actions) from 0.0.20 to 0.0.22.
- [Commits](https://github.com/spring-io/spring-doc-actions/compare/e28269199d1d27975cf7f65e16d6095c555b3cd0...415e2b11a766ba64799fffb5c97a4f7e17f677cf)

---
updated-dependencies:
- dependency-name: spring-io/spring-doc-actions
  dependency-version: 0.0.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-05 17:25:46 -07:00
dependabot[bot] 218b13884f Bump org.apache.httpcomponents.client5:httpclient5 from 5.5.2 to 5.6
Bumps [org.apache.httpcomponents.client5:httpclient5](https://github.com/apache/httpcomponents-client) from 5.5.2 to 5.6.
- [Changelog](https://github.com/apache/httpcomponents-client/blob/master/RELEASE_NOTES.txt)
- [Commits](https://github.com/apache/httpcomponents-client/compare/rel/v5.5.2...rel/v5.6)

---
updated-dependencies:
- dependency-name: org.apache.httpcomponents.client5:httpclient5
  dependency-version: '5.6'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-05 17:24:39 -07:00
Josh Cummings fc2fd63793 Merge branch '7.0.x' 2026-02-05 17:23:08 -07:00
DingHao 199473fcb3 Ability to configure authenticationDetailsSource in AnonymousConfigurer
Closes gh-17831

Signed-off-by: DingHao <dh.hiekn@gmail.com>
2026-02-05 17:19:03 -07:00
Bae Jihong 7903ad93c0 Fix compiler warnings in spring-security-acl
- Use asSubclass() in AclClassIdUtils to avoid a unchecked cast warning
- Replace raw Map type with Map<?, ?> unbounded wildcard to avoid raw type warnings
- Use ArgumentMatchers to avoid a unchecked cast warning
- Suppress an unavoidable unchecked warning in reflection-based test code

Closes gh-18413

Signed-off-by: Bae Jihong <dasog@naver.com>
2026-02-05 18:01:30 -06:00
dependabot[bot] fe65ef2626 Bump org-opensaml5 from 5.1.6 to 5.2.0
Bumps `org-opensaml5` from 5.1.6 to 5.2.0.

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-05 17:00:40 -07:00
Josh Cummings 2af6e1cf92 Merge branch '7.0.x' 2026-02-05 16:58:23 -07:00
dependabot[bot] e535803cc2 Bump org.seleniumhq.selenium:selenium-java from 4.31.0 to 4.40.0
Bumps [org.seleniumhq.selenium:selenium-java](https://github.com/SeleniumHQ/selenium) from 4.31.0 to 4.40.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.31.0...selenium-4.40.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-05 23:46:24 +00:00
Josh Cummings eeb080a191 Remove Branch Ecosystem Declarations
These may have been added in error. Removing until it's clear
if they are needed

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-05 16:45:16 -07:00
Josh Cummings b8c6b9fbff Add directory attribute
Issue gh-18648
2026-02-05 16:37:27 -07:00
Josh Cummings 3cf0a1ccb7 Use Dependabot for GitHub Actions
Closes gh-18648

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-05 14:47:42 -07:00
Josh Cummings c2f0f7b6ab Use SHA Hashes for spring-security-release-tools Workflows
Issue gh-18648

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-05 14:47:16 -07:00
Josh Cummings 8cd2f36e84 Merge branch '7.0.x' 2026-02-05 14:45:09 -07:00
Joe Grandja 517bc7cb65 Polish gh-18614 2026-02-05 15:32:47 -05:00
Elayne Bloom a2d407518c Document ClientSettings
Added documentation to describe the possible client configuration options when setting up an Oauth2 Authorization Server.

Closes gh-18614

Signed-off-by: Elayne Bloom <5840349+bloomsei@users.noreply.github.com>
2026-02-05 15:32:46 -05:00
Josh Cummings 001d9df5ca Remove Nullability Checkstyle Suppressions for saml2
Issue gh-17823
2026-02-05 13:13:25 -07:00
Josh Cummings 818a7831dd Add Nullability to opensaml5Main Source Set
Issue gh-17823

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-05 13:13:23 -07:00
Joe Grandja 0eba9de7d4 Merge branch '7.0.x' 2026-02-05 04:55:34 -05:00
Josh Cummings 70fc8fef3a Add Sample SAML Response in Test
Issue gh-17823

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-03 08:54:14 -07:00
gimgisu 46027974dd @gisu1102
Apply code formatting to OAuth2AuthorizationServerBeanRegistrationAotProcessor

Closes spring-projectsgh-18432

Signed-off-by: gimgisu <gisu1102@gmail.com>
2026-02-02 19:27:44 -06:00
gimgisu 338786bab9 @gisu1102
Align AOT hints with MemberCategory deprecation replacements

- Replace DECLARED_FIELDS with ACCESS_DECLARED_FIELDS in runtime hints

- Preserve 1:1 intent for Collections via registerType only

- Keep INVOKE_* only where it existed before

Closes spring-projectsgh-18432

Signed-off-by: gimgisu <gisu1102@gmail.com>
2026-02-02 19:27:44 -06:00
gimgisu d7ecb8fdcf @gisu1102
Restore Jackson 2 module runtime hints for passivity

- Keep Jackson 2 module registrations when jackson2 is present

- Extract Jackson 2 hint registration into a dedicated method

- Suppress removal warnings only for the Jackson 2 registration

Closes spring-projectsgh-18432

Signed-off-by: gimgisu <gisu1102@gmail.com>
2026-02-02 19:27:44 -06:00
gimgisu a9f9eba6ca @gisu1102
Remove compiler warnings in spring-security-oauth2-authorization-server

- Remove ACCESS_DECLARED_FIELDS from AOT/runtime hints
- Add @SuppressWarnings("removal") for Jackson2 deprecated adapters

Closes spring-projectsgh-18432

Signed-off-by: gimgisu <gisu1102@gmail.com>
2026-02-02 19:27:44 -06:00
Josh Cummings 1a6f344196 Add security-nullability
Closes gh-17823

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-02 17:44:17 -07:00
Josh Cummings e771ec04b7 Add @Nullable Annotations to saml2-service-provider
Issue gh-17823

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-02 17:44:14 -07:00
Josh Cummings f3656b4991 Ensure saml_request in Tests
Issue gh-17823

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-02 17:44:10 -07:00
Joe Grandja 8f22fd4407 Merge branch '7.0.x' 2026-02-02 16:38:29 -05:00
Tran Ngoc Nhan 20493ef45f Add javadoc-warnings-error
Closes gh-18461

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-02 12:06:12 -06:00
Vyacheslav e029b3ac6f Update authorize-http-requests.adoc
Comma added for java configuration 

Signed-off-by: Vyacheslav <43342280+cmmttd@users.noreply.github.com>
2026-02-02 11:48:07 -06:00
Tran Ngoc Nhan 55ab498518 Add javadoc-warnings-error
Closes gh-18469

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-02 11:45:53 -06:00
Tran Ngoc Nhan b0983e2f5e Add javadoc-warnings-error
Closes gh-18466

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-02 11:45:12 -06:00
dohyunk58 992d8ca79b fail build on javadoc warnings for spring-security-test
Signed-off-by: dohyunk58 <hedge3x@gmail.com>
2026-02-02 11:44:39 -06:00
Tran Ngoc Nhan 4c012c59c9 Add javadoc-warnings-error
Closes gh-18464

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-02 11:44:31 -06:00
Tran Ngoc Nhan 2ee247f82e Add javadoc-warnings-error
Closes gh-18464

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-02 11:43:35 -06:00
Joe Grandja 0496c02c30 Polish gh-18542 2026-02-02 12:43:19 -05:00
Tran Ngoc Nhan 93d8283e36 Add javadoc-warnings-error
Closes gh-18462

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-02 11:42:14 -06:00
pocj8ur4in 991b7d4dc2 Rollback setDefaultRolePrefix() call
- preserve setDefaultRolePrefix() in getRootObject()

Signed-off-by: pocj8ur4in <pocj8ur4in@gmail.com>
2026-02-02 11:41:18 -06:00
pocj8ur4in 64e863e7df Remove compiler warnings in spring-security-data
- Add
  compile-warnings-error plugin to data module
- Remove
  deprecated setDefaultRolePrefix() call in getRootObject()
- Add
  @SuppressWarnings deprecation for tests using deprecated methods
- Add
  tests using AuthorizationManagerFactory

Closes
  spring-projectsgh-18422

Signed-off-by: pocj8ur4in <pocj8ur4in@gmail.com>
2026-02-02 11:41:18 -06:00
Daniel Garnier-Moiroux 4957c5a7e9 Add BearerTokenAuthenticationEntryPoint#setResourceMetadataParameterResolver
Closes gh-18542

Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
2026-02-02 12:40:03 -05:00
Tran Ngoc Nhan 5b7c4ae8d8 Add javadoc-warnings-error
Closes gh-18459

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-02 11:39:38 -06:00
Tran Ngoc Nhan 8bafd94b1f Add compile-warnings-error
Closes gh-18424

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-02 11:37:39 -06:00
Park JuHyeong d244bcf76e Suppress AspectJ compiler warnings in spring-security-aspects
- Added -Xlint:ignore to compileAspectj task
- Added -Xlint:ignore to compileTestAspectj task

Fixes the following AspectJ warnings:
- AnnotationSecurityAspect.aj:72 [warning] advice defined
- AbstractMethodInterceptorAspect.aj:36 [warning] advice defined

These warnings occur because the AspectJ compiler detects that
advice in deprecated aspect classes may not match any join points,
which is expected behavior for deprecated code maintained for
backward compatibility.

Contributes to gh-18405

Signed-off-by: Park JuHyeong <wngud5957@naver.com>
2026-02-02 11:30:51 -06:00
jieun de23ade14b Remove compiler warnings for spring-security-cas:check
Signed-off-by: jieun <jkdev1324@gmail.com>
2026-02-02 11:27:42 -06:00
Robert Winch afa3e2311c Merge branch '7.0.x' 2026-02-02 11:13:10 -06:00
Joe Grandja 2a2f13fbd3 Polish Nullability for oauth2-core
Issue gh-17820
2026-02-02 09:00:46 -06:00
Joe Grandja db5310bee8 Enable null-safety in spring-security-oauth2-core
Closes gh-17820
2026-02-02 09:00:40 -06:00
Joe Grandja dfed528851 Remove checkstyle suppressions for spring-security-oauth2-core
Issue gh-17820
2026-02-02 09:00:40 -06:00
Robert Winch 6a6c7a7a78 Add missing @Nullable to setters of Nullable Fields
There are setters and builder methods that initialize members that are
`@Nullable` but do not accept `@Nullable` parameters.

For example:

```
private @Nullable Object foo;

public void setFoo(Object foo) {
    this.foo = foo;
}
```

It is an unnecessary restriction that the parameter is unable to be null
since the field can be null.

This commit fixes these inconsistencies.

Closes gh-18618
2026-01-29 13:58:42 -06:00
Robert Winch b591a0a757 TestingAuthenticationToken.credentials should be @Nullable
Closes gh-18615
2026-01-29 10:17:22 -06:00
Josh Cummings c5632ccd83 Add security-nullability to ldap
Closes gh-17818

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-01-28 15:30:54 -07:00
Robert Winch a8b5c8fe02 Bump io.mockk:mockk from 1.14.7 to 1.14.9 2026-01-27 11:17:24 -06:00
Robert Winch 054ff7421b Merge branch '7.0.x' 2026-01-27 11:17:10 -06:00
Robert Winch 6e30cd5417 Merge branch '7.0.x' 2026-01-26 22:06:54 -06:00
dependabot[bot] c7d52242fb Bump io.mockk:mockk from 1.14.7 to 1.14.9
Bumps [io.mockk:mockk](https://github.com/mockk/mockk) from 1.14.7 to 1.14.9.
- [Release notes](https://github.com/mockk/mockk/releases)
- [Commits](https://github.com/mockk/mockk/compare/1.14.7...1.14.9)

---
updated-dependencies:
- dependency-name: io.mockk:mockk
  dependency-version: 1.14.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-27 03:03:22 +00:00
dependabot[bot] 6f6dbd5728 Bump ch.qos.logback:logback-classic from 1.5.25 to 1.5.26
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.25 to 1.5.26.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.5.25...v_1.5.26)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-26 15:27:46 -06:00
dependabot[bot] 99eb7b1e5c Bump org.assertj:assertj-core from 3.27.6 to 3.27.7
Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.27.6 to 3.27.7.
- [Release notes](https://github.com/assertj/assertj/releases)
- [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.27.6...assertj-build-3.27.7)

---
updated-dependencies:
- dependency-name: org.assertj:assertj-core
  dependency-version: 3.27.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-26 15:27:19 -06:00
LeeJiWon 89467605ca Deprecate single-arg PasswordComparisonAuthenticator ctor
Add new constructor accepting PasswordEncoder to eventually
remove deprecated LdapShaPasswordEncoder usage.

Closes gh-18430

Signed-off-by: LeeJiWon <dlwldnjs1009@gmail.com>
2026-01-26 14:54:52 -06:00
LeeJiWon 9fa0a34b4c Remove compiler warnings in spring-security-ldap
- Add
  compile-warnings-error plugin to ldap module

- Replace
  org.springframework.lang.NonNull with org.jspecify.annotations.NonNull

-
  Add @SuppressWarnings for unchecked/rawtypes/deprecation warnings

Closes
  gh-18405

Signed-off-by: LeeJiWon <dlwldnjs1009@gmail.com>
2026-01-26 14:54:52 -06:00
Tran Ngoc Nhan a23be5e625 Add compile-warnings-error
Closes gh-18439

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:44:31 -06:00
jihunparkkk c3240c4d2b Remove compiler warnings for spring-security-rsocket
Closes gh-18437

Signed-off-by: jihunparkkk <pjh2996@naver.com>
2026-01-26 14:43:21 -06:00
Tran Ngoc Nhan 3c0fd6d7ca Add compile-warnings-error
Closes gh-18417

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:36:10 -06:00
Tran Ngoc Nhan d526bb460f Add compile-warnings-error
Closes gh-18438

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:35:14 -06:00
Tran Ngoc Nhan 30975df0a7 Add compile-warnings-error
Closes gh-18431

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:34:34 -06:00
Tran Ngoc Nhan bd49ceb0ef Add compile-warnings-error
Closes gh-18429

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:31:35 -06:00
Tran Ngoc Nhan 1c8bbda7af Add compile-warnings-error
Closes gh-18428

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:31:13 -06:00
Tran Ngoc Nhan fb19143c91 Add compile-warnings-error
Closes gh-18427

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:30:30 -06:00
Tran Ngoc Nhan f906539fe4 Add compile-warnings-error
Closes gh-18426

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:28:15 -06:00
Tran Ngoc Nhan 18ab4dc2c8 Add compile-warnings-error
Closes gh-18425

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:26:05 -06:00
Tran Ngoc Nhan b07cd701c7 Add compile-warnings-error
Closes gh-18423

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-26 14:25:26 -06:00
Robert Winch ea8bd1a01d Merge branch '7.0.x'
Closes gh-18595
2026-01-26 12:17:24 -06:00
Andrey Litvitski 0a182f1f20 Add @Nullable to changePassword parameters in UserDetailsManager
Closes: gh-18257

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-01-23 15:06:10 -06:00
Jay Choi 5e56877487 Remove compiler warnings for spring-security-acl
Closes gh-18415

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
2026-01-23 14:19:23 -06:00
Jay Choi 38356fda10 Remove compiler warnings for spring-security-webauthn
Closes gh-18442

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
2026-01-23 14:17:20 -06:00
Jay Choi 442d72ec12 Remove compiler warnings for spring-security-access
Closes gh-18414

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
2026-01-23 14:16:08 -06:00
Michael Lück 7513c859bd Fix javadoc warnings and apply plugin javadoc-warnings-error
Closes to gh-18448

Signed-off-by: Michael Lück <michael@lueckonline.net>
2026-01-23 14:13:54 -06:00
Robert Winch 1b3cf72fc9 Add Nullaway Checkstyle
- Require package-info.java with @NullMarked in every package
- Suppress package checks for tests and modules that haven't been worked on
- Prevent non org.jspecify Nullability imports on enabled modules
- Validate Nullable is before modifiers

Closes gh-18564
2026-01-23 10:42:53 -06:00
Robert Winch d7fbf3673a Fix consistency with Nullability Usage
Issue gh-18564
2026-01-23 10:42:53 -06:00
dependabot[bot] ab3298e917 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.9 to 0.0.10.
- [Release notes](https://github.com/spring-gradle-plugins/nullability-plugin/releases)
- [Commits](https://github.com/spring-gradle-plugins/nullability-plugin/compare/v0.0.9...v0.0.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-23 09:26:24 -06:00
dependabot[bot] 37b0813b26 Bump tools.jackson:jackson-bom from 3.0.3 to 3.0.4
Bumps [tools.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) from 3.0.3 to 3.0.4.
- [Commits](https://github.com/FasterXML/jackson-bom/compare/jackson-bom-3.0.3...jackson-bom-3.0.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-23 09:26:04 -06:00
dependabot[bot] 0340e0e918 Bump lodash from 4.17.21 to 4.17.23 in /javascript
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-23 09:25:40 -06:00
Joe Grandja fc5194d78b Merge branch '7.0.x' 2026-01-23 06:43:14 -05:00
Robert Winch e7203bf838 Null safety via JSpecify spring-security-acl
Closes gh-18401
2026-01-22 14:26:26 -06:00
Robert Winch 42e1e9fb67 Null safety via JSpecify spring-security-kerberos-test
Closes gh-18551
2026-01-21 17:53:12 -06:00
Robert Winch 91aee30906 Null safety via JSpecify spring-security-kerberos-client
Closes gh-18552
2026-01-21 17:46:40 -06:00
Robert Winch 8247d18122 Null safety via JSpecify spring-security-kerberos-web
Closes gh-18550
2026-01-21 17:39:38 -06:00
Robert Winch f942ead2eb Null safety via JSpecify spring-security-kerberos-core
Closes gh-18549
2026-01-21 17:29:59 -06:00
Michael Lück b970746a03 Apply plugin javadoc-warnings-error - no javadoc issues found
Relates to gh-18457

Signed-off-by: Michael Lück <git@lueckonline.net>
2026-01-21 16:56:36 -06:00
Michael Lück 131d3741b2 Apply plugin javadoc-warnings-error - no javadoc issues found
Relates to gh-18458

Signed-off-by: Michael Lück <git@lueckonline.net>
2026-01-21 16:54:53 -06:00
Junmo e7aa15cb81 Remove javadoc warnings for spring-security-data
- Add javadoc-warnings-error plugin to spring-security-data.gradle
- Add missing @param tag in setSecurityContextHolderStrategy method

Closes gh-18451

Signed-off-by: Junmo <hongjm1022@gmail.com>
2026-01-21 16:45:45 -06:00
dev.paramjot af73f85f66 Fix formatting in HttpSecurity.java documentation
Signed-off-by: dev.paramjot <50148441+ParamjotSingh5@users.noreply.github.com>
2026-01-21 16:43:03 -06:00
Jeongwon Been 39544e1b9e Fail build on Javadoc warnings in crypto module
Apply the javadoc-warnings-error plugin to spring-security-crypto to
ensure that new Javadoc warnings fail the build and prevent regressions.

Closes gh-18450
Signed-off-by: Jeongwon Been <congcoding@gmail.com>
2026-01-21 16:41:34 -06:00
Jeongwon Been d07d3a13d1 Fix Javadoc warnings in Argon2PasswordEncoder
Wrap bit-shift expressions in {@code ...} so that Javadoc does not parse
'<' as HTML and emit invalid input warnings.

Signed-off-by: Jeongwon Been <congcoding@gmail.com>
2026-01-21 16:41:34 -06:00
Michael Lück bf6bed01af fail build on javadoc warnings.
Found no existing warnings by running ./gradlew --no-build-cache clean :spring-security-cas:javadoc

Closes gh-18447

Signed-off-by: Michael Lück <git@lueckonline.net>
2026-01-21 16:39:08 -06:00
Jay Choi 74c454a5c7 Remove javadoc warnings for spring-security-kerberos-web
Closes gh-18456

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
2026-01-21 16:38:49 -06:00
Joe Kuhel 2206815ad9 Fix javadoc warning in spring-security-access
Signed-off-by: Joe Kuhel <4983938+jkuhel@users.noreply.github.com>
2026-01-21 16:34:58 -06:00
Jay Choi 6695505676 Remove javadoc warnings for spring-security-kerberos-test
Closes gh-18455

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
2026-01-21 16:19:41 -06:00
Jay Choi 6b4649ad3e Remove javadoc warnings for spring-security-kerberos-core
Closes gh-18454

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
2026-01-21 16:18:48 -06:00
Jay Choi 7ace59c411 Remove javadoc warnings for spring-security-kerberos-client
Closes gh-18453

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
2026-01-21 16:17:08 -06:00
Robert Winch 1cfb3033e9 Run ./gradlew foramt
Fixes formatting for gh-18516
2026-01-21 16:08:04 -06:00
chanjin-lee 021f84b2df Core: Fix Javadoc invalid references and improve clarity
- Update package-info to reference AuthorizationManager instead of AccessDecisionManager
- Improve RoleHierarchyUtils documentation with fromHierarchy() and builder-based alternatives
- Refine AuthenticationTrustResolver return description by removing redundant comma and symbol

Signed-off-by: chanjin-lee <chanjin23@naver.com>
2026-01-21 16:08:04 -06:00
chanjin-lee e5b934d1a5 Core: Remove javadoc warnings
Closes gh-18449

Signed-off-by: chanjin-lee <chanjin23@naver.com>
2026-01-21 16:08:04 -06:00
alpin87 e3f1690396 feat: Javadoc warnings as errors in spring-security-acl
Signed-off-by: alpin87 <qortmdals94@naver.com>
2026-01-21 16:00:01 -06:00
alpin87 1fb335c3b1 Fix: Javadoc warning in AclPermissionEvaluator
Signed-off-by: alpin87 <qortmdals94@naver.com>
2026-01-21 16:00:01 -06:00
zoo-code cd2be2fc1c Enable javadoc-warnings-error for oauth2-resource-server
Closes gh-18463

Signed-off-by: zoo-code <kyj20908@naver.com>
2026-01-21 15:49:55 -06:00
Robert Winch feb3e9c3cc Bump com.fasterxml.jackson:jackson-bom from 2.20.1 to 2.20.2 2026-01-21 15:34:02 -06:00
Robert Winch 95d31a3754 Bump io.spring.develocity.conventions from 0.0.24 to 0.0.25 2026-01-21 15:33:58 -06:00
Robert Winch ef7bb7d334 Merge branch '7.0.x' 2026-01-21 15:33:42 -06:00
Robert Winch 9f8ac34c3b Remove @NullUnmarked
Closes gh-18491
2026-01-21 14:11:25 -06:00
Soumik Sarker 3f66d8b770 Fix format
Signed-off-by: Soumik Sarker <ronodhirsoumik@gmail.com>
2026-01-21 14:11:25 -06:00
Soumik Sarker ea26031a4d Fix format
Signed-off-by: Soumik Sarker <ronodhirsoumik@gmail.com>
2026-01-21 14:11:25 -06:00
Soumik Sarker b1d98491cf Removed nullUnmarked annotation from observability web classes
Fixes #17815

Signed-off-by: Soumik Sarker <ronodhirsoumik@gmail.com>
2026-01-21 14:11:25 -06:00
dependabot[bot] c64747ce5f Bump io.spring.develocity.conventions from 0.0.24 to 0.0.25
Bumps [io.spring.develocity.conventions](https://github.com/spring-io/develocity-conventions) from 0.0.24 to 0.0.25.
- [Release notes](https://github.com/spring-io/develocity-conventions/releases)
- [Commits](https://github.com/spring-io/develocity-conventions/compare/v0.0.24...v0.0.25)

---
updated-dependencies:
- dependency-name: io.spring.develocity.conventions
  dependency-version: 0.0.25
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-21 03:05:22 +00:00
dependabot[bot] cd4ad01742 Bump com.fasterxml.jackson:jackson-bom from 2.20.1 to 2.20.2
Bumps [com.fasterxml.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) from 2.20.1 to 2.20.2.
- [Commits](https://github.com/FasterXML/jackson-bom/compare/jackson-bom-2.20.1...jackson-bom-2.20.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-20 03:05:21 +00:00
github-actions[bot] 0a035caa57 Next development version 2026-01-19 15:49:35 +00:00
github-actions[bot] ab8b139278 Release 7.1.0-M1 2026-01-19 15:23:49 +00:00
dependabot[bot] e19c34771b Bump ch.qos.logback:logback-classic from 1.5.24 to 1.5.25
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.24 to 1.5.25.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.5.24...v_1.5.25)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-19 10:06:16 -05:00
dependabot[bot] 318b4a785c Bump org.springframework.data:spring-data-bom from 2025.1.1 to 2025.1.2
Bumps [org.springframework.data:spring-data-bom](https://github.com/spring-projects/spring-data-bom) from 2025.1.1 to 2025.1.2.
- [Release notes](https://github.com/spring-projects/spring-data-bom/releases)
- [Commits](https://github.com/spring-projects/spring-data-bom/compare/2025.1.1...2025.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-19 10:03:41 -05:00
Robert Winch c73696f129 doclint -missing
Temporarily using -missing to allow build to pass
2026-01-16 21:55:49 -06:00
Robert Winch 35d103843b Externalize java-toolchain configuration
We should not use subprojects to perform configuration becaause it
does not allow for lazy loading and it can cause ordering problems.
In this case, the toolchain was not being used but instead it was
using the JAVA_HOME.

By splitting the configuration into a plugin and applying it to each
project it fixes the toolchain configuration
2026-01-16 16:54:00 -06:00
Robert Winch 8746ef746c Bump io.projectreactor:reactor-bom from 2025.0.1 to 2025.0.2 2026-01-16 15:19:56 -06:00
Robert Winch e72c39cabc Merge branch '7.0.x' 2026-01-16 15:19:42 -06:00
Robert Winch a8ca5b7d42 Remove 6.4.x from antora ui updates
6.4.x is no longer supported
2026-01-16 15:16:34 -06:00
Robert Winch afa5804170 Remove 6.4.x dependabot
6.4.x is no longer has OSS support
2026-01-16 15:15:37 -06:00
dependabot[bot] 15dd96bddb 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.6 to 0.0.9.
- [Release notes](https://github.com/spring-gradle-plugins/nullability-plugin/releases)
- [Commits](https://github.com/spring-gradle-plugins/nullability-plugin/compare/v0.0.6...v0.0.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-16 15:10:17 -06:00
Robert Winch 6b2e0444dd Bump org.springframework:spring-framework-bom from 7.0.3-SNAPSHOT to 7.0.3
Closes gh-18515
2026-01-16 15:08:15 -06:00
Robert Winch 577d294fdc Remove milestone repository
Spring uses central for milestones now
2026-01-16 15:06:23 -06:00
Robert Winch 0993e5735e Add missing @NullMarked
Closes gh-18514
2026-01-16 14:53:16 -06:00
Robert Winch 048b6bdd88 Update to JDK 25 (release = 17)
This commit updates the build to use JDK 25 while remaining compatable with JDK 17.

Note that we must update our JAAS related tests to use release=25 due to the disabling of
the Security Manager. See
https://docs.oracle.com/en/java/javase/25/security/security-manager-is-permanently-disabled.html

Closes gh-18512
2026-01-16 11:25:59 -06:00
Robert Winch 6e9b4f86a4 Fix nullability for JDK 25
Closes gh-18511
2026-01-16 10:53:19 -06:00
Robert Winch 38b66e8407 Update to Gradle 9.2.1
Closes gh-18510
2026-01-16 10:48:28 -06:00
Robert Winch 9e5b3d9ea1 Update to Kotlin 2.3.0
Closes gh-18509
2026-01-16 10:46:58 -06:00
Robert Winch 7563932106 Update jococo 0.8.14
Closes gh-18508
2026-01-16 10:46:53 -06:00
Robert Winch 48f958cbbf Fix OAuth2AuthorizationRequestRedirectFilter constructor tests
OAuth2AuthorizationRequestRedirectFilterTests attempt to validate the constructors throw IllegalArgumentException if an invalid argument is provided, but
they are flawed because it is the relective code that is throwing the IllegalArgumentException due to imprecise type information.

This changes the tests to no longer use unnecessary reflection and casts the types so that the type information is used to target the correct
constructor.

Closes gh-18507
2026-01-16 10:34:10 -06:00
Josh Cummings 30d6b3a02b Merge branch '7.0.x' 2026-01-15 12:41:29 -07:00
Tran Ngoc Nhan cfe13c7c76 Fix typos
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-15 10:52:01 -07:00
Josh Cummings 3336f5f2ec Merge branch '7.0.x' 2026-01-14 14:47:31 -07:00
Josh Cummings 565896404c Merge branch '7.0.x' 2026-01-14 14:36:12 -07:00
박기현\qkrrl 91d8a04ec2 Fix duplicated use-authorization-manager in docs
Signed-off-by: 박기현\qkrrl <qkrrlgus114@naver.com>
2026-01-14 14:21:38 -07:00
Marcus Hert da Coregio 8254f589b8 Create Jackson Mixin for OneTimeTokenAuthentication
Closes gh-18095

Signed-off-by: Marcus Hert da Coregio <marcusdacoregio@gmail.com>
2026-01-14 10:35:02 -07:00
dependabot[bot] 3f773abf7c Bump io.projectreactor:reactor-bom from 2025.0.1 to 2025.0.2
Bumps [io.projectreactor:reactor-bom](https://github.com/reactor/reactor) from 2025.0.1 to 2025.0.2.
- [Release notes](https://github.com/reactor/reactor/releases)
- [Commits](https://github.com/reactor/reactor/compare/2025.0.1...2025.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-14 03:05:35 +00:00
Joe Grandja 92b7c41f2f Ensure Cursor imports Spring Security
Closes gh-8492
2026-01-13 17:01:21 -05:00
Bae Jihong 8692185de1 Fix javadoc warnings for spring-security-oauth2-client
- Fix a javadoc warning
- Apply javadoc-warnings-error plugin

Closes gh-18460

Signed-off-by: Bae Jihong <dasog@naver.com>
2026-01-13 10:01:13 -06:00
Robert Winch 7ca0f7723e Fix checkstyle 2026-01-12 16:28:22 -06:00
Stefano Cordio a612522ecd Add nullability contract to PasswordEncoder#encode
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
2026-01-12 16:28:22 -06:00
Robert Winch fe138d6434 Merge branch '7.0.x' 2026-01-12 16:05:51 -06:00
Robert Winch 93ae52aa58 Merge branch '7.0.x' 2026-01-12 15:48:57 -06:00
Robert Winch 43fe5f6b46 Fix update-antora-ui-spring.yml 2026-01-12 14:37:34 -06:00
Robert Winch f47f81351e Merge branch '7.0.x' 2026-01-12 14:32:23 -06:00
paulvas 0d47870928 Fix: migrate compiler-warnings-error plugin to gradle
Fixes: gh-18434
Signed-off-by: paulvas <paulvas@gmail.com>
2026-01-12 13:57:57 -06:00
paulvas da4362111a Fix: Enforce compiler warnings in oauth2-core
To prevent future compiler warnings from being introduced, this change
applies the `compile-warnings-error` plugin to the
`spring-security-oauth2-core` module.

This ensures that any new warnings will fail the build, maintaining
code quality and preventing warning accumulation.

Fixes: gh-18434
Signed-off-by: Pavel Vassiliev <paulvas@gmail.com>
Signed-off-by: paulvas <paulvas@gmail.com>
2026-01-12 13:57:57 -06:00
Pavel Vassiliev 1ddccd8a39 Fix spring-security-oauth2-core compiler warnings
Closes: gh-18434
Signed-off-by: Pavel Vassiliev <paulvas@gmail.com>

Signed-off-by: paulvas <paulvas@gmail.com>
2026-01-12 13:57:57 -06:00
Robert Winch 2825aa3ff1 Merge branch '7.0.x'
Closes gh-18485
2026-01-12 13:44:13 -06:00
Robert Winch ec06f08bb6 Merge branch '7.0.x' 2026-01-12 13:38:52 -06:00
rigu1 0a6883c586 Fix Javadoc warnings in spring-security-web
* Use <code> tags for external references in DelegatingMissingAuthorityAccessDeniedHandler and SwitchUserWebFilter
* Fix typo in SessionAuthenticationException
* Apply javadoc-warnings-error plugin

Closes gh-18468

Signed-off-by: rigu1 <dlsrbtla@gmail.com>
2026-01-12 13:24:47 -06:00
rigu1 c07a2e57bd Add javadoc-warnings-error build plugin
Signed-off-by: rigu1 <dlsrbtla@gmail.com>
2026-01-12 13:24:47 -06:00
Robert Winch 5a7d93ee3b Merge branch '7.0.x'
Closes gh-18471
2026-01-09 16:55:02 -06:00
Robert Winch a3b57c470f Merge branch '7.0.x' 2026-01-09 15:25:02 -06:00
Robert Winch d1a32b4b62 Merge branch '7.0.x' 2026-01-09 15:23:29 -06:00
Robert Winch 3833650d33 Update to 7.1.0-SNAPSHOT 2026-01-09 10:32:03 -06:00
662 changed files with 9340 additions and 1826 deletions
+117 -31
View File
@@ -1,12 +1,10 @@
version: 2
registries:
spring-milestones:
type: maven-repository
url: https://repo.spring.io/milestone
shibboleth:
type: maven-repository
url: https://build.shibboleth.net/maven/releases
updates:
# 6.5.x
- package-ecosystem: gradle
target-branch: 6.5.x
directory: /
@@ -17,7 +15,6 @@ updates:
labels:
- 'type: dependency-upgrade'
registries:
- spring-milestones
- shibboleth
ignore:
- dependency-name: com.nimbusds:nimbus-jose-jwt
@@ -34,36 +31,28 @@ updates:
update-types:
- version-update:semver-major
- version-update:semver-minor
- package-ecosystem: gradle
target-branch: 6.4.x
- package-ecosystem: npm
target-branch: 6.5.x
directory: /docs
schedule:
interval: weekly
labels:
- 'type: task'
- 'type: dependency-upgrade'
- 'in: build'
- package-ecosystem: github-actions
target-branch: 6.5.x
directory: /
schedule:
interval: daily
time: '03:00'
timezone: Etc/UTC
interval: weekly
labels:
- 'type: task'
- 'type: dependency-upgrade'
registries:
- spring-milestones
- shibboleth
ignore:
- dependency-name: com.nimbusds:nimbus-jose-jwt
- dependency-name: org.python:jython
- dependency-name: org.apache.directory.server:*
- dependency-name: org.apache.directory.shared:*
- dependency-name: org.junit:junit-bom
update-types:
- version-update:semver-major
- dependency-name: org.mockito:mockito-bom
update-types:
- version-update:semver-major
- dependency-name: '*'
update-types:
- version-update:semver-major
- version-update:semver-minor
- 'in: build'
# 7.0.x
- package-ecosystem: gradle
target-branch: main
target-branch: 7.0.x
directory: /
schedule:
interval: daily
@@ -72,7 +61,6 @@ updates:
labels:
- 'type: dependency-upgrade'
registries:
- spring-milestones
- shibboleth
ignore:
- dependency-name: com.nimbusds:nimbus-jose-jwt
@@ -93,16 +81,55 @@ updates:
update-types:
- version-update:semver-major
- version-update:semver-minor
- package-ecosystem: npm
target-branch: docs-build
target-branch: 7.0.x
directory: /docs
schedule:
interval: weekly
labels:
- 'type: task'
- 'type: dependency-upgrade'
- 'in: build'
- package-ecosystem: github-actions
target-branch: 7.0.x
directory: /
schedule:
interval: weekly
labels:
- 'type: task'
- 'type: dependency-upgrade'
- 'in: build'
# main
- package-ecosystem: gradle
target-branch: main
directory: /
schedule:
interval: daily
time: '03:00'
timezone: Etc/UTC
labels:
- 'type: dependency-upgrade'
registries:
- shibboleth
ignore:
- dependency-name: com.nimbusds:nimbus-jose-jwt
- dependency-name: org.python:jython
- dependency-name: org.apache.directory.server:*
- dependency-name: org.apache.directory.shared:*
- dependency-name: org.junit:junit-bom
update-types:
- version-update:semver-major
- dependency-name: org.mockito:mockito-bom
update-types:
- version-update:semver-major
- dependency-name: com.gradle.enterprise
update-types:
- version-update:semver-major
- version-update:semver-minor
- dependency-name: '*'
update-types:
- version-update:semver-major
- package-ecosystem: npm
target-branch: main
directory: /docs
@@ -110,4 +137,63 @@ updates:
interval: weekly
labels:
- 'type: task'
- 'type: dependency-upgrade'
- 'in: build'
- package-ecosystem: github-actions
target-branch: main
directory: /
schedule:
interval: weekly
labels:
- 'type: task'
- 'type: dependency-upgrade'
- 'in: build'
# docs-build
- package-ecosystem: gradle
target-branch: docs-build
directory: /
schedule:
interval: daily
time: '03:00'
timezone: Etc/UTC
labels:
- 'type: dependency-upgrade'
registries:
- shibboleth
ignore:
- dependency-name: com.nimbusds:nimbus-jose-jwt
- dependency-name: org.python:jython
- dependency-name: org.apache.directory.server:*
- dependency-name: org.apache.directory.shared:*
- dependency-name: org.junit:junit-bom
update-types:
- version-update:semver-major
- dependency-name: org.mockito:mockito-bom
update-types:
- version-update:semver-major
- dependency-name: com.gradle.enterprise
update-types:
- version-update:semver-major
- version-update:semver-minor
- dependency-name: '*'
update-types:
- version-update:semver-major
- package-ecosystem: npm
target-branch: docs-build
directory: /
schedule:
interval: weekly
labels:
- 'type: task'
- 'type: dependency-upgrade'
- 'in: build'
- package-ecosystem: github-actions
target-branch: docs-build
directory: /
schedule:
interval: weekly
labels:
- 'type: task'
- 'type: dependency-upgrade'
- 'in: build'
@@ -0,0 +1,25 @@
name: Dependabot Auto-Merge
on:
pull_request:
branches:
- 'main'
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'spring-projects/spring-security'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
with:
github-token: ${{ github.token }}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ github.token }}
+4 -6
View File
@@ -14,14 +14,12 @@ permissions:
jobs:
snapshot-test:
name: Test Against Snapshots
uses: spring-io/spring-security-release-tools/.github/workflows/test.yml@v1
uses: spring-io/spring-security-release-tools/.github/workflows/test.yml@7d42d82298553f123a9dad622e0eac725aaf52ef # v1.0.13
strategy:
matrix:
include:
- java-version: 21-ea
toolchain: 21
- java-version: 17
toolchain: 17
- java-version: 25
toolchain: 25
with:
java-version: ${{ matrix.java-version }}
test-args: --refresh-dependencies -PforceMavenRepositories=snapshot,https://oss.sonatype.org/content/repositories/snapshots -PisOverrideVersionCatalog -PtestToolchain=${{ matrix.toolchain }} -PspringFrameworkVersion=7.+ -PreactorVersion=2025.+ -PspringDataVersion=2025.+ --stacktrace
@@ -33,6 +31,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Send Notification
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@v1
uses: spring-io/spring-security-release-tools/.github/actions/send-notification@7d42d82298553f123a9dad622e0eac725aaf52ef # v1.0.13
with:
webhook-url: ${{ secrets.SPRING_SECURITY_CI_GCHAT_WEBHOOK_URL }}
@@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
jdk: [ 17 ]
jdk: [ 25 ]
with:
runs-on: ${{ matrix.os }}
java-version: ${{ matrix.jdk }}
@@ -30,22 +30,24 @@ jobs:
deploy-artifacts:
name: Deploy Artifacts
needs: [ build]
uses: spring-io/spring-security-release-tools/.github/workflows/deploy-artifacts.yml@7d42d82298553f123a9dad622e0eac725aaf52ef # v1.0.13
uses: spring-io/spring-security-release-tools/.github/workflows/deploy-artifacts.yml@releases/v1
with:
should-deploy-artifacts: ${{ needs.build.outputs.should-deploy-artifacts }}
default-publish-milestones-central: true
java-version: 25
secrets: inherit
deploy-schema:
name: Deploy Schema
needs: [ build ]
uses: spring-io/spring-security-release-tools/.github/workflows/deploy-schema.yml@7d42d82298553f123a9dad622e0eac725aaf52ef # v1.0.13
uses: spring-io/spring-security-release-tools/.github/workflows/deploy-schema.yml@releases/v1
with:
should-deploy-schema: ${{ needs.build.outputs.should-deploy-artifacts }}
java-version: 25
secrets: inherit
perform-release:
name: Perform Release
needs: [ deploy-artifacts, deploy-schema ]
uses: spring-io/spring-security-release-tools/.github/workflows/perform-release.yml@7d42d82298553f123a9dad622e0eac725aaf52ef # v1.0.13
uses: spring-io/spring-security-release-tools/.github/workflows/perform-release.yml@releases/v1
with:
should-perform-release: ${{ needs.deploy-artifacts.outputs.artifacts-deployed }}
project-version: ${{ needs.deploy-artifacts.outputs.project-version }}
@@ -53,6 +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
secrets: inherit
send-notification:
name: Send Notification
+1 -1
View File
@@ -16,7 +16,7 @@ permissions:
jobs:
perform-release:
name: Perform Release
uses: spring-io/spring-security-release-tools/.github/workflows/perform-release.yml@v1
uses: spring-io/spring-security-release-tools/.github/workflows/perform-release.yml@7d42d82298553f123a9dad622e0eac725aaf52ef # v1.0.13
with:
should-perform-release: true
project-version: ${{ inputs.version }}
@@ -20,10 +20,10 @@ jobs:
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 17
- name: Set up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: '17'
java-version: '25'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # v5.0.1
+2 -2
View File
@@ -15,7 +15,7 @@ jobs:
- name: Set up gradle
uses: spring-io/spring-gradle-build-action@efc55f07f4dfa22f2afd97f9ea1be4212eeed737 # v2.0.5
with:
java-version: '17'
java-version: '25'
distribution: 'temurin'
- name: Build with Gradle
run: ./gradlew clean build -PskipCheckExpectedBranchVersion --continue --scan
@@ -28,7 +28,7 @@ jobs:
- name: Set up gradle
uses: spring-io/spring-gradle-build-action@efc55f07f4dfa22f2afd97f9ea1be4212eeed737 # v2.0.5
with:
java-version: '17'
java-version: '25'
distribution: 'temurin'
- name: Run Antora
run: ./gradlew -PbuildSrc.skipTests=true :spring-security-docs:antora
+1 -1
View File
@@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
# List of active maintenance branches.
branch: [ main, 6.5.x, 6.4.x, 6.3.x ]
branch: [ main, 7.0.x, 6.5.x, 6.4.x, 6.3.x ]
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -16,7 +16,7 @@ jobs:
name: Update on Supported Branches
strategy:
matrix:
branch: [ '6.4.x', '6.5.x', 'main' ]
branch: [ '6.5.x', '7.0.x', 'main' ]
steps:
- uses: spring-io/spring-doc-actions/update-antora-spring-ui@415e2b11a766ba64799fffb5c97a4f7e17f677cf
name: Update
+1 -1
View File
@@ -3,4 +3,4 @@
# See https://sdkman.io/usage#config
# A summary is to add the following to ~/.sdkman/etc/config
# sdkman_auto_env=true
java=17.0.3-tem
java=25-librca
+1 -1
View File
@@ -1,3 +1,3 @@
{
"java.import.gradle.enabled": false
"java.gradle.buildServer.enabled": "off"
}
+5
View File
@@ -1,3 +1,8 @@
plugins {
id 'compile-warnings-error'
id 'javadoc-warnings-error'
}
apply plugin: 'io.spring.convention.spring-module'
dependencies {
@@ -53,7 +53,9 @@ import org.springframework.util.CollectionUtils;
*
* @author Ben Alex
* @author Luke Taylor
* @deprecated Use {@link EnableMethodSecurity} or publish interceptors directly
* @deprecated Use
* <code>org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity</code>
* or publish interceptors directly
*/
@NullUnmarked
@Deprecated
+6
View File
@@ -1,3 +1,9 @@
plugins {
id 'compile-warnings-error'
id 'javadoc-warnings-error'
id 'security-nullability'
}
apply plugin: 'io.spring.convention.spring-module'
dependencies {
@@ -44,7 +44,7 @@ import org.springframework.security.core.Authentication;
/**
* Used by Spring Security's expression-based access control implementation to evaluate
* permissions for a particular object using the ACL module. Similar in behaviour to
* {@link org.springframework.security.acls.AclEntryVoter AclEntryVoter}.
* <code> org.springframework.security.acls.AclEntryVoter AclEntryVoter </code>
*
* @author Luke Taylor
* @since 3.0
@@ -18,6 +18,8 @@ package org.springframework.security.acls.domain;
import java.io.Serializable;
import org.jspecify.annotations.Nullable;
import org.springframework.security.acls.model.AccessControlEntry;
import org.springframework.security.acls.model.Acl;
import org.springframework.security.acls.model.AuditableAccessControlEntry;
@@ -36,7 +38,7 @@ public class AccessControlEntryImpl implements AccessControlEntry, AuditableAcce
private Permission permission;
private final Serializable id;
private final @Nullable Serializable id;
private final Sid sid;
@@ -46,7 +48,7 @@ public class AccessControlEntryImpl implements AccessControlEntry, AuditableAcce
private final boolean granting;
public AccessControlEntryImpl(Serializable id, Acl acl, Sid sid, Permission permission, boolean granting,
public AccessControlEntryImpl(@Nullable Serializable id, Acl acl, Sid sid, Permission permission, boolean granting,
boolean auditSuccess, boolean auditFailure) {
Assert.notNull(acl, "Acl required");
Assert.notNull(sid, "Sid required");
@@ -133,7 +135,7 @@ public class AccessControlEntryImpl implements AccessControlEntry, AuditableAcce
}
@Override
public Serializable getId() {
public @Nullable Serializable getId() {
return this.id;
}
@@ -99,7 +99,8 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
Authentication authentication = context.getAuthentication();
// Check if authorized by virtue of ACL ownership
Sid currentUser = createCurrentUser(authentication);
if (currentUser.equals(acl.getOwner())
Sid owner = acl.getOwner();
if (owner != null && currentUser.equals(owner)
&& ((changeType == CHANGE_GENERAL) || (changeType == CHANGE_OWNERSHIP))) {
return;
}
@@ -108,8 +109,8 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
Collection<? extends GrantedAuthority> reachableGrantedAuthorities = this.roleHierarchy
.getReachableGrantedAuthorities(authentication.getAuthorities());
Set<String> authorities = AuthorityUtils.authorityListToSet(reachableGrantedAuthorities);
if (acl.getOwner() instanceof GrantedAuthoritySid
&& authorities.contains(((GrantedAuthoritySid) acl.getOwner()).getGrantedAuthority())) {
if (owner instanceof GrantedAuthoritySid
&& authorities.contains(((GrantedAuthoritySid) owner).getGrantedAuthority())) {
return;
}
@@ -20,6 +20,8 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.jspecify.annotations.Nullable;
import org.springframework.security.acls.model.AccessControlEntry;
import org.springframework.security.acls.model.Acl;
import org.springframework.security.acls.model.AuditableAcl;
@@ -41,7 +43,7 @@ import org.springframework.util.ObjectUtils;
*/
public class AclImpl implements Acl, MutableAcl, AuditableAcl, OwnershipAcl {
private Acl parentAcl;
private @Nullable Acl parentAcl;
private transient AclAuthorizationStrategy aclAuthorizationStrategy;
@@ -54,10 +56,10 @@ public class AclImpl implements Acl, MutableAcl, AuditableAcl, OwnershipAcl {
private Serializable id;
// OwnershipAcl
private Sid owner;
private @Nullable Sid owner;
// includes all SIDs the WHERE clause covered, even if there was no ACE for a SID
private List<Sid> loadedSids = null;
private @Nullable List<Sid> loadedSids = null;
private boolean entriesInheriting = true;
@@ -97,8 +99,8 @@ public class AclImpl implements Acl, MutableAcl, AuditableAcl, OwnershipAcl {
* @param owner the owner (required)
*/
public AclImpl(ObjectIdentity objectIdentity, Serializable id, AclAuthorizationStrategy aclAuthorizationStrategy,
PermissionGrantingStrategy grantingStrategy, Acl parentAcl, List<Sid> loadedSids, boolean entriesInheriting,
Sid owner) {
PermissionGrantingStrategy grantingStrategy, @Nullable Acl parentAcl, @Nullable List<Sid> loadedSids,
boolean entriesInheriting, Sid owner) {
Assert.notNull(objectIdentity, "Object Identity required");
Assert.notNull(id, "Id required");
Assert.notNull(aclAuthorizationStrategy, "AclAuthorizationStrategy required");
@@ -117,7 +119,7 @@ public class AclImpl implements Acl, MutableAcl, AuditableAcl, OwnershipAcl {
* Private no-argument constructor for use by reflection-based persistence tools along
* with field-level access.
*/
@SuppressWarnings("unused")
@SuppressWarnings({ "unused", "NullAway.Init" })
private AclImpl() {
}
@@ -199,7 +201,7 @@ public class AclImpl implements Acl, MutableAcl, AuditableAcl, OwnershipAcl {
}
@Override
public boolean isSidLoaded(List<Sid> sids) {
public boolean isSidLoaded(@Nullable List<Sid> sids) {
// If loadedSides is null, this indicates all SIDs were loaded
// Also return true if the caller didn't specify a SID to find
if ((this.loadedSids == null) || (sids == null) || sids.isEmpty()) {
@@ -238,19 +240,19 @@ public class AclImpl implements Acl, MutableAcl, AuditableAcl, OwnershipAcl {
}
@Override
public Sid getOwner() {
public @Nullable Sid getOwner() {
return this.owner;
}
@Override
public void setParent(Acl newParent) {
public void setParent(@Nullable Acl newParent) {
this.aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
Assert.isTrue(newParent == null || !newParent.equals(this), "Cannot be the parent of yourself");
this.parentAcl = newParent;
}
@Override
public Acl getParentAcl() {
public @Nullable Acl getParentAcl() {
return this.parentAcl;
}
@@ -18,6 +18,8 @@ package org.springframework.security.acls.domain;
import java.io.Serializable;
import org.jspecify.annotations.Nullable;
import org.springframework.cache.Cache;
import org.springframework.security.acls.model.AclCache;
import org.springframework.security.acls.model.MutableAcl;
@@ -78,13 +80,13 @@ public class SpringCacheBasedAclCache implements AclCache {
}
@Override
public MutableAcl getFromCache(ObjectIdentity objectIdentity) {
public @Nullable MutableAcl getFromCache(ObjectIdentity objectIdentity) {
Assert.notNull(objectIdentity, "ObjectIdentity required");
return getFromCache((Object) objectIdentity);
}
@Override
public MutableAcl getFromCache(Serializable pk) {
public @Nullable MutableAcl getFromCache(Serializable pk) {
Assert.notNull(pk, "Primary key (identifier) required");
return getFromCache((Object) pk);
}
@@ -101,12 +103,16 @@ public class SpringCacheBasedAclCache implements AclCache {
this.cache.put(acl.getId(), acl);
}
private MutableAcl getFromCache(Object key) {
private @Nullable MutableAcl getFromCache(Object key) {
Cache.ValueWrapper element = this.cache.get(key);
if (element == null) {
return null;
}
return initializeTransientFields((MutableAcl) element.get());
Object value = element.get();
if (value == null) {
return null;
}
return initializeTransientFields((MutableAcl) value);
}
private MutableAcl initializeTransientFields(MutableAcl value) {
@@ -17,4 +17,7 @@
/**
* Basic implementation of access control lists (ACLs) interfaces.
*/
@NullMarked
package org.springframework.security.acls.domain;
import org.jspecify.annotations.NullMarked;
@@ -23,6 +23,7 @@ import java.util.UUID;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jspecify.annotations.Nullable;
import org.springframework.core.convert.ConversionFailedException;
import org.springframework.core.convert.ConversionService;
@@ -67,10 +68,10 @@ class AclClassIdUtils {
* @return The identifier in the appropriate target Java type. Typically Long or UUID.
* @throws SQLException
*/
Serializable identifierFrom(Serializable identifier, ResultSet resultSet) throws SQLException {
if (isString(identifier) && hasValidClassIdType(resultSet)
&& canConvertFromStringTo(classIdTypeFrom(resultSet))) {
return convertFromStringTo((String) identifier, classIdTypeFrom(resultSet));
@Nullable Serializable identifierFrom(Serializable identifier, ResultSet resultSet) throws SQLException {
Class<? extends Serializable> classIdType = classIdTypeFrom(resultSet);
if (isString(identifier) && classIdType != null && canConvertFromStringTo(classIdType)) {
return convertFromStringTo((String) identifier, classIdType);
}
// Assume it should be a Long type
return convertToLong(identifier);
@@ -86,28 +87,38 @@ class AclClassIdUtils {
}
}
private <T extends Serializable> Class<T> classIdTypeFrom(ResultSet resultSet) throws SQLException {
return classIdTypeFrom(resultSet.getString(DEFAULT_CLASS_ID_TYPE_COLUMN_NAME));
private @Nullable Class<? extends Serializable> classIdTypeFrom(ResultSet resultSet) throws SQLException {
try {
return classIdTypeFrom(resultSet.getString(DEFAULT_CLASS_ID_TYPE_COLUMN_NAME));
}
catch (SQLException ex) {
log.debug("Unable to obtain the class id type", ex);
return null;
}
}
private <T extends Serializable> Class<T> classIdTypeFrom(String className) {
private @Nullable Class<? extends Serializable> classIdTypeFrom(String className) {
if (className == null) {
return null;
}
try {
return (Class) Class.forName(className);
return Class.forName(className).asSubclass(Serializable.class);
}
catch (ClassNotFoundException ex) {
log.debug("Unable to find class id type on classpath", ex);
return null;
}
catch (ClassCastException ex) {
log.debug("Class id type is not a Serializable type", ex);
return null;
}
}
private <T> boolean canConvertFromStringTo(Class<T> targetType) {
return this.conversionService.canConvert(String.class, targetType);
}
private <T extends Serializable> T convertFromStringTo(String identifier, Class<T> targetType) {
private <T extends Serializable> @Nullable T convertFromStringTo(String identifier, Class<T> targetType) {
return this.conversionService.convert(identifier, targetType);
}
@@ -121,7 +132,7 @@ class AclClassIdUtils {
* exception occurred
* @throws IllegalArgumentException if targetType is null
*/
private Long convertToLong(Serializable identifier) {
private @Nullable Long convertToLong(Serializable identifier) {
if (this.conversionService.canConvert(identifier.getClass(), Long.class)) {
return this.conversionService.convert(identifier, Long.class);
}
@@ -140,10 +151,10 @@ class AclClassIdUtils {
private static class StringToLongConverter implements Converter<String, Long> {
@Override
public Long convert(String identifierAsString) {
public Long convert(@Nullable String identifierAsString) {
if (identifierAsString == null) {
throw new ConversionFailedException(TypeDescriptor.valueOf(String.class),
TypeDescriptor.valueOf(Long.class), null, null);
TypeDescriptor.valueOf(Long.class), identifierAsString, new NullPointerException());
}
return Long.parseLong(identifierAsString);
@@ -154,10 +165,10 @@ class AclClassIdUtils {
private static class StringToUUIDConverter implements Converter<String, UUID> {
@Override
public UUID convert(String identifierAsString) {
public UUID convert(@Nullable String identifierAsString) {
if (identifierAsString == null) {
throw new ConversionFailedException(TypeDescriptor.valueOf(String.class),
TypeDescriptor.valueOf(UUID.class), null, null);
TypeDescriptor.valueOf(UUID.class), identifierAsString, new NullPointerException());
}
return UUID.fromString(identifierAsString);
@@ -31,6 +31,8 @@ import java.util.Set;
import javax.sql.DataSource;
import org.jspecify.annotations.Nullable;
import org.springframework.core.convert.ConversionException;
import org.springframework.core.convert.ConversionService;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -224,7 +226,8 @@ public class BasicLookupStrategy implements LookupStrategy {
* @param findNow Long-based primary keys to retrieve
* @param sids
*/
private void lookupPrimaryKeys(final Map<Serializable, Acl> acls, final Set<Long> findNow, final List<Sid> sids) {
private void lookupPrimaryKeys(final Map<Serializable, Acl> acls, final Set<Long> findNow,
final @Nullable List<Sid> sids) {
Assert.notNull(acls, "ACLs are required");
Assert.notEmpty(findNow, "Items to find now required");
String sql = computeRepeatingSql(this.lookupPrimaryKeysWhereClause, findNow.size());
@@ -264,7 +267,7 @@ public class BasicLookupStrategy implements LookupStrategy {
* automatically create entries if required)
*/
@Override
public final Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids) {
public final Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, @Nullable List<Sid> sids) {
Assert.isTrue(this.batchSize >= 1, "BatchSize must be >= 1");
Assert.notEmpty(objects, "Objects to lookup required");
// Map<ObjectIdentity,Acl>
@@ -323,7 +326,7 @@ public class BasicLookupStrategy implements LookupStrategy {
* properly-configured parent ACLs.
*/
private Map<ObjectIdentity, Acl> lookupObjectIdentities(final Collection<ObjectIdentity> objectIdentities,
List<Sid> sids) {
@Nullable List<Sid> sids) {
Assert.notEmpty(objectIdentities, "Must provide identities to lookup");
// contains Acls with StubAclParents
@@ -399,8 +402,10 @@ public class BasicLookupStrategy implements LookupStrategy {
}
// Now we have the parent (if there is one), create the true AclImpl
Sid owner = inputAcl.getOwner();
Assert.isTrue(owner != null, "Owner is required");
AclImpl result = new AclImpl(inputAcl.getObjectIdentity(), inputAcl.getId(), this.aclAuthorizationStrategy,
this.grantingStrategy, parent, null, inputAcl.isEntriesInheriting(), inputAcl.getOwner());
this.grantingStrategy, parent, null, inputAcl.isEntriesInheriting(), owner);
// Copy the "aces" from the input to the destination
@@ -506,9 +511,9 @@ public class BasicLookupStrategy implements LookupStrategy {
private final Map<Serializable, Acl> acls;
private final List<Sid> sids;
private final @Nullable List<Sid> sids;
ProcessResultSet(Map<Serializable, Acl> acls, List<Sid> sids) {
ProcessResultSet(Map<Serializable, Acl> acls, @Nullable List<Sid> sids) {
Assert.notNull(acls, "ACLs cannot be null");
this.acls = acls;
this.sids = sids; // can be null
@@ -579,6 +584,9 @@ public class BasicLookupStrategy implements LookupStrategy {
// target id type, e.g. UUID.
Serializable identifier = (Serializable) rs.getObject("object_id_identity");
identifier = BasicLookupStrategy.this.aclClassIdUtils.identifierFrom(identifier, rs);
if (identifier == null) {
throw new IllegalStateException("Identifier cannot be null");
}
ObjectIdentity objectIdentity = BasicLookupStrategy.this.objectIdentityGenerator
.createObjectIdentity(identifier, rs.getString("class"));
@@ -670,7 +678,7 @@ public class BasicLookupStrategy implements LookupStrategy {
}
@Override
public boolean isSidLoaded(List<Sid> sids) {
public boolean isSidLoaded(@Nullable List<Sid> sids) {
throw new UnsupportedOperationException("Stub only");
}
@@ -27,6 +27,7 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jspecify.annotations.Nullable;
import org.springframework.core.convert.ConversionService;
import org.springframework.jdbc.core.JdbcOperations;
@@ -98,7 +99,7 @@ public class JdbcAclService implements AclService {
}
@Override
public List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity) {
public @Nullable List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity) {
Object[] args = { parentIdentity.getIdentifier().toString(), parentIdentity.getType() };
List<ObjectIdentity> objects = this.jdbcOperations.query(this.findChildrenSql,
(rs, rowNum) -> mapObjectIdentityRow(rs), args);
@@ -109,11 +110,14 @@ public class JdbcAclService implements AclService {
String javaType = rs.getString("class");
Serializable identifier = (Serializable) rs.getObject("obj_id");
identifier = this.aclClassIdUtils.identifierFrom(identifier, rs);
if (identifier == null) {
throw new IllegalStateException("Identifier cannot be null");
}
return this.objectIdentityGenerator.createObjectIdentity(identifier, javaType);
}
@Override
public Acl readAclById(ObjectIdentity object, List<Sid> sids) throws NotFoundException {
public Acl readAclById(ObjectIdentity object, @Nullable List<Sid> sids) throws NotFoundException {
Map<ObjectIdentity, Acl> map = readAclsById(Collections.singletonList(object), sids);
Assert.isTrue(map.containsKey(object),
() -> "There should have been an Acl entry for ObjectIdentity " + object);
@@ -131,7 +135,7 @@ public class JdbcAclService implements AclService {
}
@Override
public Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids)
public Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, @Nullable List<Sid> sids)
throws NotFoundException {
Map<ObjectIdentity, Acl> result = this.lookupStrategy.readAclsById(objects, sids);
// Check every requested object identity was found (throw NotFoundException if
@@ -22,6 +22,8 @@ import java.util.List;
import javax.sql.DataSource;
import org.jspecify.annotations.Nullable;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.security.acls.domain.AccessControlEntryImpl;
@@ -120,6 +122,7 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
// Need to retrieve the current principal, in order to know who "owns" this ACL
// (can be changed later on)
Authentication auth = this.securityContextHolderStrategy.getContext().getAuthentication();
Assert.isTrue(auth != null, "Authentication required");
PrincipalSid sid = new PrincipalSid(auth);
// Create the acl_object_identity row
@@ -155,9 +158,12 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
Assert.isTrue(entry_ instanceof AccessControlEntryImpl, "Unknown ACE class");
AccessControlEntryImpl entry = (AccessControlEntryImpl) entry_;
Assert.state(acl.getId() != null, "ACL ID cannot be null");
stmt.setLong(1, (Long) acl.getId());
stmt.setInt(2, i);
stmt.setLong(3, createOrRetrieveSidPrimaryKey(entry.getSid(), true));
Long sidPrimaryKey = createOrRetrieveSidPrimaryKey(entry.getSid(), true);
Assert.state(sidPrimaryKey != null, "SID primary key cannot be null");
stmt.setLong(3, sidPrimaryKey);
stmt.setInt(4, entry.getPermission().getMask());
stmt.setBoolean(5, entry.isGranting());
stmt.setBoolean(6, entry.isAuditSuccess());
@@ -189,11 +195,14 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
* @param allowCreate true if creation is permitted if not found
* @return the primary key or null if not found
*/
protected Long createOrRetrieveClassPrimaryKey(String type, boolean allowCreate, Class idType) {
List<Long> classIds = this.jdbcOperations.queryForList(this.selectClassPrimaryKey, Long.class, type);
protected @Nullable Long createOrRetrieveClassPrimaryKey(String type, boolean allowCreate, Class idType) {
List<@Nullable Long> classIds = this.jdbcOperations.queryForList(this.selectClassPrimaryKey, Long.class, type);
if (!classIds.isEmpty()) {
return classIds.get(0);
Long result = classIds.get(0);
if (result != null) {
return result;
}
}
if (allowCreate) {
@@ -204,7 +213,9 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
this.jdbcOperations.update(this.insertClass, type, idType.getCanonicalName());
}
Assert.isTrue(TransactionSynchronizationManager.isSynchronizationActive(), "Transaction must be running");
return this.jdbcOperations.queryForObject(this.classIdentityQuery, Long.class);
Long result = this.jdbcOperations.queryForObject(this.classIdentityQuery, Long.class);
Assert.state(result != null, "Failed to retrieve class primary key");
return result;
}
return null;
@@ -219,7 +230,7 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
* @throws IllegalArgumentException if the <tt>Sid</tt> is not a recognized
* implementation.
*/
protected Long createOrRetrieveSidPrimaryKey(Sid sid, boolean allowCreate) {
protected @Nullable Long createOrRetrieveSidPrimaryKey(Sid sid, boolean allowCreate) {
Assert.notNull(sid, "Sid required");
if (sid instanceof PrincipalSid) {
String sidName = ((PrincipalSid) sid).getPrincipal();
@@ -240,16 +251,22 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
* @param allowCreate true if creation is permitted if not found
* @return the primary key or null if not found
*/
protected Long createOrRetrieveSidPrimaryKey(String sidName, boolean sidIsPrincipal, boolean allowCreate) {
List<Long> sidIds = this.jdbcOperations.queryForList(this.selectSidPrimaryKey, Long.class, sidIsPrincipal,
sidName);
protected @Nullable Long createOrRetrieveSidPrimaryKey(String sidName, boolean sidIsPrincipal,
boolean allowCreate) {
List<@Nullable Long> sidIds = this.jdbcOperations.queryForList(this.selectSidPrimaryKey, Long.class,
sidIsPrincipal, sidName);
if (!sidIds.isEmpty()) {
return sidIds.get(0);
Long result = sidIds.get(0);
if (result != null) {
return result;
}
}
if (allowCreate) {
this.jdbcOperations.update(this.insertSid, sidIsPrincipal, sidName);
Assert.isTrue(TransactionSynchronizationManager.isSynchronizationActive(), "Transaction must be running");
return this.jdbcOperations.queryForObject(this.sidIdentityQuery, Long.class);
Long result = this.jdbcOperations.queryForObject(this.sidIdentityQuery, Long.class);
Assert.state(result != null, "Failed to retrieve sid primary key");
return result;
}
return null;
}
@@ -279,6 +296,9 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
}
Long oidPrimaryKey = retrieveObjectIdentityPrimaryKey(objectIdentity);
if (oidPrimaryKey == null) {
throw new NotFoundException("Object identity not found: " + objectIdentity);
}
// Delete this ACL's ACEs in the acl_entry table
deleteEntries(oidPrimaryKey);
@@ -319,10 +339,11 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
* @param oid to find
* @return the object identity or null if not found
*/
protected Long retrieveObjectIdentityPrimaryKey(ObjectIdentity oid) {
protected @Nullable Long retrieveObjectIdentityPrimaryKey(ObjectIdentity oid) {
try {
return this.jdbcOperations.queryForObject(this.selectObjectIdentityPrimaryKey, Long.class, oid.getType(),
oid.getIdentifier().toString());
Long result = this.jdbcOperations.queryForObject(this.selectObjectIdentityPrimaryKey, Long.class,
oid.getType(), oid.getIdentifier().toString());
return result;
}
catch (DataAccessException notFound) {
return null;
@@ -340,7 +361,11 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
Assert.notNull(acl.getId(), "Object Identity doesn't provide an identifier");
// Delete this ACL's ACEs in the acl_entry table
deleteEntries(retrieveObjectIdentityPrimaryKey(acl.getObjectIdentity()));
Long oidPrimaryKey = retrieveObjectIdentityPrimaryKey(acl.getObjectIdentity());
if (oidPrimaryKey == null) {
throw new NotFoundException("Object identity not found for ACL: " + acl.getObjectIdentity());
}
deleteEntries(oidPrimaryKey);
// Create this ACL's ACEs in the acl_entry table
createEntries(acl);
@@ -19,6 +19,8 @@ package org.springframework.security.acls.jdbc;
import java.util.List;
import java.util.Map;
import org.jspecify.annotations.Nullable;
import org.springframework.security.acls.model.Acl;
import org.springframework.security.acls.model.NotFoundException;
import org.springframework.security.acls.model.ObjectIdentity;
@@ -42,6 +44,6 @@ public interface LookupStrategy {
* {@link NotFoundException}, as a chain of {@link LookupStrategy}s may be used to
* automatically create entries if required)
*/
Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids);
Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, @Nullable List<Sid> sids);
}
@@ -17,4 +17,7 @@
/**
* JDBC-based persistence of ACL information
*/
@NullMarked
package org.springframework.security.acls.jdbc;
import org.jspecify.annotations.NullMarked;
@@ -18,6 +18,8 @@ package org.springframework.security.acls.model;
import java.io.Serializable;
import org.jspecify.annotations.Nullable;
/**
* Represents an individual permission assignment within an {@link Acl}.
*
@@ -36,7 +38,7 @@ public interface AccessControlEntry extends Serializable {
* Obtains an identifier that represents this ACE.
* @return the identifier, or <code>null</code> if unsaved
*/
Serializable getId();
@Nullable Serializable getId();
Permission getPermission();
@@ -19,6 +19,8 @@ package org.springframework.security.acls.model;
import java.io.Serializable;
import java.util.List;
import org.jspecify.annotations.Nullable;
/**
* Represents an access control list (ACL) for a domain object.
*
@@ -82,7 +84,7 @@ public interface Acl extends Serializable {
* @return the owner (may be <tt>null</tt> if the implementation does not use
* ownership concepts)
*/
Sid getOwner();
@Nullable Sid getOwner();
/**
* A domain object may have a parent for the purpose of ACL inheritance. If there is a
@@ -103,7 +105,7 @@ public interface Acl extends Serializable {
* @return the parent <tt>Acl</tt> (may be <tt>null</tt> if this <tt>Acl</tt> does not
* have a parent)
*/
Acl getParentAcl();
@Nullable Acl getParentAcl();
/**
* Indicates whether the ACL entries from the {@link #getParentAcl()} should flow down
@@ -189,6 +191,6 @@ public interface Acl extends Serializable {
* @return <tt>true</tt> if every passed <tt>Sid</tt> is represented by this
* <tt>Acl</tt> instance
*/
boolean isSidLoaded(List<Sid> sids);
boolean isSidLoaded(@Nullable List<Sid> sids);
}
@@ -18,6 +18,8 @@ package org.springframework.security.acls.model;
import java.io.Serializable;
import org.jspecify.annotations.Nullable;
import org.springframework.security.acls.jdbc.JdbcAclService;
/**
@@ -31,9 +33,9 @@ public interface AclCache {
void evictFromCache(ObjectIdentity objectIdentity);
MutableAcl getFromCache(ObjectIdentity objectIdentity);
@Nullable MutableAcl getFromCache(ObjectIdentity objectIdentity);
MutableAcl getFromCache(Serializable pk);
@Nullable MutableAcl getFromCache(Serializable pk);
void putInCache(MutableAcl acl);
@@ -19,6 +19,8 @@ package org.springframework.security.acls.model;
import java.util.List;
import java.util.Map;
import org.jspecify.annotations.Nullable;
/**
* Provides retrieval of {@link Acl} instances.
*
@@ -32,7 +34,7 @@ public interface AclService {
* @param parentIdentity to locate children of
* @return the children (or <tt>null</tt> if none were found)
*/
List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity);
@Nullable List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity);
/**
* Same as {@link #readAclsById(List)} except it returns only a single Acl.
@@ -59,7 +61,7 @@ public interface AclService {
* @throws NotFoundException if an {@link Acl} was not found for the requested
* {@link ObjectIdentity}
*/
Acl readAclById(ObjectIdentity object, List<Sid> sids) throws NotFoundException;
Acl readAclById(ObjectIdentity object, @Nullable List<Sid> sids) throws NotFoundException;
/**
* Obtains all the <tt>Acl</tt>s that apply for the passed <tt>Object</tt>s.
@@ -98,6 +100,7 @@ public interface AclService {
* @throws NotFoundException if an {@link Acl} was not found for each requested
* {@link ObjectIdentity}
*/
Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids) throws NotFoundException;
Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, @Nullable List<Sid> sids)
throws NotFoundException;
}
@@ -18,4 +18,7 @@
* Interfaces and shared classes to manage access control lists (ACLs) for domain object
* instances.
*/
@NullMarked
package org.springframework.security.acls.model;
import org.jspecify.annotations.NullMarked;
@@ -24,4 +24,7 @@
* older and more verbose attribute/voter/after-invocation approach from versions before
* Spring Security 3.0.
*/
@NullMarked
package org.springframework.security.acls;
import org.jspecify.annotations.NullMarked;
@@ -478,6 +478,7 @@ public class AclImplTests {
}
@Test
@SuppressWarnings("unchecked")
public void hashCodeWithoutStackOverFlow() throws Exception {
Sid sid = new PrincipalSid("pSid");
ObjectIdentity oid = new ObjectIdentityImpl("type", 1);
@@ -29,6 +29,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
@@ -46,7 +47,6 @@ import org.springframework.security.acls.model.Sid;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
@@ -109,7 +109,8 @@ public class JdbcAclServiceTests {
List<ObjectIdentity> result = new ArrayList<>();
result.add(new ObjectIdentityImpl(Object.class, "5577"));
Object[] args = { "1", "org.springframework.security.acls.jdbc.JdbcAclServiceTests$MockLongIdDomainObject" };
given(this.jdbcOperations.query(anyString(), any(RowMapper.class), eq(args))).willReturn(result);
given(this.jdbcOperations.query(anyString(), ArgumentMatchers.<RowMapper<ObjectIdentity>>any(), eq(args)))
.willReturn(result);
ObjectIdentity objectIdentity = new ObjectIdentityImpl(MockLongIdDomainObject.class, 1L);
List<ObjectIdentity> objectIdentities = this.aclService.findChildren(objectIdentity);
assertThat(objectIdentities).hasSize(1);
@@ -80,11 +80,10 @@ public class SpringCacheBasedAclCacheTests {
assertThatIllegalArgumentException().isThrownBy(() -> new SpringCacheBasedAclCache(null, null, null));
}
@SuppressWarnings("rawtypes")
@Test
public void cacheOperationsAclWithoutParent() {
Cache cache = getCache();
Map realCache = (Map) cache.getNativeCache();
Map<?, ?> realCache = (Map<?, ?>) cache.getNativeCache();
ObjectIdentity identity = new ObjectIdentityImpl(TARGET_CLASS, 100L);
AclAuthorizationStrategy aclAuthorizationStrategy = new AclAuthorizationStrategyImpl(
new SimpleGrantedAuthority("ROLE_OWNERSHIP"), new SimpleGrantedAuthority("ROLE_AUDITING"),
@@ -116,11 +115,10 @@ public class SpringCacheBasedAclCacheTests {
assertThat(realCache).isEmpty();
}
@SuppressWarnings("rawtypes")
@Test
public void cacheOperationsAclWithParent() throws Exception {
Cache cache = getCache();
Map realCache = (Map) cache.getNativeCache();
Map<?, ?> realCache = (Map<?, ?>) cache.getNativeCache();
Authentication auth = new TestingAuthenticationToken("user", "password", "ROLE_GENERAL");
auth.setAuthenticated(true);
SecurityContextHolder.getContext().setAuthentication(auth);
+3
View File
@@ -1,13 +1,16 @@
apply plugin: 'io.spring.convention.spring-module'
apply plugin: 'io.freefair.aspectj'
apply plugin: 'compile-warnings-error'
compileAspectj {
sourceCompatibility = "17"
targetCompatibility = "17"
ajcOptions.compilerArgs += ['-Xlint:ignore']
}
compileTestAspectj {
sourceCompatibility = "17"
targetCompatibility = "17"
ajcOptions.compilerArgs += ['-Xlint:ignore']
}
dependencies {
+1
View File
@@ -1,6 +1,7 @@
import io.spring.gradle.convention.SpringModulePlugin
apply plugin: 'io.spring.convention.bom'
apply plugin: 'compile-warnings-error'
dependencies {
constraints {
+2
View File
@@ -1,5 +1,7 @@
import io.spring.gradle.IncludeRepoTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import trang.RncToXsd
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
dependencies {
@@ -0,0 +1,10 @@
import org.gradle.api.tasks.compile.JavaCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
tasks.withType(JavaCompile) {
options.compilerArgs += "-Werror"
}
tasks.withType(KotlinCompile) {
kotlinOptions.allWarningsAsErrors = true
}
@@ -34,7 +34,7 @@ class JacocoPlugin implements Plugin<Project> {
project.tasks.check.dependsOn project.tasks.jacocoTestReport
project.jacoco {
toolVersion = '0.8.9'
toolVersion = '0.8.14'
}
}
}
@@ -5,7 +5,7 @@ def toolchainVersion() {
if (project.hasProperty('testToolchain')) {
return project.property('testToolchain').toString().toInteger()
}
return 17
return 25
}
java {
@@ -0,0 +1,7 @@
import org.gradle.api.tasks.javadoc.Javadoc
project.tasks.withType(Javadoc).configureEach {
options.addBooleanOption('Werror', true)
// temporarily disable missing to get build to pass with JDK 25
options.addStringOption('Xdoclint:all,-missing')
}
@@ -0,0 +1,30 @@
import org.gradle.api.tasks.compile.JavaCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
/**
* We need to compile with JDK 25 for nullability support, but using JDK 25 means that our tests will fail due to the
* <a href="https://docs.oracle.com/en/java/javase/25/security/security-manager-is-permanently-disabled.html">removal
* of the Java Security Manager</a>. For example, in JDK 25 {@code Subject.getSubject(AccessControlContext)} throws an
* {@code UnsupportedOperationException}.
*
* To resolve this, we must migrate tests to use the new APIs (e.g. {@code Subject.current()}) but those APIs are not
* available in the JDK 17 source, so compiling with JDK 25 and release 17 fails. The plugin overrides the test
* compilation to use release 25.
*
* @see <a href="https://docs.oracle.com/en/java/javase/25/security/security-manager-is-permanently-disabled.html">The
* Security Manager Is Permanently Disabled</a>
* @see <a href="https://inside.java/2024/07/08/quality-heads-up/">Quality Outreach Heads-up - JDK 23: Re-Specified
* Subject.getSubject API</a>
*/
tasks.withType(JavaCompile).configureEach { task ->
if (task.name == 'compileTestJava' || task.name == 'compileIntegrationTestJava') {
task.options.release.set(25)
}
}
tasks.withType(KotlinCompile).configureEach { task ->
if (task.name == 'compileTestKotlin' || task.name == 'compileIntegrationTestKotlin') {
task.kotlinOptions.jvmTarget = '25'
}
}
+2
View File
@@ -1,5 +1,7 @@
plugins {
id 'security-nullability'
id 'javadoc-warnings-error'
id 'compile-warnings-error'
}
apply plugin: 'io.spring.convention.spring-module'
@@ -24,7 +24,6 @@ import org.apache.commons.logging.LogFactory;
import org.apereo.cas.client.validation.Assertion;
import org.apereo.cas.client.validation.TicketValidationException;
import org.apereo.cas.client.validation.TicketValidator;
import org.jspecify.annotations.NullUnmarked;
import org.jspecify.annotations.Nullable;
import org.springframework.beans.factory.InitializingBean;
@@ -166,7 +165,6 @@ public class CasAuthenticationProvider implements AuthenticationProvider, Initia
* @param authentication
* @return
*/
@NullUnmarked
private @Nullable String getServiceUrl(Authentication authentication) {
String serviceUrl;
if (authentication.getDetails() instanceof ServiceAuthenticationDetails) {
@@ -17,4 +17,7 @@
/**
* Jackson 3+ serialization support for CAS.
*/
@NullMarked
package org.springframework.security.cas.jackson;
import org.jspecify.annotations.NullMarked;
@@ -91,7 +91,8 @@ public class CasAuthenticationEntryPoint implements AuthenticationEntryPoint, In
*/
protected String createServiceUrl(HttpServletRequest request, HttpServletResponse response) {
return WebUtils.constructServiceUrl(null, response, this.serviceProperties.getService(), null,
this.serviceProperties.getArtifactParameter(), this.encodeServiceUrlWithSessionId);
this.serviceProperties.getServiceParameter(), this.serviceProperties.getArtifactParameter(),
this.encodeServiceUrlWithSessionId);
}
/**
+2
View File
@@ -4,6 +4,8 @@ import trang.RncToXsd
apply plugin: 'io.spring.convention.spring-module'
apply plugin: 'trang'
apply plugin: 'security-kotlin'
apply plugin: 'test-compile-target-jdk25'
apply plugin: 'javadoc-warnings-error'
configurations {
opensaml5 {
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.jspecify.annotations.NullMarked;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -98,12 +99,14 @@ public class LdapBindAuthenticationManagerFactoryITests {
public void authenticationManagerFactoryWhenCustomUserDetailsContextMapperThenUsed() throws Exception {
CustomUserDetailsContextMapperConfig.CONTEXT_MAPPER = new UserDetailsContextMapper() {
@Override
@NullMarked
public UserDetails mapUserFromContext(DirContextOperations ctx, String username,
Collection<? extends GrantedAuthority> authorities) {
return User.withUsername("other").password("password").roles("USER").build();
}
@Override
@NullMarked
public void mapUserToContext(UserDetails user, DirContextAdapter ctx) {
}
};
@@ -94,7 +94,7 @@ public final class SecurityNamespaceHandler implements NamespaceHandler {
public BeanDefinition parse(Element element, ParserContext pc) {
if (!namespaceMatchesVersion(element)) {
pc.getReaderContext()
.fatal("You cannot use any XSD older than spring-security-7.0.xsd. Either change to spring-security.xsd or spring-security-7.0.xsd",
.fatal("You cannot use any XSD older than spring-security-7.1.xsd. Either change to spring-security.xsd or spring-security-7.1.xsd",
element);
}
String name = pc.getDelegate().getLocalName(element);
@@ -219,7 +219,7 @@ public final class SecurityNamespaceHandler implements NamespaceHandler {
private boolean matchesVersionInternal(Element element) {
String schemaLocation = element.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation");
return schemaLocation.matches("(?m).*spring-security-7\\.0.*.xsd.*")
return schemaLocation.matches("(?m).*spring-security-7\\.1.*.xsd.*")
|| schemaLocation.matches("(?m).*spring-security.xsd.*")
|| !schemaLocation.matches("(?m).*spring-security.*");
}
@@ -1881,7 +1881,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
*
* <p>
* Invoking {@link #securityMatchers(Customizer)} will not override previous
* invocations of {@link #securityMatchers()}}, {@link #securityMatchers(Customizer)}
* invocations of {@link #securityMatchers(Customizer)}
* {@link #securityMatcher(String...)} and {@link #securityMatcher(RequestMatcher)}
* </p>
*
@@ -2004,8 +2004,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
* <p>
* Invoking {@link #securityMatcher(RequestMatcher)} will override previous
* invocations of {@link #securityMatcher(RequestMatcher)},
* {@link #securityMatcher(String...)}, {@link #securityMatchers(Customizer)} and
* {@link #securityMatchers()}
* {@link #securityMatcher(String...)} and {@link #securityMatchers(Customizer)}
* </p>
* @param requestMatcher the {@link RequestMatcher} to use, for example,
* {@code PathPatternRequestMatcher.pathPattern(HttpMethod.GET, "/admin/**")}
@@ -2024,9 +2023,8 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
*
* <p>
* Invoking {@link #securityMatcher(String...)} will override previous invocations of
* {@link #securityMatcher(String...)} (String)}},
* {@link #securityMatcher(RequestMatcher)} ()}, {@link #securityMatchers(Customizer)}
* (String)} and {@link #securityMatchers()} (String)}.
* {@link #securityMatcher(String...)}, {@link #securityMatcher(RequestMatcher)} and
* {@link #securityMatchers(Customizer)}.
* </p>
* @param patterns the pattern to match on (i.e. "/admin/**")
* @return the {@link HttpSecurity} for further customizations
@@ -226,7 +226,7 @@ public final class WebSecurity extends AbstractConfiguredSecurityBuilder<Filter,
*
* <p>
* Typically this method is invoked automatically within the framework from
* {@link WebSecurityConfiguration#springSecurityFilterChain()}
* {@link WebSecurityConfiguration#springSecurityFilterChain(ObjectProvider)}
* </p>
* @param securityFilterChainBuilder the builder to use to create the
* {@link SecurityFilterChain} instances
@@ -39,6 +39,7 @@ import org.springframework.security.web.authentication.AnonymousAuthenticationFi
* other than applying this {@link SecurityConfigurer}.
*
* @author Rob Winch
* @author DingHao
* @since 3.2
*/
public final class AnonymousConfigurer<H extends HttpSecurityBuilder<H>>
@@ -158,7 +159,7 @@ public final class AnonymousConfigurer<H extends HttpSecurityBuilder<H>>
}
this.authenticationFilter.setSecurityContextHolderStrategy(getSecurityContextHolderStrategy());
this.authenticationFilter.afterPropertiesSet();
http.addFilter(this.authenticationFilter);
http.addFilter(postProcess(this.authenticationFilter));
}
private String getKey() {
@@ -47,8 +47,8 @@ import org.springframework.util.Assert;
* The following configuration options are available:
*
* <ul>
* <li>{@link #authorizationCodeGrant()} - support for the OAuth 2.0 Authorization Code
* Grant</li>
* <li>{@link #authorizationCodeGrant(Customizer)} - support for the OAuth 2.0
* Authorization Code Grant</li>
* </ul>
*
* <p>
@@ -59,7 +59,8 @@ import org.springframework.util.Assert;
*
* <h2>Security Filters</h2>
*
* The following {@code Filter}'s are populated for {@link #authorizationCodeGrant()}:
* The following {@code Filter}'s are populated for
* {@link #authorizationCodeGrant(Customizer)}:
*
* <ul>
* <li>{@link OAuth2AuthorizationRequestRedirectFilter}</li>
@@ -21,6 +21,7 @@ import java.util.function.Function;
import org.opensaml.core.Version;
import org.springframework.context.ApplicationContext;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.HttpSecurityBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
@@ -42,7 +43,8 @@ import org.springframework.util.Assert;
*
* <p>
* Defaults are provided for all configuration options with the only required
* configuration being a {@link Saml2LoginConfigurer#relyingPartyRegistrationRepository}.
* configuration being a
* {@link Saml2LoginConfigurer#relyingPartyRegistrationRepository(HttpSecurityBuilder)}.
* Alternatively, a {@link RelyingPartyRegistrationRepository} {@code @Bean} may be
* registered instead.
*
@@ -67,7 +69,7 @@ import org.springframework.util.Assert;
* </ul>
*
* @since 6.1
* @see HttpSecurity#saml2Metadata()
* @see HttpSecurity#saml2Metadata(Customizer)
* @see Saml2MetadataFilter
* @see RelyingPartyRegistrationRepository
*/
@@ -2162,7 +2162,7 @@ public class ServerHttpSecurity {
*
* @author Evgeniy Cheban
* @since 5.6
* @see #passwordManagement()
* @see #passwordManagement(Customizer)
*/
public final class PasswordManagementSpec {
@@ -2663,7 +2663,7 @@ public class ServerHttpSecurity {
/**
* Configures cache control headers
*
* @see #cache()
* @see HeaderSpec#cache(Customizer)
*/
public final class CacheSpec {
@@ -2684,7 +2684,7 @@ public class ServerHttpSecurity {
/**
* The content type headers
*
* @see #contentTypeOptions()
* @see HeaderSpec#contentTypeOptions(Customizer)
*/
public final class ContentTypeOptionsSpec {
@@ -2705,7 +2705,7 @@ public class ServerHttpSecurity {
/**
* Configures frame options response header
*
* @see #frameOptions()
* @see HeaderSpec#frameOptions(Customizer)
*/
public final class FrameOptionsSpec {
@@ -2737,7 +2737,7 @@ public class ServerHttpSecurity {
/**
* Configures Strict Transport Security response header
*
* @see #hsts()
* @see HeaderSpec#hsts(Customizer)
*/
public final class HstsSpec {
@@ -2796,7 +2796,7 @@ public class ServerHttpSecurity {
/**
* Configures x-xss-protection response header
*
* @see #xssProtection()
* @see HeaderSpec#xssProtection(Customizer)
*/
public final class XssProtectionSpec {
@@ -2830,7 +2830,7 @@ public class ServerHttpSecurity {
* Configures {@code Content-Security-Policy} response header.
*
* @since 5.1
* @see #contentSecurityPolicy(String)
* @see HeaderSpec#contentSecurityPolicy(Customizer)
*/
public final class ContentSecurityPolicySpec {
@@ -2884,8 +2884,7 @@ public class ServerHttpSecurity {
* Allows method chaining to continue configuring the
* {@link ServerHttpSecurity}.
* @return the {@link HeaderSpec} to continue configuring
* @deprecated For removal in 7.0. Use {@link #featurePolicy(Customizer)}
* instead
* @deprecated For removal in 7.0. Use {@link #featurePolicy(String)} instead
*/
@Deprecated(since = "6.1", forRemoval = true)
public HeaderSpec and() {
@@ -2898,7 +2897,7 @@ public class ServerHttpSecurity {
* Configures {@code Permissions-Policy} response header.
*
* @since 5.5
* @see #permissionsPolicy()
* @see HeaderSpec#permissionsPolicy(Customizer)
*/
public final class PermissionsPolicySpec {
@@ -2921,8 +2920,7 @@ public class ServerHttpSecurity {
* Configures {@code Referrer-Policy} response header.
*
* @since 5.1
* @see #referrerPolicy()
* @see #referrerPolicy(ReferrerPolicy)
* @see HeaderSpec#referrerPolicy(Customizer)
*/
public final class ReferrerPolicySpec {
@@ -14,6 +14,8 @@
# limitations under the License.
#
http\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-7.1.xsd
http\://www.springframework.org/schema/security/spring-security-7.0.xsd=org/springframework/security/config/spring-security-7.1.xsd
http\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-7.0.xsd
http\://www.springframework.org/schema/security/spring-security-7.0.xsd=org/springframework/security/config/spring-security-7.0.xsd
http\://www.springframework.org/schema/security/spring-security-6.5.xsd=org/springframework/security/config/spring-security-6.5.xsd
@@ -42,7 +44,8 @@ http\://www.springframework.org/schema/security/spring-security-2.0.xsd=org/spri
http\://www.springframework.org/schema/security/spring-security-2.0.1.xsd=org/springframework/security/config/spring-security-2.0.1.xsd
http\://www.springframework.org/schema/security/spring-security-2.0.2.xsd=org/springframework/security/config/spring-security-2.0.2.xsd
http\://www.springframework.org/schema/security/spring-security-2.0.4.xsd=org/springframework/security/config/spring-security-2.0.4.xsd
https\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-7.0.xsd
https\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-7.1.xsd
https\://www.springframework.org/schema/security/spring-security-7.1.xsd=org/springframework/security/config/spring-security-7.1.xsd
https\://www.springframework.org/schema/security/spring-security-7.0.xsd=org/springframework/security/config/spring-security-7.0.xsd
https\://www.springframework.org/schema/security/spring-security-6.5.xsd=org/springframework/security/config/spring-security-6.5.xsd
https\://www.springframework.org/schema/security/spring-security-6.4.xsd=org/springframework/security/config/spring-security-6.4.xsd
@@ -114,7 +114,7 @@ public class SecurityNamespaceHandlerTests {
"<user-service id='us'><user name='bob' password='bobspassword' authorities='ROLE_A' /></user-service>",
"3.0.3", null))
.withMessageContaining(
"You cannot use any XSD older than spring-security-7.0.xsd. Either change to spring-security.xsd or spring-security-7.0.xsd");
"You cannot use any XSD older than spring-security-7.1.xsd. Either change to spring-security.xsd or spring-security-7.1.xsd");
}
// SEC-1868
@@ -16,6 +16,7 @@
package org.springframework.security.config.annotation.web.configurers;
import jakarta.servlet.http.HttpServletRequest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -23,6 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.config.ObjectPostProcessor;
import org.springframework.security.config.annotation.SecurityContextChangedListenerConfig;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@@ -34,11 +37,14 @@ import org.springframework.security.core.userdetails.PasswordEncodedUser;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.AnonymousAuthenticationFilter;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.springframework.security.config.Customizer.withDefaults;
import static org.springframework.security.config.annotation.SecurityContextChangedListenerArgumentMatchers.setAuthentication;
@@ -101,6 +107,45 @@ public class AnonymousConfigurerTests {
this.mockMvc.perform(get("/")).andExpect(status().isOk()).andExpect(content().string("myAnonymousUser"));
}
@Test
public void anonymousAuthenticationWhenUsingAuthenticationDetailsSourceRefThenMatchesNamespace() throws Exception {
this.spring.register(AuthenticationDetailsSourceAnonymousConfig.class).autowire();
AuthenticationDetailsSource<HttpServletRequest, ?> source = this.spring.getContext()
.getBean(AuthenticationDetailsSource.class);
this.mockMvc.perform(get("/"));
verify(source).buildDetails(any(HttpServletRequest.class));
}
@Configuration
@EnableWebSecurity
@EnableWebMvc
static class AuthenticationDetailsSourceAnonymousConfig {
AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource = mock(
AuthenticationDetailsSource.class);
@Bean
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
return http.anonymous((anonymous) -> anonymous
.withObjectPostProcessor(new ObjectPostProcessor<AnonymousAuthenticationFilter>() {
@Override
public <O extends AnonymousAuthenticationFilter> O postProcess(O object) {
object.setAuthenticationDetailsSource(
AuthenticationDetailsSourceAnonymousConfig.this.authenticationDetailsSource);
return object;
}
})).build();
}
@Bean
AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource() {
return this.authenticationDetailsSource;
}
}
@Configuration
@EnableWebSecurity
@EnableWebMvc
@@ -409,7 +409,9 @@ public class Saml2LogoutConfigurerTests {
logoutRequest.setIssueInstant(Instant.now());
given(getBean(Saml2LogoutRequestValidator.class).validate(any()))
.willReturn(Saml2LogoutValidatorResult.success());
Saml2LogoutResponse logoutResponse = Saml2LogoutResponse.withRelyingPartyRegistration(registration).build();
Saml2LogoutResponse logoutResponse = Saml2LogoutResponse.withRelyingPartyRegistration(registration)
.samlResponse("samlResponse")
.build();
given(getBean(Saml2LogoutResponseResolver.class).resolve(any(), any())).willReturn(logoutResponse);
this.mvc.perform(post("/logout/saml2/slo").param("SAMLRequest", "samlRequest").with(authentication(this.user)))
.andReturn();
@@ -65,7 +65,7 @@ public class XsdDocumentedTests {
String schema31xDocumentLocation = "org/springframework/security/config/spring-security-3.1.xsd";
String schemaDocumentLocation = "org/springframework/security/config/spring-security-7.0.xsd";
String schemaDocumentLocation = "org/springframework/security/config/spring-security-7.1.xsd";
XmlSupport xml = new XmlSupport();
@@ -151,8 +151,8 @@ public class XsdDocumentedTests {
.list((dir, name) -> name.endsWith(".xsd"));
// @formatter:on
assertThat(schemas.length)
.withFailMessage("the count is equal to 28, if not then schemaDocument needs updating")
.isEqualTo(28);
.withFailMessage("the count is equal to 29, if not then schemaDocument needs updating")
.isEqualTo(29);
}
/**
@@ -19,7 +19,6 @@ package org.springframework.security.config.http;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.security.AccessController;
import java.security.Principal;
import java.security.cert.X509Certificate;
import java.util.Arrays;
@@ -989,7 +988,7 @@ public class MiscHttpConfigTests {
@GetMapping("/username")
String username() {
Subject subject = Subject.getSubject(AccessController.getContext());
Subject subject = Subject.current();
return subject.getPrincipals().iterator().next().getName();
}
@@ -306,7 +306,9 @@ public class Saml2LogoutBeanDefinitionParserTests {
logoutRequest.setIssueInstant(Instant.now());
given(getBean(Saml2LogoutRequestValidator.class).validate(any()))
.willReturn(Saml2LogoutValidatorResult.success());
Saml2LogoutResponse logoutResponse = Saml2LogoutResponse.withRelyingPartyRegistration(registration).build();
Saml2LogoutResponse logoutResponse = Saml2LogoutResponse.withRelyingPartyRegistration(registration)
.samlResponse("samlResponse")
.build();
given(getBean(Saml2LogoutResponseResolver.class).resolve(any(), any())).willReturn(logoutResponse);
this.mvc
.perform(post("/logout/saml2/slo").param("SAMLRequest", "samlRequest").with(authentication(this.saml2User)))
@@ -278,7 +278,7 @@ public class LogoutSpecTests {
private static class InMemorySecurityContextRepository implements ServerSecurityContextRepository {
@Nullable private SecurityContext savedContext;
private @Nullable SecurityContext savedContext;
@Override
public Mono<Void> save(ServerWebExchange exchange, SecurityContext context) {
@@ -291,7 +291,7 @@ public class LogoutSpecTests {
return Mono.justOrEmpty(this.savedContext);
}
@Nullable private SecurityContext getSavedContext() {
private @Nullable SecurityContext getSavedContext() {
return this.savedContext;
}

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