spring-projects / spring-projects/spring-security
Consider redesigning the configuration model
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
We should consider redesigning the configuration model with the main goal of simplifying usage.
The new configuration model must solve the ordering issues that exist in the current configuration model, specifically related to Filter ordering and Authorization RequestMatcher ordering.
We should also look at decoupling SecurityConfigurer references. For example, ExceptionHandlingConfigurer is referenced in multiple SecurityConfigurer's, which has resulted is various bugs overtime when minor changes are applied. However, we should also consider not using SecurityConfigurer and SecurityBuilder in the new model.
We should also explore a different approach for component configuration. Instead of using the HttpSecurity DSL, we could provide a more direct way of configuring through the use of a Customizer<SecurityConfigurer> @Bean. For example, if an application needs to customize formLogin(), it would register a Customizer<FormLoginConfigurer> @Bean. NOTE: The Customizer may receive a different type of "configuration" object instead of a SecurityConfigurer, depending how the new configuration model evolves.
Related gh-13266, gh-13057
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current Filter ordering and Authorization RequestMatcher ordering, then trace the relationships among SecurityConfigurer, SecurityBuilder, ExceptionHandlingConfigurer, and HttpSecurity. Compare that model with the proposed Customizer bean approach; done would require a concrete configuration design that resolves the ordering and coupling problems described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authorization, backend-api-design, security
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100