Skip to content

Replace WebSecurityConfigurerAdapter with a SecurityFilterChain bean - #1264

Merged
devin-ai-integration[bot] merged 1 commit into
devin/unt-5-spring-boot-2.7from
devin/unt-6-security-filter-chain
Nov 17, 2026
Merged

devin-ai-integration[bot] merged 1 commit into
devin/unt-5-spring-boot-2.7from
devin/unt-6-security-filter-chain

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary

Plan step s2.3, stacked on #1252. WebSecurityConfig no longer extends WebSecurityConfigurerAdapter (removed in Security 6); it exposes a SecurityFilterChain bean built with the lambda DSL and authorizeHttpRequests + requestMatchers. Same rules as before: CSRF off, CORS via the existing corsConfigurationSource, stateless, 401 HttpStatusEntryPoint, OPTIONS / /graphiql / /graphql / POST /users, /users/login / GET /articles/**, /profiles/**, /tags public, GET /articles/feed and everything else authenticated, JwtTokenFilter before UsernamePasswordAuthenticationFilter.

  • requestMatchers takes explicit AntPathRequestMatchers. Boot 2.7.18 manages Spring Security 5.7.11, not 5.8, and 5.7 only has requestMatchers(RequestMatcher...) (the String overloads arrive in 5.8). Explicit ant matchers keep exactly what antMatchers did, and also avoid Security 6.1's "ambiguous servlet" error for requestMatchers(String) when the Boot 3 step lands. No dependency version changes.
  • JwtTokenFilter is no longer a bean, so Boot stops also registering it as a servlet filter. It now takes UserRepository and JwtService through its constructor (was @Autowired fields), and the chain method creates it. With ServletContextInitializerBeans at DEBUG, the "Mapping filters" log line no longer lists jwtTokenFilter.

Verification (local, JDK 17)

  • ./gradlew clean spotlessCheck test: 68 tests in 20 classes, 0 failures/errors (same as baseline).
  • scripts/smoke/run.sh: 75 calls, "Responses match baseline". No accepted differences, baseline not regenerated. The auth, 401 and CORS cases are unchanged.
  • grep -rn "WebSecurityConfigurerAdapter\|antMatchers\|authorizeRequests" src finds nothing.
  • Snyk: see the security/snyk check below. No dependencies changed, so I expect the two advisories already known on Upgrade Spring Boot to 2.7.18 (DGS 5.6.2, MyBatis starter 2.3.2, sqlite-jdbc 3.49.1.0) #1252 and nothing new.

Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/06bb22914eb94bffa3da4e01a5720539
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/06bb22914eb94bffa3da4e01a5720539?variant=devin
Requested by: @joeloshea-cog


🟢 Devin Review found nothing to fix · View findings

Devin Review

Co-Authored-By: joel.oshea <joel.oshea@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Custom reviewers

  • 🧪 Test 2 reviewer: no findings · View
  • 🚩 TD Enterprise Architecture: no findings · View
  • 👁️ TD Information Security: no findings · View
  • 🧠 TD French Language (Bill 96): no findings · View
  • ⏱️ TD API Contracts: no findings · View

Devin Review

@devin-ai-integration
devin-ai-integration Bot merged commit a1a428e into devin/unt-5-spring-boot-2.7 Nov 17, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant