【7.6.0】【框架改造】更新跨域的模块名

pull/55/head
fengshuonan 2023-05-10 11:16:13 +08:00
parent 4811b18917
commit e67b4ef5f1
8 changed files with 2 additions and 93 deletions

View File

@ -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>

View File

@ -11,7 +11,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>security-sdk-cors</artifactId>
<artifactId>security-sdk-allow-cors</artifactId>
<packaging>jar</packaging>

View File

@ -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>

View File

@ -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);
}
/**
*
*

View File

@ -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);
}
/**
*
*

View File

@ -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
*