mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-23 05:00:25 +08:00
docs(SecurityGlobalFilter.java): 注释完善
This commit is contained in:
parent
b53e923bfc
commit
49eedf979b
@ -6,7 +6,7 @@ import cn.hutool.core.io.IoUtil;
|
||||
import com.youlai.common.constant.SecurityConstants;
|
||||
import com.youlai.common.result.ResultCode;
|
||||
import com.youlai.gateway.util.ResponseUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ -26,6 +26,7 @@ import org.springframework.security.web.server.SecurityWebFilterChain;
|
||||
import org.springframework.security.web.server.ServerAuthenticationEntryPoint;
|
||||
import org.springframework.security.web.server.authorization.ServerAccessDeniedHandler;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.interfaces.RSAPublicKey;
|
||||
@ -39,12 +40,12 @@ import java.util.List;
|
||||
* @date 2020-05-01
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "security")
|
||||
@AllArgsConstructor
|
||||
@RequiredArgsConstructor
|
||||
@Configuration
|
||||
@EnableWebFluxSecurity
|
||||
public class ResourceServerConfig {
|
||||
|
||||
private ResourceServerManager resourceServerManager;
|
||||
private final ResourceServerManager resourceServerManager;
|
||||
|
||||
@Setter
|
||||
private List<String> ignoreUrls;
|
||||
|
@ -25,11 +25,13 @@ import reactor.core.publisher.Mono;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
|
||||
|
||||
/**
|
||||
* 安全拦截全局过滤器
|
||||
* <p>
|
||||
* 善后一些无关紧要的工作,在 ResourceServerManager#check 鉴权之后执行
|
||||
*
|
||||
* @author <a href="mailto:xianrui0365@163.com">haoxr</a>
|
||||
* @date 2022/2/15
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@ -49,7 +51,6 @@ public class SecurityGlobalFilter implements GlobalFilter, Ordered {
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
ServerHttpResponse response = exchange.getResponse();
|
||||
|
||||
|
||||
// 线上演示环境禁止修改和删除
|
||||
String requestPath = request.getPath().toString();
|
||||
if (env.equals("prod") && !SecurityConstants.LOGOUT_PATH.equals(requestPath)
|
||||
|
Loading…
Reference in New Issue
Block a user