Migrate OAuth2RestTemplate beans to RestTemplate with an OAuth2 interceptor

Proprietary

Replaces a @Bean method returning a Spring Security OAuth OAuth2RestTemplate with one returning a plain RestTemplate configured with OAuth2ClientHttpRequestInterceptor, and moves the ClientCredentialsResourceDetails settings that built it into spring.security.oauth2.client.registration.default.* properties. Since OAuth2RestTemplate extends RestTemplate, call sites continue to compile unchanged. Beans whose settings cannot all be read at compile time are left exactly as they are and marked for a manual migration, because a template stripped of its credentials would still compile while failing at runtime.

io.moderne.java.spring.security.oauth.MigrateOAuth2RestTemplateBean
mod run . --recipe=io.moderne.java.spring.security.oauth.MigrateOAuth2RestTemplateBean

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