Add AuthorizationWebFilterTests

This commit is contained in:
Rob Winch
2017-10-27 20:07:36 -05:00
parent b471dd1c54
commit e63c53e267
2 changed files with 150 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ public class AuthorizationWebFilter implements WebFilter {
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
return ReactiveSecurityContextHolder.getContext()
.map(SecurityContext::getAuthentication)
.as( authentication -> this.accessDecisionManager.verify(authentication, exchange))
.as(authentication -> this.accessDecisionManager.verify(authentication, exchange))
.switchIfEmpty(chain.filter(exchange));
}
}