From e67b4ef5f1c3724a9faf737b9619771983fd6aa1 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Wed, 10 May 2023 11:16:13 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.6.0=E3=80=91=E3=80=90=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E6=94=B9=E9=80=A0=E3=80=91=E6=9B=B4=E6=96=B0=E8=B7=A8?= =?UTF-8?q?=E5=9F=9F=E7=9A=84=E6=A8=A1=E5=9D=97=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel-d-security/pom.xml | 2 +- .../README.md | 0 .../pom.xml | 2 +- .../cors/CorsFilterConfiguration.java | 0 .../security-spring-boot-starter/pom.xml | 7 ---- .../starter/CounterAutoConfiguration.java | 32 ------------------- .../SecurityMemoryCacheAutoConfiguration.java | 26 --------------- .../SecurityRedisCacheAutoConfiguration.java | 26 --------------- 8 files changed, 2 insertions(+), 93 deletions(-) rename kernel-d-security/{security-sdk-cors => security-sdk-allow-cors}/README.md (100%) rename kernel-d-security/{security-sdk-cors => security-sdk-allow-cors}/pom.xml (93%) rename kernel-d-security/{security-sdk-cors => security-sdk-allow-cors}/src/main/java/cn/stylefeng/roses/kernel/security/cors/CorsFilterConfiguration.java (100%) diff --git a/kernel-d-security/pom.xml b/kernel-d-security/pom.xml index 6d9d51187..31830d76a 100644 --- a/kernel-d-security/pom.xml +++ b/kernel-d-security/pom.xml @@ -19,7 +19,7 @@ security-api security-sdk-captcha security-sdk-clear-threadlocal - security-sdk-cors + security-sdk-allow-cors security-sdk-count security-sdk-xss security-sdk-request-encrypt-and-decode diff --git a/kernel-d-security/security-sdk-cors/README.md b/kernel-d-security/security-sdk-allow-cors/README.md similarity index 100% rename from kernel-d-security/security-sdk-cors/README.md rename to kernel-d-security/security-sdk-allow-cors/README.md diff --git a/kernel-d-security/security-sdk-cors/pom.xml b/kernel-d-security/security-sdk-allow-cors/pom.xml similarity index 93% rename from kernel-d-security/security-sdk-cors/pom.xml rename to kernel-d-security/security-sdk-allow-cors/pom.xml index c2be70264..104ccabc5 100644 --- a/kernel-d-security/security-sdk-cors/pom.xml +++ b/kernel-d-security/security-sdk-allow-cors/pom.xml @@ -11,7 +11,7 @@ ../pom.xml - security-sdk-cors + security-sdk-allow-cors jar diff --git a/kernel-d-security/security-sdk-cors/src/main/java/cn/stylefeng/roses/kernel/security/cors/CorsFilterConfiguration.java b/kernel-d-security/security-sdk-allow-cors/src/main/java/cn/stylefeng/roses/kernel/security/cors/CorsFilterConfiguration.java similarity index 100% rename from kernel-d-security/security-sdk-cors/src/main/java/cn/stylefeng/roses/kernel/security/cors/CorsFilterConfiguration.java rename to kernel-d-security/security-sdk-allow-cors/src/main/java/cn/stylefeng/roses/kernel/security/cors/CorsFilterConfiguration.java diff --git a/kernel-d-security/security-spring-boot-starter/pom.xml b/kernel-d-security/security-spring-boot-starter/pom.xml index 4121ba77a..0bec7b70f 100644 --- a/kernel-d-security/security-spring-boot-starter/pom.xml +++ b/kernel-d-security/security-spring-boot-starter/pom.xml @@ -52,13 +52,6 @@ ${roses.version} - - - cn.stylefeng.roses - security-sdk-cors - ${roses.version} - - cn.stylefeng.roses diff --git a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/CounterAutoConfiguration.java b/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/CounterAutoConfiguration.java index f0aedb187..16f354ac3 100644 --- a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/CounterAutoConfiguration.java +++ b/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/CounterAutoConfiguration.java @@ -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 blackListCache; - - @Resource(name = "whiteListCache") - private CacheOperatorApi whiteListCache; - @Resource(name = "countValidateCache") private CacheOperatorApi 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); - } - /** * 计数校验器 * diff --git a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/cache/SecurityMemoryCacheAutoConfiguration.java b/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/cache/SecurityMemoryCacheAutoConfiguration.java index 23569d371..58c1ccd6a 100644 --- a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/cache/SecurityMemoryCacheAutoConfiguration.java +++ b/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/cache/SecurityMemoryCacheAutoConfiguration.java @@ -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 blackListMemoryCache() { - TimedCache timedCache = CacheUtil.newTimedCache(CacheConstants.NONE_EXPIRED_TIME); - return new BlackListMemoryCache(timedCache); - } - - /** - * 白名单的缓存 - * - * @author fengshuonan - * @since 2022/11/8 21:24 - */ - @Bean("whiteListCache") - public CacheOperatorApi whiteListMemoryCache() { - TimedCache timedCache = CacheUtil.newTimedCache(CacheConstants.NONE_EXPIRED_TIME); - return new WhiteListMemoryCache(timedCache); - } - /** * 计数缓存 * diff --git a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/cache/SecurityRedisCacheAutoConfiguration.java b/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/cache/SecurityRedisCacheAutoConfiguration.java index ae97bbd2d..ba41bd8e6 100644 --- a/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/cache/SecurityRedisCacheAutoConfiguration.java +++ b/kernel-d-security/security-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/security/starter/cache/SecurityRedisCacheAutoConfiguration.java @@ -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 blackListRedisCache(RedisConnectionFactory redisConnectionFactory) { - RedisTemplate redisTemplate = CreateRedisTemplateUtil.createString(redisConnectionFactory); - return new BlackListRedisCache(redisTemplate); - } - - /** - * 白名单的缓存,Redis缓存 - * - * @author fengshuonan - * @since 2022/11/8 21:24 - */ - @Bean("whiteListCache") - public CacheOperatorApi whiteListRedisCache(RedisConnectionFactory redisConnectionFactory) { - RedisTemplate redisTemplate = CreateRedisTemplateUtil.createString(redisConnectionFactory); - return new WhiteListRedisCache(redisTemplate); - } - /** * 计数缓存,Redis缓存 *