PrePostAdviceMethodInterceptor->PrePostAdviceReactiveMethodInterceptor

Issue gh-4615
This commit is contained in:
Rob Winch 2017-10-10 14:21:33 -05:00
parent d0de8d40dd
commit e99e2a9f09
2 changed files with 5 additions and 6 deletions

View File

@ -26,7 +26,7 @@ import org.springframework.security.access.expression.method.*;
import org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor; import org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor;
import org.springframework.security.access.method.AbstractMethodSecurityMetadataSource; import org.springframework.security.access.method.AbstractMethodSecurityMetadataSource;
import org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource; import org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource;
import org.springframework.security.access.method.PrePostAdviceMethodInterceptor; import org.springframework.security.access.method.PrePostAdviceReactiveMethodInterceptor;
import org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource; import org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource;
import java.util.Arrays; import java.util.Arrays;
@ -58,14 +58,14 @@ class ReactiveMethodSecurityConfiguration implements ImportAware {
} }
@Bean @Bean
public PrePostAdviceMethodInterceptor securityMethodInterceptor(AbstractMethodSecurityMetadataSource source, MethodSecurityExpressionHandler handler) { public PrePostAdviceReactiveMethodInterceptor securityMethodInterceptor(AbstractMethodSecurityMetadataSource source, MethodSecurityExpressionHandler handler) {
ExpressionBasedPostInvocationAdvice postAdvice = new ExpressionBasedPostInvocationAdvice( ExpressionBasedPostInvocationAdvice postAdvice = new ExpressionBasedPostInvocationAdvice(
handler); handler);
ExpressionBasedPreInvocationAdvice preAdvice = new ExpressionBasedPreInvocationAdvice(); ExpressionBasedPreInvocationAdvice preAdvice = new ExpressionBasedPreInvocationAdvice();
preAdvice.setExpressionHandler(handler); preAdvice.setExpressionHandler(handler);
PrePostAdviceMethodInterceptor result = new PrePostAdviceMethodInterceptor(source); PrePostAdviceReactiveMethodInterceptor result = new PrePostAdviceReactiveMethodInterceptor(source);
result.setPostAdvice(postAdvice); result.setPostAdvice(postAdvice);
result.setPreAdvice(preAdvice); result.setPreAdvice(preAdvice);
return result; return result;

View File

@ -25,7 +25,6 @@ import org.springframework.security.access.expression.method.DefaultMethodSecuri
import org.springframework.security.access.expression.method.ExpressionBasedPostInvocationAdvice; import org.springframework.security.access.expression.method.ExpressionBasedPostInvocationAdvice;
import org.springframework.security.access.expression.method.ExpressionBasedPreInvocationAdvice; import org.springframework.security.access.expression.method.ExpressionBasedPreInvocationAdvice;
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler;
import org.springframework.security.access.method.MethodSecurityMetadataSource;
import org.springframework.security.access.prepost.PostInvocationAttribute; import org.springframework.security.access.prepost.PostInvocationAttribute;
import org.springframework.security.access.prepost.PostInvocationAuthorizationAdvice; import org.springframework.security.access.prepost.PostInvocationAuthorizationAdvice;
import org.springframework.security.access.prepost.PreInvocationAttribute; import org.springframework.security.access.prepost.PreInvocationAttribute;
@ -46,7 +45,7 @@ import java.util.Collection;
* @author Rob Winch * @author Rob Winch
* @since 5.0 * @since 5.0
*/ */
public class PrePostAdviceMethodInterceptor implements MethodInterceptor { public class PrePostAdviceReactiveMethodInterceptor implements MethodInterceptor {
private Authentication anonymous = new AnonymousAuthenticationToken("key", "anonymous", private Authentication anonymous = new AnonymousAuthenticationToken("key", "anonymous",
AuthorityUtils.createAuthorityList("ROLE_ANONYMOUS")); AuthorityUtils.createAuthorityList("ROLE_ANONYMOUS"));
@ -56,7 +55,7 @@ public class PrePostAdviceMethodInterceptor implements MethodInterceptor {
private PreInvocationAuthorizationAdvice preAdvice; private PreInvocationAuthorizationAdvice preAdvice;
public PrePostAdviceMethodInterceptor(MethodSecurityMetadataSource attributeSource) { public PrePostAdviceReactiveMethodInterceptor(MethodSecurityMetadataSource attributeSource) {
this.attributeSource = attributeSource; this.attributeSource = attributeSource;
MethodSecurityExpressionHandler handler = new DefaultMethodSecurityExpressionHandler(); MethodSecurityExpressionHandler handler = new DefaultMethodSecurityExpressionHandler();