|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2020 the original author or authors. |
| 2 | + * Copyright 2002-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
24 | 24 |
|
25 | 25 | import org.springframework.beans.factory.BeanClassLoaderAware;
|
26 | 26 | import org.springframework.beans.factory.annotation.Autowired;
|
27 |
| -import org.springframework.beans.factory.annotation.Value; |
28 | 27 | import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
29 | 28 | import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
30 | 29 | import org.springframework.context.annotation.Bean;
|
@@ -143,19 +142,20 @@ public WebInvocationPrivilegeEvaluator privilegeEvaluator() {
|
143 | 142 | * instances used to create the web configuration.
|
144 | 143 | * @param objectPostProcessor the {@link ObjectPostProcessor} used to create a
|
145 | 144 | * {@link WebSecurity} instance
|
146 |
| - * @param webSecurityConfigurers the |
| 145 | + * @param beanFactory the bean factory to use to retrieve the relevant |
147 | 146 | * {@code <SecurityConfigurer<FilterChainProxy, WebSecurityBuilder>} instances used to
|
148 | 147 | * create the web configuration
|
149 | 148 | * @throws Exception
|
150 | 149 | */
|
151 | 150 | @Autowired(required = false)
|
152 | 151 | public void setFilterChainProxySecurityConfigurer(ObjectPostProcessor<Object> objectPostProcessor,
|
153 |
| - @Value("#{@autowiredWebSecurityConfigurersIgnoreParents.getWebSecurityConfigurers()}") List<SecurityConfigurer<Filter, WebSecurity>> webSecurityConfigurers) |
154 |
| - throws Exception { |
| 152 | + ConfigurableListableBeanFactory beanFactory) throws Exception { |
155 | 153 | this.webSecurity = objectPostProcessor.postProcess(new WebSecurity(objectPostProcessor));
|
156 | 154 | if (this.debugEnabled != null) {
|
157 | 155 | this.webSecurity.debug(this.debugEnabled);
|
158 | 156 | }
|
| 157 | + List<SecurityConfigurer<Filter, WebSecurity>> webSecurityConfigurers = new AutowiredWebSecurityConfigurersIgnoreParents( |
| 158 | + beanFactory).getWebSecurityConfigurers(); |
159 | 159 | webSecurityConfigurers.sort(AnnotationAwareOrderComparator.INSTANCE);
|
160 | 160 | Integer previousOrder = null;
|
161 | 161 | Object previousConfig = null;
|
@@ -189,12 +189,6 @@ public static BeanFactoryPostProcessor conversionServicePostProcessor() {
|
189 | 189 | return new RsaKeyConversionServicePostProcessor();
|
190 | 190 | }
|
191 | 191 |
|
192 |
| - @Bean |
193 |
| - public static AutowiredWebSecurityConfigurersIgnoreParents autowiredWebSecurityConfigurersIgnoreParents( |
194 |
| - ConfigurableListableBeanFactory beanFactory) { |
195 |
| - return new AutowiredWebSecurityConfigurersIgnoreParents(beanFactory); |
196 |
| - } |
197 |
| - |
198 | 192 | @Override
|
199 | 193 | public void setImportMetadata(AnnotationMetadata importMetadata) {
|
200 | 194 | Map<String, Object> enableWebSecurityAttrMap = importMetadata
|
|
0 commit comments