Skip to content

Commit

Permalink
feat: 添加网关黑白名单开关配置
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyQing committed Mar 27, 2024
1 parent a62e54d commit 93a1e83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public int getOrder() {

@Override
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
if (!blackWhiteListProperties.isEnable()) {
return chain.filter(exchange);
}

String url = exchange.getRequest().getURI().getPath();
String ipAddress = exchange.getRequest().getRemoteAddress().getAddress().getHostAddress();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
@ToString
public class BlackWhiteListProperties {

/**
* 黑白名单是否可用
*/
private boolean enable;
/**
* 黑名单<url, 黑名单集合>
*/
Expand Down

0 comments on commit 93a1e83

Please sign in to comment.