Use with Instead of Apply
	
		
			
	
		
	
	
		
			
				
	
				CodeQL Advanced / codeql-analysis-call (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Build (17, ubuntu-latest) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Build (17, windows-latest) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Test Against Snapshots (17, 17) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Test Against Snapshots (21-ea, 21) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Deploy Artifacts (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Deploy Docs (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Deploy Schema (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Perform Release (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Send Notification (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				Deploy Docs / build (push) Waiting to run
				
					Details
				
			
		
	
				
					
				
			
				
	
				CodeQL Advanced / codeql-analysis-call (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Build (17, ubuntu-latest) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Build (17, windows-latest) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Test Against Snapshots (17, 17) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Test Against Snapshots (21-ea, 21) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Deploy Artifacts (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Deploy Docs (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Deploy Schema (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Perform Release (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Send Notification (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				Deploy Docs / build (push) Waiting to run
				
					Details
				
			
		
	Issue gh-13204
This commit is contained in:
		
							parent
							
								
									728b5224cb
								
							
						
					
					
						commit
						7f8b9c895f
					
				|  | @ -21,6 +21,7 @@ import java.util.List; | ||||||
| 
 | 
 | ||||||
| import org.springframework.core.GenericTypeResolver; | import org.springframework.core.GenericTypeResolver; | ||||||
| import org.springframework.core.annotation.AnnotationAwareOrderComparator; | import org.springframework.core.annotation.AnnotationAwareOrderComparator; | ||||||
|  | import org.springframework.security.config.Customizer; | ||||||
| import org.springframework.security.config.ObjectPostProcessor; | import org.springframework.security.config.ObjectPostProcessor; | ||||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||||
| 
 | 
 | ||||||
|  | @ -83,7 +84,7 @@ public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>> | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
| 	 * Sets the {@link SecurityBuilder} to be used. This is automatically set when using | 	 * Sets the {@link SecurityBuilder} to be used. This is automatically set when using | ||||||
| 	 * {@link AbstractConfiguredSecurityBuilder#apply(SecurityConfigurerAdapter)} | 	 * {@link AbstractConfiguredSecurityBuilder#with(SecurityConfigurerAdapter, Customizer)} | ||||||
| 	 * @param builder the {@link SecurityBuilder} to set | 	 * @param builder the {@link SecurityBuilder} to set | ||||||
| 	 */ | 	 */ | ||||||
| 	public void setBuilder(B builder) { | 	public void setBuilder(B builder) { | ||||||
|  |  | ||||||
|  | @ -195,7 +195,9 @@ public class AuthenticationManagerBuilder | ||||||
| 	 * @throws Exception if an error occurs when adding the LDAP authentication | 	 * @throws Exception if an error occurs when adding the LDAP authentication | ||||||
| 	 */ | 	 */ | ||||||
| 	public LdapAuthenticationProviderConfigurer<AuthenticationManagerBuilder> ldapAuthentication() throws Exception { | 	public LdapAuthenticationProviderConfigurer<AuthenticationManagerBuilder> ldapAuthentication() throws Exception { | ||||||
| 		return apply(new LdapAuthenticationProviderConfigurer<>()); | 		LdapAuthenticationProviderConfigurer<AuthenticationManagerBuilder> ldap = new LdapAuthenticationProviderConfigurer<>(); | ||||||
|  | 		with(ldap); | ||||||
|  | 		return ldap; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/** | 	/** | ||||||
|  | @ -277,7 +279,8 @@ public class AuthenticationManagerBuilder | ||||||
| 	private <C extends UserDetailsAwareConfigurer<AuthenticationManagerBuilder, ? extends UserDetailsService>> C apply( | 	private <C extends UserDetailsAwareConfigurer<AuthenticationManagerBuilder, ? extends UserDetailsService>> C apply( | ||||||
| 			C configurer) throws Exception { | 			C configurer) throws Exception { | ||||||
| 		this.defaultUserDetailsService = configurer.getUserDetailsService(); | 		this.defaultUserDetailsService = configurer.getUserDetailsService(); | ||||||
| 		return super.apply(configurer); | 		with(configurer); | ||||||
|  | 		return configurer; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -2106,7 +2106,8 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul | ||||||
| 		if (existingConfig != null) { | 		if (existingConfig != null) { | ||||||
| 			return existingConfig; | 			return existingConfig; | ||||||
| 		} | 		} | ||||||
| 		return apply(configurer); | 		with(configurer); | ||||||
|  | 		return configurer; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	private ObjectPostProcessor<AuthenticationManager> getAuthenticationManagerPostProcessor() { | 	private ObjectPostProcessor<AuthenticationManager> getAuthenticationManagerPostProcessor() { | ||||||
|  |  | ||||||
|  | @ -123,7 +123,7 @@ class HttpSecurityConfiguration { | ||||||
| 			.requestCache(withDefaults()) | 			.requestCache(withDefaults()) | ||||||
| 			.anonymous(withDefaults()) | 			.anonymous(withDefaults()) | ||||||
| 			.servletApi(withDefaults()) | 			.servletApi(withDefaults()) | ||||||
| 			.apply(new DefaultLoginPageConfigurer<>()); | 			.with(new DefaultLoginPageConfigurer<>()); | ||||||
| 		http.logout(withDefaults()); | 		http.logout(withDefaults()); | ||||||
| 		// @formatter:on | 		// @formatter:on | ||||||
| 		applyCorsIfAvailable(http); | 		applyCorsIfAvailable(http); | ||||||
|  | @ -153,7 +153,7 @@ class HttpSecurityConfiguration { | ||||||
| 		List<AbstractHttpConfigurer> defaultHttpConfigurers = SpringFactoriesLoader | 		List<AbstractHttpConfigurer> defaultHttpConfigurers = SpringFactoriesLoader | ||||||
| 			.loadFactories(AbstractHttpConfigurer.class, classLoader); | 			.loadFactories(AbstractHttpConfigurer.class, classLoader); | ||||||
| 		for (AbstractHttpConfigurer configurer : defaultHttpConfigurers) { | 		for (AbstractHttpConfigurer configurer : defaultHttpConfigurers) { | ||||||
| 			http.apply(configurer); | 			http.with(configurer); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -106,7 +106,8 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu | ||||||
|         configurer: C, |         configurer: C, | ||||||
|         configuration: C.() -> Unit = { } |         configuration: C.() -> Unit = { } | ||||||
|     ): C { |     ): C { | ||||||
|         return this.http.apply(configurer).apply(configuration) |         this.http.with(configurer, configuration) | ||||||
|  |         return configurer | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue