mirror of https://gitee.com/stylefeng/roses
【7.6.0】【框架改造】更新跨域的模块名
parent
4811b18917
commit
e67b4ef5f1
|
@ -19,7 +19,7 @@
|
|||
<module>security-api</module>
|
||||
<module>security-sdk-captcha</module>
|
||||
<module>security-sdk-clear-threadlocal</module>
|
||||
<module>security-sdk-cors</module>
|
||||
<module>security-sdk-allow-cors</module>
|
||||
<module>security-sdk-count</module>
|
||||
<module>security-sdk-xss</module>
|
||||
<module>security-sdk-request-encrypt-and-decode</module>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>security-sdk-cors</artifactId>
|
||||
<artifactId>security-sdk-allow-cors</artifactId>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
|
@ -52,13 +52,6 @@
|
|||
<version>${roses.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--CORS过滤器,默认开启允许跨域-->
|
||||
<dependency>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>security-sdk-cors</artifactId>
|
||||
<version>${roses.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--缓存,可选依赖-->
|
||||
<dependency>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
|
|
|
@ -25,11 +25,7 @@
|
|||
package cn.stylefeng.roses.kernel.security.starter;
|
||||
|
||||
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||
import cn.stylefeng.roses.kernel.security.api.BlackListApi;
|
||||
import cn.stylefeng.roses.kernel.security.api.CountValidatorApi;
|
||||
import cn.stylefeng.roses.kernel.security.api.WhiteListApi;
|
||||
import cn.stylefeng.roses.kernel.security.blackwhite.BlackListService;
|
||||
import cn.stylefeng.roses.kernel.security.blackwhite.WhiteListService;
|
||||
import cn.stylefeng.roses.kernel.security.count.DefaultCountValidator;
|
||||
import cn.stylefeng.roses.kernel.security.starter.cache.SecurityMemoryCacheAutoConfiguration;
|
||||
import cn.stylefeng.roses.kernel.security.starter.cache.SecurityRedisCacheAutoConfiguration;
|
||||
|
@ -50,37 +46,9 @@ import javax.annotation.Resource;
|
|||
@AutoConfigureAfter({SecurityMemoryCacheAutoConfiguration.class, SecurityRedisCacheAutoConfiguration.class})
|
||||
public class CounterAutoConfiguration {
|
||||
|
||||
@Resource(name = "blackListCache")
|
||||
private CacheOperatorApi<String> blackListCache;
|
||||
|
||||
@Resource(name = "whiteListCache")
|
||||
private CacheOperatorApi<String> whiteListCache;
|
||||
|
||||
@Resource(name = "countValidateCache")
|
||||
private CacheOperatorApi<Long> countValidateCache;
|
||||
|
||||
/**
|
||||
* 黑名单校验
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2020/12/1 21:18
|
||||
*/
|
||||
@Bean
|
||||
public BlackListApi blackListApi() {
|
||||
return new BlackListService(blackListCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* 白名单校验
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2020/12/1 21:18
|
||||
*/
|
||||
@Bean
|
||||
public WhiteListApi whiteListApi() {
|
||||
return new WhiteListService(whiteListCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计数校验器
|
||||
*
|
||||
|
|
|
@ -5,8 +5,6 @@ import cn.hutool.cache.CacheUtil;
|
|||
import cn.hutool.cache.impl.TimedCache;
|
||||
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||
import cn.stylefeng.roses.kernel.cache.api.constants.CacheConstants;
|
||||
import cn.stylefeng.roses.kernel.security.blackwhite.cache.BlackListMemoryCache;
|
||||
import cn.stylefeng.roses.kernel.security.blackwhite.cache.WhiteListMemoryCache;
|
||||
import cn.stylefeng.roses.kernel.security.captcha.cache.CaptchaMemoryCache;
|
||||
import cn.stylefeng.roses.kernel.security.count.cache.CountValidateMemoryCache;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
|
@ -36,30 +34,6 @@ public class SecurityMemoryCacheAutoConfiguration {
|
|||
return new CaptchaMemoryCache(timedCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* 黑名单的缓存
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2022/11/8 21:24
|
||||
*/
|
||||
@Bean("blackListCache")
|
||||
public CacheOperatorApi<String> blackListMemoryCache() {
|
||||
TimedCache<String, String> timedCache = CacheUtil.newTimedCache(CacheConstants.NONE_EXPIRED_TIME);
|
||||
return new BlackListMemoryCache(timedCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* 白名单的缓存
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2022/11/8 21:24
|
||||
*/
|
||||
@Bean("whiteListCache")
|
||||
public CacheOperatorApi<String> whiteListMemoryCache() {
|
||||
TimedCache<String, String> timedCache = CacheUtil.newTimedCache(CacheConstants.NONE_EXPIRED_TIME);
|
||||
return new WhiteListMemoryCache(timedCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计数缓存
|
||||
*
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.stylefeng.roses.kernel.security.starter.cache;
|
|||
|
||||
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||
import cn.stylefeng.roses.kernel.cache.redis.util.CreateRedisTemplateUtil;
|
||||
import cn.stylefeng.roses.kernel.security.blackwhite.cache.BlackListRedisCache;
|
||||
import cn.stylefeng.roses.kernel.security.blackwhite.cache.WhiteListRedisCache;
|
||||
import cn.stylefeng.roses.kernel.security.captcha.cache.CaptchaRedisCache;
|
||||
import cn.stylefeng.roses.kernel.security.count.cache.CountValidateRedisCache;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
|
@ -36,30 +34,6 @@ public class SecurityRedisCacheAutoConfiguration {
|
|||
return new CaptchaRedisCache(redisTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 黑名单的缓存,Redis缓存
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2022/11/8 21:24
|
||||
*/
|
||||
@Bean("blackListCache")
|
||||
public CacheOperatorApi<String> blackListRedisCache(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisTemplate<String, String> redisTemplate = CreateRedisTemplateUtil.createString(redisConnectionFactory);
|
||||
return new BlackListRedisCache(redisTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 白名单的缓存,Redis缓存
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2022/11/8 21:24
|
||||
*/
|
||||
@Bean("whiteListCache")
|
||||
public CacheOperatorApi<String> whiteListRedisCache(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisTemplate<String, String> redisTemplate = CreateRedisTemplateUtil.createString(redisConnectionFactory);
|
||||
return new WhiteListRedisCache(redisTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计数缓存,Redis缓存
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue