|
@ -208,11 +208,19 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpA |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
private boolean needAuth(String requestUri) { |
|
|
private boolean needAuth(String requestUri) { |
|
|
|
|
|
// 优先判断白名单,在白名单中的就直接放行
|
|
|
|
|
|
for (String url : cpProperty.getUrlWhiteList()) { |
|
|
|
|
|
if (antPathMatcher.match(url, requestUri)) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for (String url : cpProperty.getSwaggerUrls()) { |
|
|
for (String url : cpProperty.getSwaggerUrls()) { |
|
|
if (antPathMatcher.match(url, requestUri)) { |
|
|
if (antPathMatcher.match(url, requestUri)) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for (String url : cpProperty.getUrls()) { |
|
|
for (String url : cpProperty.getUrls()) { |
|
|
if (antPathMatcher.match(url, requestUri)) { |
|
|
if (antPathMatcher.match(url, requestUri)) { |
|
|
return true; |
|
|
return true; |
|
|