Migrate to Spring Security 5.8

MSAL

Migrate applications to the latest Spring Security 5.8 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.security5.UpgradeSpringSecurity_5_8
mod run . --recipe=org.openrewrite.java.spring.security5.UpgradeSpringSecurity_5_8

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. Migrate to Spring Security 5.7
  2. Upgrade Gradle or Maven dependency versions org.springframework.security:*:5.8.x
  3. Upgrade Gradle or Maven dependency versions org.springframework.security:spring-security-oauth2-authorization-server:0.4.x
  4. Convert HttpSecurity chained calls into Lambda DSL
  5. Convert ServerHttpSecurity chained calls into Lambda DSL
  6. Convert HeadersConfigurer chained calls into Lambda DSL
  7. Replace HttpSecurity.authorizeRequests(...) with HttpSecurity.authorizeHttpRequests(...) and ExpressionUrlAuthorizationConfigurer, AbstractInterceptUrlConfigurer with AuthorizeHttpRequestsConfigurer, etc
  8. Convert requestMatchers chain to securityMatcher
  9. Use the new requestMatchers methods
  10. Use the new securityMatcher() method
  11. Use new Pbkdf2PasswordEncoder factory methods
  12. Use new SCryptPasswordEncoder factory methods
  13. Use new Argon2PasswordEncoder factory methods
  14. Rename the package name from com.nimbusds.jose.shaded.json to net.minidev.json
  15. Replace global method security with method security
  16. Replace global method security with method security