黑名单/白名单IP拦截器
2.1.0开始支持
黑名单/白名单IP拦截器主要处理接口的访问权限,进一步提升系统的安全性。
- 黑名单模式:可以设置黑名单ip,黑名单ip将不能访问系统
- 白名单模式:通过设置白名单ip,系统只允许设置的ip访问
拦截地址配置
enabled
:是否启用拦截器,默认不启用false
type
:类型:BLACKLIST
黑名单模式,WHITELIST
白名单模式。默认黑名单模式ips
:ip地址
wueasy:
gateway:
interceptor:
ip:
enabled: true #是否启用,默认false
type: BLACKLIST #类型
ips: #ip地址
- 127.0.0.1
自定义实现
3.5.1版本开始支持自定义实现验证逻辑,可以通过实现接口
com.wueasy.gateway.security.service.IpService
public interface IpService {
/**
* 验证ip是否可以访问
* @author: fallsea
* @param ip
* @return true 是,false 否
*/
boolean verify(String ip);
}