spring-projects / spring-projects/spring-security

Allow all HttpSecurity DSL methods to apply Customizer.withDefaults() by default

Open
#17,497 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: enhancement
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Expected Behavior

Developers should be able to enable default security configurations using a fluent, no-argument DSL in the SecurityFilterChain lambda DSL.

http
  .csrf()
  .formLogin()
  .httpBasic()
  .logout();

Current Behavior


http
  .csrf(Customizer.withDefaults())
  .formLogin(Customizer.withDefaults())
  .httpBasic(Customizer.withDefaults())
  .logout(Customizer.withDefaults());

I see that there are methods already reserved with no-argument which are needed for configuration without using lambdas . That said, there’s room to make it work without withDefaults(). As a big project there are
definitely various aspect to things and I’d love to hear more about this and the possibility of making this change.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the HttpSecurity DSL methods named in the issue and reviewing their existing no-argument overloads and Customizer.withDefaults() variants. Compare the expected fluent calls with the current calls, then determine whether all four methods can support the requested behavior without disrupting existing configuration APIs; done means the no-argument examples work consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend-api-design, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.