【7.0.4】【security】更新跨域过滤器,更新错误的包名

pull/22/head
fengshuonan 2021-06-08 15:12:44 +08:00
parent bd1b7d08f8
commit 2ed68bb4ae
17 changed files with 85 additions and 19 deletions

View File

@ -19,6 +19,7 @@
<module>security-api</module>
<module>security-sdk-black-white</module>
<module>security-sdk-captcha</module>
<module>security-sdk-cors</module>
<module>security-sdk-count</module>
<module>security-sdk-xss</module>
<module>security-sdk-request-encrypt-and-decode</module>

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.blackwhite;
package cn.stylefeng.roses.kernel.security.blackwhite;
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
import cn.stylefeng.roses.kernel.security.api.BlackListApi;

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.blackwhite;
package cn.stylefeng.roses.kernel.security.blackwhite;
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
import cn.stylefeng.roses.kernel.security.api.WhiteListApi;

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.blackwhite.cache;
package cn.stylefeng.roses.kernel.security.blackwhite.cache;
import cn.hutool.cache.impl.TimedCache;
import cn.stylefeng.roses.kernel.cache.memory.AbstractMemoryCacheOperator;

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.blackwhite.cache;
package cn.stylefeng.roses.kernel.security.blackwhite.cache;
import cn.stylefeng.roses.kernel.cache.redis.AbstractRedisCacheOperator;
import cn.stylefeng.roses.kernel.security.api.constants.CounterConstants;

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.blackwhite.cache;
package cn.stylefeng.roses.kernel.security.blackwhite.cache;
import cn.hutool.cache.impl.TimedCache;
import cn.stylefeng.roses.kernel.cache.memory.AbstractMemoryCacheOperator;

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.blackwhite.cache;
package cn.stylefeng.roses.kernel.security.blackwhite.cache;
import cn.stylefeng.roses.kernel.cache.redis.AbstractRedisCacheOperator;
import cn.stylefeng.roses.kernel.security.api.constants.CounterConstants;

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.captcha;
package cn.stylefeng.roses.kernel.security.captcha;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.captcha.cache;
package cn.stylefeng.roses.kernel.security.captcha.cache;
import cn.hutool.cache.impl.TimedCache;
import cn.stylefeng.roses.kernel.cache.memory.AbstractMemoryCacheOperator;

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.captcha.cache;
package cn.stylefeng.roses.kernel.security.captcha.cache;
import cn.stylefeng.roses.kernel.cache.redis.AbstractRedisCacheOperator;
import cn.stylefeng.roses.kernel.security.api.constants.CaptchaConstants;

View File

@ -0,0 +1 @@
CORS跨域过滤器

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-d-security</artifactId>
<version>7.0.4</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>security-sdk-cors</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--web模块-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,36 @@
package cn.stylefeng.roses.kernel.security.cors;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
/**
*
*
* @author fengshuonan
* @date 2021/6/8 15:11
*/
@Configuration
public class CorsFilterConfiguration {
/**
* 访
*
* @author fengshuonan
* @date 2021/6/8 15:12
*/
@Bean
public CorsFilter corsFilter() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.addAllowedOrigin("*");
corsConfiguration.addAllowedHeader("*");
corsConfiguration.addAllowedMethod("*");
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", corsConfiguration);
return new CorsFilter(source);
}
}

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.count;
package cn.stylefeng.roses.kernel.security.count;
import cn.hutool.core.convert.Convert;
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;

View File

@ -22,7 +22,7 @@
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kemel.security.count.cache;
package cn.stylefeng.roses.kernel.security.count.cache;
import cn.hutool.cache.impl.TimedCache;
import cn.stylefeng.roses.kernel.cache.memory.AbstractMemoryCacheOperator;

View File

@ -26,10 +26,10 @@ package cn.stylefeng.roses.kernel.security.starter;
import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.TimedCache;
import cn.stylefeng.roses.kemel.security.captcha.CaptchaService;
import cn.stylefeng.roses.kemel.security.captcha.cache.CaptchaMemoryCache;
import cn.stylefeng.roses.kernel.cache.api.constants.CacheConstants;
import cn.stylefeng.roses.kernel.security.api.CaptchaApi;
import cn.stylefeng.roses.kernel.security.captcha.CaptchaService;
import cn.stylefeng.roses.kernel.security.captcha.cache.CaptchaMemoryCache;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -26,16 +26,16 @@ package cn.stylefeng.roses.kernel.security.starter;
import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.TimedCache;
import cn.stylefeng.roses.kemel.security.blackwhite.BlackListService;
import cn.stylefeng.roses.kemel.security.blackwhite.WhiteListService;
import cn.stylefeng.roses.kemel.security.blackwhite.cache.BlackListMemoryCache;
import cn.stylefeng.roses.kemel.security.blackwhite.cache.WhiteListMemoryCache;
import cn.stylefeng.roses.kemel.security.count.DefaultCountValidator;
import cn.stylefeng.roses.kemel.security.count.cache.DefaultCountValidateCache;
import cn.stylefeng.roses.kernel.cache.api.constants.CacheConstants;
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.blackwhite.cache.BlackListMemoryCache;
import cn.stylefeng.roses.kernel.security.blackwhite.cache.WhiteListMemoryCache;
import cn.stylefeng.roses.kernel.security.count.DefaultCountValidator;
import cn.stylefeng.roses.kernel.security.count.cache.DefaultCountValidateCache;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;