Skip to content

Commit ee9a887

Browse files
committed
Fix Package Tangle
Move ObjectPostProcessor to be alongside Customizer, another functional interface for describing Spring Security object configuration.
1 parent 24a7ad7 commit ee9a887

File tree

63 files changed

+117
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+117
-67
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2002-2013 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.security.config;
18+
19+
import org.springframework.beans.factory.Aware;
20+
import org.springframework.beans.factory.DisposableBean;
21+
import org.springframework.beans.factory.InitializingBean;
22+
23+
/**
24+
* Allows initialization of Objects. Typically this is used to call the {@link Aware}
25+
* methods, {@link InitializingBean#afterPropertiesSet()}, and ensure that
26+
* {@link DisposableBean#destroy()} has been invoked.
27+
*
28+
* @param <T> the bound of the types of Objects this {@link ObjectPostProcessor} supports.
29+
* @author Rob Winch
30+
* @since 3.2
31+
*/
32+
public interface ObjectPostProcessor<T> {
33+
34+
static <S> ObjectPostProcessor<S> identity() {
35+
return new ObjectPostProcessor<>() {
36+
@Override
37+
public <O extends S> O postProcess(O object) {
38+
return object;
39+
}
40+
};
41+
}
42+
43+
/**
44+
* Initialize the object possibly returning a modified instance that should be used
45+
* instead.
46+
* @param object the object to initialize
47+
* @return the initialized version of the object
48+
*/
49+
<O extends T> O postProcess(O object);
50+
51+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.commons.logging.LogFactory;
2929

3030
import org.springframework.security.config.Customizer;
31+
import org.springframework.security.config.ObjectPostProcessor;
3132
import org.springframework.security.config.annotation.web.builders.WebSecurity;
3233
import org.springframework.util.Assert;
3334
import org.springframework.web.filter.DelegatingFilterProxy;

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,11 @@
2828
* @param <T> the bound of the types of Objects this {@link ObjectPostProcessor} supports.
2929
* @author Rob Winch
3030
* @since 3.2
31+
* @deprecated please use {@link org.springframework.security.config.ObjectPostProcessor}
32+
* instead
3133
*/
32-
public interface ObjectPostProcessor<T> {
33-
34-
static <S> ObjectPostProcessor<S> identity() {
35-
return new ObjectPostProcessor<>() {
36-
@Override
37-
public <O extends S> O postProcess(O object) {
38-
return object;
39-
}
40-
};
41-
}
34+
@Deprecated
35+
public interface ObjectPostProcessor<T> extends org.springframework.security.config.ObjectPostProcessor<T> {
4236

4337
/**
4438
* Initialize the object possibly returning a modified instance that should be used

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.springframework.core.GenericTypeResolver;
2323
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
24+
import org.springframework.security.config.ObjectPostProcessor;
2425
import org.springframework.util.Assert;
2526

2627
/**

config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import org.springframework.security.authentication.AuthenticationManager;
2727
import org.springframework.security.authentication.AuthenticationProvider;
2828
import org.springframework.security.authentication.ProviderManager;
29+
import org.springframework.security.config.ObjectPostProcessor;
2930
import org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder;
30-
import org.springframework.security.config.annotation.ObjectPostProcessor;
3131
import org.springframework.security.config.annotation.SecurityBuilder;
3232
import org.springframework.security.config.annotation.SecurityConfigurer;
3333
import org.springframework.security.config.annotation.authentication.ProviderManagerBuilder;

config/src/main/java/org/springframework/security/config/annotation/authentication/configuration/AuthenticationConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import org.springframework.security.authentication.AuthenticationEventPublisher;
4040
import org.springframework.security.authentication.AuthenticationManager;
4141
import org.springframework.security.authentication.DefaultAuthenticationEventPublisher;
42-
import org.springframework.security.config.annotation.ObjectPostProcessor;
42+
import org.springframework.security.config.ObjectPostProcessor;
4343
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
4444
import org.springframework.security.config.annotation.authentication.configurers.provisioning.InMemoryUserDetailsManagerConfigurer;
4545
import org.springframework.security.config.annotation.authentication.configurers.provisioning.JdbcUserDetailsManagerConfigurer;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.springframework.ldap.core.support.BaseLdapPathContextSource;
2323
import org.springframework.security.authentication.AuthenticationManager;
2424
import org.springframework.security.authentication.AuthenticationProvider;
25-
import org.springframework.security.config.annotation.ObjectPostProcessor;
25+
import org.springframework.security.config.ObjectPostProcessor;
2626
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
2727
import org.springframework.security.config.annotation.authentication.ProviderManagerBuilder;
2828
import org.springframework.security.config.annotation.web.configurers.ChannelSecurityConfigurer;

config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/userdetails/AbstractDaoAuthenticationConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package org.springframework.security.config.annotation.authentication.configurers.userdetails;
1818

1919
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
20-
import org.springframework.security.config.annotation.ObjectPostProcessor;
20+
import org.springframework.security.config.ObjectPostProcessor;
2121
import org.springframework.security.config.annotation.SecurityBuilder;
2222
import org.springframework.security.config.annotation.authentication.ProviderManagerBuilder;
2323
import org.springframework.security.core.userdetails.UserDetailsPasswordService;

config/src/main/java/org/springframework/security/config/annotation/configuration/AutowireBeanFactoryObjectPostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import org.springframework.beans.factory.SmartInitializingSingleton;
3131
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
3232
import org.springframework.core.NativeDetector;
33-
import org.springframework.security.config.annotation.ObjectPostProcessor;
33+
import org.springframework.security.config.ObjectPostProcessor;
3434
import org.springframework.util.Assert;
3535

3636
/**

config/src/main/java/org/springframework/security/config/annotation/configuration/ObjectPostProcessorConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.springframework.context.annotation.Bean;
2222
import org.springframework.context.annotation.Configuration;
2323
import org.springframework.context.annotation.Role;
24-
import org.springframework.security.config.annotation.ObjectPostProcessor;
24+
import org.springframework.security.config.ObjectPostProcessor;
2525
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
2626
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
2727

0 commit comments

Comments
 (0)