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 with() method to apply SecurityConfigurerAdapter #13432

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

marcusdacoregio
Copy link
Contributor

@marcusdacoregio marcusdacoregio commented Jun 27, 2023

This method is intended to replace .apply() because it will not be possible to chain configurations when .and() gets removed.
This will allow us to deprecate .apply() in favor of .with()

The idea behind adding the Customizer as a second argument is to allow users to do:

http.with(new MyCustomDsl(), (dsl) -> dsl.disable())

First, we add the SecurityBuilder into the MyCustomDsl and then we can apply configurations that depend on the builder, like .disable(). This test makes sure that works.

Pretty much close to what we had before with .apply():

http.apply(new MyCustomDsl()).disable()
  .and()
// ...

Closes gh-13204

@marcusdacoregio marcusdacoregio added in: config An issue in spring-security-config type: enhancement A general enhancement labels Jun 27, 2023
@marcusdacoregio marcusdacoregio added this to the 6.2.0-M1 milestone Jun 27, 2023
@marcusdacoregio marcusdacoregio self-assigned this Jun 27, 2023
This method is intended to replace .apply() because it will not be possible to chain configurations when .and() gets removed

Closes spring-projectsgh-13204
@marcusdacoregio marcusdacoregio merged commit 1ff5eb6 into spring-projects:main Jun 29, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: config An issue in spring-security-config type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add with() method to apply Custom DSLs returning the builder
1 participant