Skip to content

Commit 93a1e83

Browse files
committed
feat: 添加网关黑白名单开关配置
1 parent a62e54d commit 93a1e83

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/filter/access/BlackWhiteListFilter.java

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public int getOrder() {
3737

3838
@Override
3939
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
40+
if (!blackWhiteListProperties.isEnable()) {
41+
return chain.filter(exchange);
42+
}
43+
4044
String url = exchange.getRequest().getURI().getPath();
4145
String ipAddress = exchange.getRequest().getRemoteAddress().getAddress().getHostAddress();
4246

application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/properties/BlackWhiteListProperties.java

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
@ToString
2020
public class BlackWhiteListProperties {
2121

22+
/**
23+
* 黑白名单是否可用
24+
*/
25+
private boolean enable;
2226
/**
2327
* 黑名单<url, 黑名单集合>
2428
*/

0 commit comments

Comments
 (0)