💚 Fixing CI Build. format java code

This commit is contained in:
lbw 2021-06-11 17:28:07 +08:00
parent cd387aa904
commit 8a370b117d
4 changed files with 7 additions and 8 deletions

View File

@ -38,7 +38,7 @@ public class RateLimiterConfiguration {
public KeyResolver remoteAddrKeyResolver() {
return exchange -> Mono
.just(Objects.requireNonNull(Objects.requireNonNull(exchange.getRequest().getRemoteAddress()))
.getAddress().getHostAddress());
.getAddress().getHostAddress());
}
}

View File

@ -59,7 +59,8 @@ public class PasswordDecoderFilter extends AbstractGatewayFilterFactory {
ServerHttpRequest request = exchange.getRequest();
// 不是登录请求直接向下执行
if (!CharSequenceUtil.containsAnyIgnoreCase(request.getURI().getPath(), SecurityConstants.OAUTH_TOKEN_URL)) {
if (!CharSequenceUtil.containsAnyIgnoreCase(request.getURI().getPath(),
SecurityConstants.OAUTH_TOKEN_URL)) {
return chain.filter(exchange);
}
@ -89,7 +90,7 @@ public class PasswordDecoderFilter extends AbstractGatewayFilterFactory {
private static String decrypt(String data, String pass) {
AES aes = new AES(Mode.CBC, Padding.NoPadding, new SecretKeySpec(pass.getBytes(), KEY_ALGORITHM),
new IvParameterSpec(pass.getBytes()));
new IvParameterSpec(pass.getBytes()));
byte[] result = aes.decrypt(Base64.decode(data.getBytes(StandardCharsets.UTF_8)));
return new String(result, StandardCharsets.UTF_8);
}

View File

@ -17,7 +17,6 @@
package com.pig4cloud.pig.gateway.filter;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.pig4cloud.pig.common.core.constant.CacheConstants;
@ -60,9 +59,8 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory<Obje
return (exchange, chain) -> {
ServerHttpRequest request = exchange.getRequest();
boolean isAuthToken = CharSequenceUtil.containsAnyIgnoreCase(request.getURI().getPath(),
SecurityConstants.OAUTH_TOKEN_URL);
boolean isIgnoreClient = configProperties.getIgnoreClients()
.contains(WebUtils.getClientId(request)[0]);
SecurityConstants.OAUTH_TOKEN_URL);
boolean isIgnoreClient = configProperties.getIgnoreClients().contains(WebUtils.getClientId(request)[0]);
try {
// only oauth and the request not in ignore clients need check code.
if (isAuthToken && !isIgnoreClient) {

View File

@ -60,7 +60,7 @@ public class ImageCodeHandler implements HandlerFunction<ServerResponse> {
Optional<String> randomStr = serverRequest.queryParam("randomStr");
redisTemplate.setKeySerializer(new StringRedisSerializer());
randomStr.ifPresent(s -> redisTemplate.opsForValue().set(CacheConstants.DEFAULT_CODE_KEY + s, result,
SecurityConstants.CODE_TIME, TimeUnit.SECONDS));
SecurityConstants.CODE_TIME, TimeUnit.SECONDS));
// 转换流信息写出
FastByteArrayOutputStream os = new FastByteArrayOutputStream();