mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-10-07 23:24:24 +08:00
refactor: 重构防火墙路径遍历符校验,抽离出单独的 hook
This commit is contained in:
@@ -38,7 +38,10 @@ import cn.dev33.satoken.stp.StpLogic;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.dev33.satoken.strategy.SaAnnotationStrategy;
|
||||
import cn.dev33.satoken.temp.SaTempInterface;
|
||||
import org.noear.solon.annotation.*;
|
||||
import org.noear.solon.annotation.Bean;
|
||||
import org.noear.solon.annotation.Condition;
|
||||
import org.noear.solon.annotation.Configuration;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -232,4 +235,5 @@ public class SaBeanInject {
|
||||
public void setStpLogic(StpLogic stpLogic) {
|
||||
StpUtil.setStpLogic(stpLogic);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,9 +16,12 @@
|
||||
package cn.dev33.satoken.solon;
|
||||
|
||||
import cn.dev33.satoken.config.SaTokenConfig;
|
||||
import cn.dev33.satoken.solon.integration.SaFirewallCheckFilterForSolon;
|
||||
import cn.dev33.satoken.util.SaTokenConsts;
|
||||
import org.noear.solon.annotation.Bean;
|
||||
import org.noear.solon.annotation.Configuration;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.handle.Filter;
|
||||
|
||||
/**
|
||||
* 注册Sa-Token所需要的Bean
|
||||
@@ -28,6 +31,7 @@ import org.noear.solon.annotation.Inject;
|
||||
*/
|
||||
@Configuration
|
||||
public class SaBeanRegister {
|
||||
|
||||
/**
|
||||
* 获取配置Bean
|
||||
*
|
||||
@@ -41,4 +45,15 @@ public class SaBeanRegister {
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 防火墙校验过滤器
|
||||
*
|
||||
* @return /
|
||||
*/
|
||||
@Bean(index = SaTokenConsts.FIREWALL_CHECK_FILTER_ORDER)
|
||||
public Filter saFirewallCheckFilterForSolon() {
|
||||
return new SaFirewallCheckFilterForSolon();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user