【代码优化】调整 swagger 的安全配置
This commit is contained in:
parent
1c139ca6bc
commit
85848f0830
|
@ -24,11 +24,9 @@ public class SecurityConfiguration {
|
||||||
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
|
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
|
||||||
// Swagger 接口文档
|
// Swagger 接口文档
|
||||||
registry.antMatchers("/v3/api-docs/**").permitAll()
|
registry.antMatchers("/v3/api-docs/**").permitAll()
|
||||||
|
.antMatchers("/webjars/**").permitAll()
|
||||||
.antMatchers("/swagger-ui.html").permitAll()
|
.antMatchers("/swagger-ui.html").permitAll()
|
||||||
.antMatchers("/swagger-ui/**").permitAll()
|
.antMatchers("/swagger-ui/**").permitAll();
|
||||||
.antMatchers("/swagger-resources/**").anonymous()
|
|
||||||
.antMatchers("/webjars/**").anonymous()
|
|
||||||
.antMatchers("/*/api-docs").anonymous();
|
|
||||||
// Spring Boot Actuator 的安全配置
|
// Spring Boot Actuator 的安全配置
|
||||||
registry.antMatchers("/actuator").anonymous()
|
registry.antMatchers("/actuator").anonymous()
|
||||||
.antMatchers("/actuator/**").anonymous();
|
.antMatchers("/actuator/**").anonymous();
|
||||||
|
|
Loading…
Reference in New Issue