Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spring-security-web parser classpath dependency #148

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencyCheck {


group = "org.openrewrite.recipe"
description = "Enforce logging best practices and migrate between logging frameworks. Automatically."
description = "Patch Java security vulnerabilities. Automatically."

def rewriteVersion = rewriteRecipe.rewriteVersion.get()

Expand All @@ -25,6 +25,7 @@ recipeDependencies {
parserClasspath("com.fasterxml.jackson.core:jackson-databind:2.13.+")
parserClasspath("org.springframework:spring-context:5.+")
parserClasspath("org.springframework.security:spring-security-config:5.+")
parserClasspath("org.springframework.security:spring-security-web:5.+")
parserClasspath("javax:javaee-api:7.+")
parserClasspath("jakarta.servlet:jakarta.servlet-api:4.+")
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public void putMessage(String key, @Nullable Object value) {

spec.recipe(new CsrfProtection(null))
.parser(JavaParser.fromJavaVersion()
.classpath("spring-boot-autoconfigure", "spring-security-config", "spring-context", "servlet-api", "spring-beans"))
.classpath(
"spring-boot-autoconfigure",
"spring-security-config",
"spring-context",
"servlet-api",
"spring-beans"))
bryceatmoderne marked this conversation as resolved.
Show resolved Hide resolved
.executionContext(ctx); // don't skip source set generation
}

Expand All @@ -50,7 +55,7 @@ void withSecurityConfig() {
java(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
class Application {
}
Expand All @@ -60,7 +65,7 @@ class Application {
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@Configuration
class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
Expand All @@ -73,7 +78,7 @@ protected void configure(HttpSecurity http) throws Exception {
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;

@Configuration
class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
Expand Down
Loading