mirror of
https://gitee.com/smallc/blade-tool.git
synced 2026-07-12 11:19:44 +08:00
新增客户端令牌认证 - secure放行策略
This commit is contained in:
parent
3e974afe30
commit
bc9fa6af33
|
|
@ -52,7 +52,14 @@ public class SecureConfiguration implements WebMvcConfigurer {
|
|||
|
||||
@Override
|
||||
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()) {
|
||||
registry.addInterceptor(new SecureInterceptor())
|
||||
|
|
|
|||
|
|
@ -28,8 +28,19 @@ import java.util.List;
|
|||
@Data
|
||||
public class ClientSecure {
|
||||
|
||||
/**
|
||||
* 客户端id
|
||||
*/
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* secure拦截策略
|
||||
*/
|
||||
private final List<String> pathPatterns = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* secure放行策略
|
||||
*/
|
||||
private final List<String> skipUrl = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user