Migrate to Spring Security 7.0

MSAL

Migrate applications to the latest Spring Security 7.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions.

org.openrewrite.java.spring.security7.UpgradeSpringSecurity_7_0
mod run . --recipe=org.openrewrite.java.spring.security7.UpgradeSpringSecurity_7_0

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Upgrade Gradle or Maven dependency versions org.springframework.security:*:7.0.x
  2. Remove throws exception in SecurityConfigurer methods init and configure
  3. Widen the Supplier parameter of AuthorizationManager#check overrides
  4. Change method name org.springframework.security.authorization.AuthorizationManager check(..) to authorize
  5. Replace constant with literal value
  6. Replace constant with literal value
  7. Change method name org.springframework.security.authorization.event.AuthorizationEvent getAuthorizationDecision() to getAuthorizationResult
  8. Migrate the OpenSAML 4 classes of Spring Security to their OpenSAML 5 counterparts