mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-08 11:32:47 +00:00
Removed deprecated class ObjectPostProcessor
Issue gh-17309 Signed-off-by: Soumik Sarker <ronodhirsoumik@gmail.com>
This commit is contained in:
parent
dff5780e09
commit
edb7a642c7
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -79,15 +79,6 @@ public abstract class AbstractConfiguredSecurityBuilder<O, B extends SecurityBui
|
|||||||
this(objectPostProcessor, false);
|
this(objectPostProcessor, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
protected AbstractConfiguredSecurityBuilder(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor) {
|
|
||||||
this(objectPostProcessor, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* Creates a new instance with the provided {@link ObjectPostProcessor}. This post
|
* Creates a new instance with the provided {@link ObjectPostProcessor}. This post
|
||||||
* processor must support Object since there are many types of objects that may be
|
* processor must support Object since there are many types of objects that may be
|
||||||
@ -103,18 +94,6 @@ public abstract class AbstractConfiguredSecurityBuilder<O, B extends SecurityBui
|
|||||||
this.allowConfigurersOfSameType = allowConfigurersOfSameType;
|
this.allowConfigurersOfSameType = allowConfigurersOfSameType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
protected AbstractConfiguredSecurityBuilder(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor,
|
|
||||||
boolean allowConfigurersOfSameType) {
|
|
||||||
Assert.notNull(objectPostProcessor, "objectPostProcessor cannot be null");
|
|
||||||
this.objectPostProcessor = objectPostProcessor;
|
|
||||||
this.allowConfigurersOfSameType = allowConfigurersOfSameType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Similar to {@link #build()} and {@link #getObject()} but checks the state to
|
* Similar to {@link #build()} and {@link #getObject()} but checks the state to
|
||||||
* determine if {@link #build()} needs to be called first.
|
* determine if {@link #build()} needs to be called first.
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2002-2013 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.springframework.security.config.annotation;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.Aware;
|
|
||||||
import org.springframework.beans.factory.DisposableBean;
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows initialization of Objects. Typically this is used to call the {@link Aware}
|
|
||||||
* methods, {@link InitializingBean#afterPropertiesSet()}, and ensure that
|
|
||||||
* {@link DisposableBean#destroy()} has been invoked.
|
|
||||||
*
|
|
||||||
* @param <T> the bound of the types of Objects this {@link ObjectPostProcessor} supports.
|
|
||||||
* @author Rob Winch
|
|
||||||
* @since 3.2
|
|
||||||
* @deprecated please use {@link org.springframework.security.config.ObjectPostProcessor}
|
|
||||||
* instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public interface ObjectPostProcessor<T> extends org.springframework.security.config.ObjectPostProcessor<T> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the object possibly returning a modified instance that should be used
|
|
||||||
* instead.
|
|
||||||
* @param object the object to initialize
|
|
||||||
* @return the initialized version of the object
|
|
||||||
*/
|
|
||||||
<O extends T> O postProcess(O object);
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -81,15 +81,6 @@ public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>>
|
|||||||
this.objectPostProcessor.addObjectPostProcessor(objectPostProcessor);
|
this.objectPostProcessor.addObjectPostProcessor(objectPostProcessor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
public void addObjectPostProcessor(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
|
|
||||||
this.objectPostProcessor.addObjectPostProcessor(objectPostProcessor);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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#apply(SecurityConfigurerAdapter)}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -73,15 +73,6 @@ public class AuthenticationManagerBuilder
|
|||||||
super(objectPostProcessor, true);
|
super(objectPostProcessor, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
public AuthenticationManagerBuilder(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor) {
|
|
||||||
super(objectPostProcessor, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows providing a parent {@link AuthenticationManager} that will be tried if this
|
* Allows providing a parent {@link AuthenticationManager} that will be tried if this
|
||||||
* {@link AuthenticationManager} was unable to attempt to authenticate the provided
|
* {@link AuthenticationManager} was unable to attempt to authenticate the provided
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -133,16 +133,6 @@ public class LdapAuthenticationProviderConfigurer<B extends ProviderManagerBuild
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
public LdapAuthenticationProviderConfigurer<B> withObjectPostProcessor(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
|
|
||||||
addObjectPostProcessor(objectPostProcessor);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the {@link LdapAuthoritiesPopulator} and defaults to
|
* Gets the {@link LdapAuthoritiesPopulator} and defaults to
|
||||||
* {@link DefaultLdapAuthoritiesPopulator}
|
* {@link DefaultLdapAuthoritiesPopulator}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -63,17 +63,6 @@ public abstract class AbstractDaoAuthenticationConfigurer<B extends ProviderMana
|
|||||||
return (C) this;
|
return (C) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public C withObjectPostProcessor(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
|
|
||||||
addObjectPostProcessor(objectPostProcessor);
|
|
||||||
return (C) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows specifying the {@link PasswordEncoder} to use with the
|
* Allows specifying the {@link PasswordEncoder} to use with the
|
||||||
* {@link DaoAuthenticationProvider}. The default is to use plain text.
|
* {@link DaoAuthenticationProvider}. The default is to use plain text.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -407,16 +407,6 @@ public class GlobalMethodSecurityConfiguration implements ImportAware, SmartInit
|
|||||||
this.objectPostProcessor = objectPostProcessor;
|
this.objectPostProcessor = objectPostProcessor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
@Autowired(required = false)
|
|
||||||
public void setObjectPostProcessor(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor) {
|
|
||||||
this.objectPostProcessor = objectPostProcessor;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
public void setMethodSecurityExpressionHandler(List<MethodSecurityExpressionHandler> handlers) {
|
public void setMethodSecurityExpressionHandler(List<MethodSecurityExpressionHandler> handlers) {
|
||||||
if (handlers.size() != 1) {
|
if (handlers.size() != 1) {
|
||||||
|
@ -194,23 +194,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||||||
this.requestMatcherConfigurer = new RequestMatcherConfigurer(context);
|
this.requestMatcherConfigurer = new RequestMatcherConfigurer(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public HttpSecurity(org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor,
|
|
||||||
AuthenticationManagerBuilder authenticationBuilder, Map<Class<?>, Object> sharedObjects) {
|
|
||||||
super(objectPostProcessor);
|
|
||||||
Assert.notNull(authenticationBuilder, "authenticationBuilder cannot be null");
|
|
||||||
setSharedObject(AuthenticationManagerBuilder.class, authenticationBuilder);
|
|
||||||
for (Map.Entry<Class<?>, Object> entry : sharedObjects.entrySet()) {
|
|
||||||
setSharedObject((Class<Object>) entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
ApplicationContext context = (ApplicationContext) sharedObjects.get(ApplicationContext.class);
|
|
||||||
this.requestMatcherConfigurer = new RequestMatcherConfigurer(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ApplicationContext getContext() {
|
private ApplicationContext getContext() {
|
||||||
return getSharedObject(ApplicationContext.class);
|
return getSharedObject(ApplicationContext.class);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -139,14 +139,6 @@ public final class WebSecurity extends AbstractConfiguredSecurityBuilder<Filter,
|
|||||||
super(objectPostProcessor);
|
super(objectPostProcessor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
public WebSecurity(org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor) {
|
|
||||||
super(objectPostProcessor);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Allows adding {@link RequestMatcher} instances that Spring Security should ignore.
|
* Allows adding {@link RequestMatcher} instances that Spring Security should ignore.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -180,17 +180,6 @@ class HttpSecurityConfiguration {
|
|||||||
this.defaultPasswordEncoder = defaultPasswordEncoder;
|
this.defaultPasswordEncoder = defaultPasswordEncoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
DefaultPasswordEncoderAuthenticationManagerBuilder(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor,
|
|
||||||
PasswordEncoder defaultPasswordEncoder) {
|
|
||||||
super(objectPostProcessor);
|
|
||||||
this.defaultPasswordEncoder = defaultPasswordEncoder;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InMemoryUserDetailsManagerConfigurer<AuthenticationManagerBuilder> inMemoryAuthentication()
|
public InMemoryUserDetailsManagerConfigurer<AuthenticationManagerBuilder> inMemoryAuthentication()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
@ -55,17 +55,6 @@ public abstract class AbstractHttpConfigurer<T extends AbstractHttpConfigurer<T,
|
|||||||
return (T) this;
|
return (T) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public T withObjectPostProcessor(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
|
|
||||||
addObjectPostProcessor(objectPostProcessor);
|
|
||||||
return (T) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected SecurityContextHolderStrategy getSecurityContextHolderStrategy() {
|
protected SecurityContextHolderStrategy getSecurityContextHolderStrategy() {
|
||||||
if (this.securityContextHolderStrategy != null) {
|
if (this.securityContextHolderStrategy != null) {
|
||||||
return this.securityContextHolderStrategy;
|
return this.securityContextHolderStrategy;
|
||||||
|
@ -191,16 +191,6 @@ public final class AuthorizeHttpRequestsConfigurer<H extends HttpSecurityBuilder
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
public AuthorizationManagerRequestMatcherRegistry withObjectPostProcessor(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
|
|
||||||
addObjectPostProcessor(objectPostProcessor);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether all dispatcher types should be filtered.
|
* Sets whether all dispatcher types should be filtered.
|
||||||
* @param shouldFilter should filter all dispatcher types. Default is {@code true}
|
* @param shouldFilter should filter all dispatcher types. Default is {@code true}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -172,16 +172,6 @@ public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>>
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
public ChannelRequestMatcherRegistry withObjectPostProcessor(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
|
|
||||||
addObjectPostProcessor(objectPostProcessor);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@link ChannelProcessor} instances to use in
|
* Sets the {@link ChannelProcessor} instances to use in
|
||||||
* {@link ChannelDecisionManagerImpl}
|
* {@link ChannelDecisionManagerImpl}
|
||||||
|
@ -240,16 +240,6 @@ public final class ExpressionUrlAuthorizationConfigurer<H extends HttpSecurityBu
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
public ExpressionInterceptUrlRegistry withObjectPostProcessor(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
|
|
||||||
addObjectPostProcessor(objectPostProcessor);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public H and() {
|
public H and() {
|
||||||
return ExpressionUrlAuthorizationConfigurer.this.getBuilder();
|
return ExpressionUrlAuthorizationConfigurer.this.getBuilder();
|
||||||
}
|
}
|
||||||
|
@ -117,14 +117,6 @@ public final class UrlAuthorizationConfigurer<H extends HttpSecurityBuilder<H>>
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated(since = "6.4", forRemoval = true)
|
|
||||||
@Override
|
|
||||||
public UrlAuthorizationConfigurer<H> withObjectPostProcessor(
|
|
||||||
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
|
|
||||||
addObjectPostProcessor(objectPostProcessor);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the default {@link AccessDecisionVoter} instances used if an
|
* Creates the default {@link AccessDecisionVoter} instances used if an
|
||||||
* {@link AccessDecisionManager} was not specified.
|
* {@link AccessDecisionManager} was not specified.
|
||||||
|
@ -22,6 +22,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.security.config.ObjectPostProcessor;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThatObject;
|
import static org.assertj.core.api.Assertions.assertThatObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user