Browse Source

Merge branch 'dev_gateway_whitelist' into dev_temp

master
wxz 5 years ago
parent
commit
1173d99d8a
  1. 6
      epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java
  2. 5
      epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java
  3. 4
      epmet-gateway/src/main/resources/bootstrap.yml
  4. 2
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java

6
epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java

@ -131,6 +131,12 @@ public class InternalAuthProcessor extends AuthProcessor {
* @return
*/
private boolean needAuth(String requestUri) {
for (String url : cpProperty.getInternalAuthUrlsWhiteList()) {
if (antPathMatcher.match(url, requestUri)) {
return false;
}
}
for (String url : cpProperty.getInternalAuthUrls()) {
if (antPathMatcher.match(url, requestUri)) {
return true;

5
epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java

@ -22,6 +22,11 @@ public class CpProperty {
*/
private List<String> internalAuthUrls;
/**
* 内部认证url白名单
*/
private List<String> internalAuthUrlsWhiteList;
/**
* 对外部应用开放的url列表
*/

4
epmet-gateway/src/main/resources/bootstrap.yml

@ -439,6 +439,10 @@ epmet:
- /resi/home/**
- /data/report/**
# 内部认证url白名单(在白名单中的,就不会再校验登录了)
internalAuthUrlsWhiteList:
- /epmetuser/customerstaff/customerlist
# 外部应用认证,使用AccessToken等头进行认证
externalOpenUrls:
- /data/report/**

2
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java

@ -365,7 +365,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService {
StringBuilder govKey = new StringBuilder(customerId).append(":").append(WxmpMessageConstant.GOV_REDIS);
authorizerRefreshToken = new HashMap<>();
try {
authorizerRefreshToken = wxmpMessageRedis.getAuthorizerRefreshToken(resiKey.toString());
authorizerRefreshToken = wxmpMessageRedis.getAuthorizerRefreshToken(govKey.toString());
} catch (Exception e) {
errorMsg = e.getMessage();
}

Loading…
Cancel
Save