update jie-enbale and jia-enbale naming sytle
This commit is contained in:
parent
3179cc57ee
commit
5c12febe6e
|
|
@ -25,10 +25,10 @@ public class BonusGatewayApplication implements CommandLineRunner {
|
||||||
private StringEncryptor encryptor;
|
private StringEncryptor encryptor;
|
||||||
@Override
|
@Override
|
||||||
public void run(String... args) throws Exception {
|
public void run(String... args) throws Exception {
|
||||||
String nacos = encrypt("Jjsp@nacos2023" );
|
// String nacos = encrypt("Jjsp@nacos2023" );
|
||||||
String mogodb = encrypt("Bonus@admin123!" );
|
// String mogodb = encrypt("Bonus@admin123!" );
|
||||||
System.err.println( "nacos原始明文密码加密后的结果为:" + nacos );
|
// System.err.println( "nacos原始明文密码加密后的结果为:" + nacos );
|
||||||
System.err.println( "mogodb原始明文密码加密后的结果为:" + mogodb );
|
// System.err.println( "mogodb原始明文密码加密后的结果为:" + mogodb );
|
||||||
}
|
}
|
||||||
|
|
||||||
private String encrypt( String originPassord ) {
|
private String encrypt( String originPassord ) {
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;
|
||||||
@Component
|
@Component
|
||||||
public class AecDecryptParamFilter extends AbstractGatewayFilterFactory {
|
public class AecDecryptParamFilter extends AbstractGatewayFilterFactory {
|
||||||
|
|
||||||
@Value("${system.jie-enable}")
|
@Value("${system.decryptEnabled}")
|
||||||
public boolean jaData;
|
public boolean jaData;
|
||||||
|
|
||||||
public final static String HEARD_NAME="decrypt";
|
public final static String HEARD_NAME="decrypt";
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
public class AuthFilter implements GlobalFilter, Ordered
|
public class AuthFilter implements GlobalFilter, Ordered
|
||||||
{
|
{
|
||||||
|
|
||||||
@Value("${system.jie-enable}")
|
@Value("${system.decryptEnabled}")
|
||||||
public boolean jaData;
|
public boolean jaData;
|
||||||
private static final Logger log = LoggerFactory.getLogger(AuthFilter.class);
|
private static final Logger log = LoggerFactory.getLogger(AuthFilter.class);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import com.bonus.common.core.utils.ServletUtils;
|
||||||
@Component
|
@Component
|
||||||
public class BlackListUrlFilter extends AbstractGatewayFilterFactory<BlackListUrlFilter.Config>
|
public class BlackListUrlFilter extends AbstractGatewayFilterFactory<BlackListUrlFilter.Config>
|
||||||
{
|
{
|
||||||
@Value("${system.jie-enable}")
|
@Value("${system.decryptEnabled}")
|
||||||
public boolean jaData;
|
public boolean jaData;
|
||||||
@Override
|
@Override
|
||||||
public GatewayFilter apply(Config config)
|
public GatewayFilter apply(Config config)
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ import java.util.Map;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class RequestCoverFilter implements GlobalFilter, Ordered {
|
public class RequestCoverFilter implements GlobalFilter, Ordered {
|
||||||
|
|
||||||
@Value("${system.jie-enable}")
|
@Value("${system.decryptEnabled}")
|
||||||
public boolean jaData;
|
public boolean jaData;
|
||||||
public final static String APPLICATION_JSON_UTF8="application/json;charset=UTF-8";
|
public final static String APPLICATION_JSON_UTF8="application/json;charset=UTF-8";
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ResponseEncryptFilter implements GlobalFilter, Ordered {
|
public class ResponseEncryptFilter implements GlobalFilter, Ordered {
|
||||||
|
|
||||||
@Value("${system.jia-enable}")
|
@Value("${system.encryptEnabled}")
|
||||||
public boolean jaData;
|
public boolean jaData;
|
||||||
/**
|
/**
|
||||||
* 返回的数据 是否加密
|
* 返回的数据 是否加密
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object>
|
||||||
{
|
{
|
||||||
private final static String[] VALIDATE_URL = new String[] { "/auth/login", "/auth/register" };
|
private final static String[] VALIDATE_URL = new String[] { "/auth/login", "/auth/register" };
|
||||||
|
|
||||||
@Value("${system.jie-enable}")
|
@Value("${system.decryptEnabled}")
|
||||||
public boolean jaData;
|
public boolean jaData;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import reactor.core.publisher.Mono;
|
||||||
@Configuration
|
@Configuration
|
||||||
public class GatewayExceptionHandler implements ErrorWebExceptionHandler
|
public class GatewayExceptionHandler implements ErrorWebExceptionHandler
|
||||||
{
|
{
|
||||||
@Value("${system.jie-enable}")
|
@Value("${system.decryptEnabled}")
|
||||||
public boolean jaData;
|
public boolean jaData;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import reactor.core.publisher.Mono;
|
||||||
*/
|
*/
|
||||||
public class SentinelFallbackHandler implements WebExceptionHandler
|
public class SentinelFallbackHandler implements WebExceptionHandler
|
||||||
{
|
{
|
||||||
@Value("${system.jie-enable}")
|
@Value("${system.decryptEnabled}")
|
||||||
public boolean jaData;
|
public boolean jaData;
|
||||||
|
|
||||||
private Mono<Void> writeResponse(ServerResponse response, ServerWebExchange exchange)
|
private Mono<Void> writeResponse(ServerResponse response, ServerWebExchange exchange)
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ spring:
|
||||||
|
|
||||||
#系统 自动 加解密开关
|
#系统 自动 加解密开关
|
||||||
system:
|
system:
|
||||||
jia-enable: false
|
encryptEnabled: false
|
||||||
jie-enable: true
|
decryptEnabled: true
|
||||||
#加密组件
|
#加密组件
|
||||||
jasypt:
|
jasypt:
|
||||||
encryptor:
|
encryptor:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue