add
This commit is contained in:
@ -14,6 +14,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
@ -39,14 +40,19 @@ public class AuthenticationCoreFilter extends OncePerRequestFilter {
|
||||
private final AuthConfigProperties authConfigProperties;
|
||||
private final AuthConfigApiService authConfigApiService;
|
||||
|
||||
private final AntPathMatcher MATCH = new AntPathMatcher();
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
FilterChain chain) throws ServletException, IOException {
|
||||
|
||||
// 白名单 放行
|
||||
if (authConfigProperties.getWhitelist().contains(request.getRequestURI())) {
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
for (String uri : authConfigProperties.getWhitelist()) {
|
||||
if (MATCH.match(uri,request.getRequestURI())) {
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
String authToken = TokenUtil.getToken(request, false);
|
||||
|
Reference in New Issue
Block a user