Migrate OAuth2AccessTokenResponseClient from RestOperations to RestClient based implementations

Proprietary

Replaces the deprecated RestOperations-based OAuth2AccessTokenResponseClient implementations, removed in Spring Security 7, with the RestClient-based ones introduced in Spring Security 6.4. setRestOperations calls with a RestTemplate become setRestClient calls. Other setRestOperations arguments and setRequestEntityConverter calls are marked with a warning. DefaultPasswordTokenResponseClient has no replacement and is left as is.

io.moderne.java.spring.security7.MigrateOAuth2AccessTokenResponseClient
mod run . --recipe=io.moderne.java.spring.security7.MigrateOAuth2AccessTokenResponseClient

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. Change type DefaultAuthorizationCodeTokenResponseClient to RestClientAuthorizationCodeTokenResponseClient
  2. Change type DefaultRefreshTokenTokenResponseClient to RestClientRefreshTokenTokenResponseClient
  3. Change type DefaultClientCredentialsTokenResponseClient to RestClientClientCredentialsTokenResponseClient
  4. Change type DefaultJwtBearerTokenResponseClient to RestClientJwtBearerTokenResponseClient
  5. Change type DefaultTokenExchangeTokenResponseClient to RestClientTokenExchangeTokenResponseClient
  6. Migrate OAuth2 token response client from RestOperations to RestClient