Skip to content

Commit 1a7b1fc

Browse files
committed
Remove HttpSecurity and() DSL Methods
This commit removes all and() methods that have been deprecated in the HttpSecurity DSL with the exception of featurePolicy, which will be removed when that feature is removed. Note that since featurePolicy does not have a lambda equivalent, the and support needs to remain for the moment. Issue gh-13067
1 parent 45a1447 commit 1a7b1fc

16 files changed

+198
-2454
lines changed

config/src/main/java/org/springframework/security/config/annotation/SecurityConfigurerAdapter.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@ public void init(B builder) throws Exception {
5050
public void configure(B builder) throws Exception {
5151
}
5252

53-
/**
54-
* Return the {@link SecurityBuilder} when done using the {@link SecurityConfigurer}.
55-
* This is useful for method chaining.
56-
* @return the {@link SecurityBuilder} for further customizations
57-
* @deprecated For removal in 7.0. Use the lambda based configuration instead.
58-
*/
59-
@Deprecated(since = "6.1", forRemoval = true)
60-
public B and() {
61-
return getBuilder();
62-
}
63-
6453
/**
6554
* Gets the {@link SecurityBuilder}. Cannot be null.
6655
* @return the {@link SecurityBuilder}

config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ public LdapAuthenticationProviderConfigurer<B> userSearchFilter(String userSearc
386386
return this;
387387
}
388388

389+
public B and() {
390+
return getBuilder();
391+
}
392+
389393
@Override
390394
public void configure(B builder) throws Exception {
391395
LdapAuthenticationProvider provider = postProcess(build());

config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/provisioning/InMemoryUserDetailsManagerConfigurer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@ public InMemoryUserDetailsManagerConfigurer() {
4141
super(new InMemoryUserDetailsManager(new ArrayList<>()));
4242
}
4343

44+
public B and() {
45+
return getBuilder();
46+
}
47+
4448
}

0 commit comments

Comments
 (0)