白名单验证添加服务就绪检测、prometheus检测

This commit is contained in:
付庆吉
2022-03-01 10:18:59 +08:00
parent 8059e0e2ae
commit d8c799987f

View File

@ -102,7 +102,9 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
*/
private boolean checkWhiteList(String method, String methodType) {
return Optional.ofNullable(allows.getApis()).orElseGet(ArrayList::new)
.parallelStream().anyMatch(reg -> Pattern.compile(reg).matcher(methodType + "." + method).matches());
.parallelStream().anyMatch(reg -> Pattern.compile(reg).matcher(methodType + "." + method).matches())
|| method.contains("actuator/health") //服务的就绪检测
|| method.contains("actuator/prometheus"); //prometheus检测
}