|
|
@@ -90,6 +90,22 @@ public class WebFluxUserRequestInfoFilter implements GlobalFilter {
|
|
|
String urlTenant = queryParams.get("tenant");
|
|
|
String urlOrg = queryParams.get("org");
|
|
|
if (!Strings.isNullOrEmpty(wxAppletId)) {
|
|
|
+ String tokenValid = exchange.getRequest().getHeaders().getFirst("Authorization");
|
|
|
+ if (Strings.isNullOrEmpty(tokenValid)) {
|
|
|
+ // 三级等保,若小程序请求不带token,则走该校验方法
|
|
|
+ if (isWxAppletRequest(exchange.getRequest()) && isEncryptedRequest(exchange.getRequest())) {
|
|
|
+
|
|
|
+ }else{
|
|
|
+ String pathUrl = String.valueOf(exchange.getRequest().getPath());
|
|
|
+ // 如果匹配到完全放开的路径,则直接放行
|
|
|
+ boolean anonymousPathCheck = this.anonymousPathProperties.checkAnonymousPath(pathUrl);
|
|
|
+ if(!anonymousPathCheck){
|
|
|
+ exchange.getResponse().setStatusCode(HttpStatus.FORBIDDEN);
|
|
|
+ return exchange.getResponse().setComplete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// search for userid
|
|
|
String tokenUrl = keyCloakServiceUrl + "realms/" + realm + "/protocol/openid-connect/token";
|
|
|
String token = getToken(tokenUrl, clientId, clientSecret);
|
|
|
@@ -159,7 +175,6 @@ public class WebFluxUserRequestInfoFilter implements GlobalFilter {
|
|
|
try {
|
|
|
String token = exchange.getRequest().getHeaders().getFirst("Authorization");
|
|
|
if (Strings.isNullOrEmpty(token)) {
|
|
|
-
|
|
|
String pathUrl = String.valueOf(exchange.getRequest().getPath());
|
|
|
// 如果匹配到完全放开的路径,则直接放行
|
|
|
boolean anonymousPathCheck = this.anonymousPathProperties.checkAnonymousPath(pathUrl);
|