mirror of https://gitee.com/stylefeng/roses
【7.0.4】【security】更新跨域过滤器,更新错误的包名
parent
bd1b7d08f8
commit
2ed68bb4ae
|
@ -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>
|
||||
|
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -0,0 +1 @@
|
|||
CORS跨域过滤器
|
|
@ -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>
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue