mirror of
https://gitee.com/smallc/blade-tool.git
synced 2026-07-19 21:52:09 +08:00
新增客户端令牌认证 - secure放行策略
This commit is contained in:
parent
3e974afe30
commit
bc9fa6af33
|
|
@ -52,7 +52,14 @@ public class SecureConfiguration implements WebMvcConfigurer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInterceptors(InterceptorRegistry registry) {
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
secureProperties.getClient().forEach(cs -> registry.addInterceptor(new ClientInterceptor(cs.getClientId())).addPathPatterns(cs.getPathPatterns()));
|
|
||||||
|
secureProperties.getClient()
|
||||||
|
.parallelStream()
|
||||||
|
.forEach(
|
||||||
|
cs -> registry.addInterceptor(new ClientInterceptor(cs.getClientId()))
|
||||||
|
.addPathPatterns(cs.getPathPatterns())
|
||||||
|
.excludePathPatterns(cs.getSkipUrl())
|
||||||
|
);
|
||||||
|
|
||||||
if (secureRegistry.isEnabled()) {
|
if (secureRegistry.isEnabled()) {
|
||||||
registry.addInterceptor(new SecureInterceptor())
|
registry.addInterceptor(new SecureInterceptor())
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,19 @@ import java.util.List;
|
||||||
@Data
|
@Data
|
||||||
public class ClientSecure {
|
public class ClientSecure {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户端id
|
||||||
|
*/
|
||||||
private String clientId;
|
private String clientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* secure拦截策略
|
||||||
|
*/
|
||||||
private final List<String> pathPatterns = new ArrayList<>();
|
private final List<String> pathPatterns = new ArrayList<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* secure放行策略
|
||||||
|
*/
|
||||||
|
private final List<String> skipUrl = new ArrayList<>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user