Recipe to address unresolvable circular reference
upgrading to Spring Boot 2.7.18
#668
Labels
unresolvable circular reference
upgrading to Spring Boot 2.7.18
#668
What problem are you trying to solve?
Improve the Spring Security recipe that updates the class that extends
WebSecurityConfigurerAdapter
.Sample application
The sample application is the spring-boot-blog-app. This is a fork of skarware/spring-boot-blog-app. The OpenRewrite maven plugin is defined in the pom.xml.
Branch before the upgrade:
https://github.com/nickdala/spring-boot-blog-app-java-copilot-upgrade-demo/tree/openrewrite-circular-reference-before
Branch after the upgrade using OpenRewrite
https://github.com/nickdala/spring-boot-blog-app-java-copilot-upgrade-demo/tree/openrewrite-circular-reference-after
What precondition(s) should be checked before applying this recipe?
A
PasswordEncoder
bean like the following defined in the class that extendsWebSecurityConfigurerAdapter
.Steps to reproduce
Dev Container
. Docker needs to be running.openrewrite-circular-reference-before
or
You will see the following error.
Describe the situation after applying the recipe
Step 1:
Move the method
bcryptEncoder()
inWebSecurityConfig.java
to a separate class to create theBCryptPasswordEncoder
instance.Step 2:
Pass the
BCryptPasswordEncoder
to theconfigureGlobal()
method inWebSecurityConfig
.The complete code is in the branch openrewrite-circular-reference-after
Are you interested in [contributing this recipe to OpenRewrite]
Yes. I'm interested in collaborating with the community to verify the recipe and to ensure that we're accounting for any edge cases. Once that's done, I can lead the coding effort.
The text was updated successfully, but these errors were encountered: