add 增加 springboot actuator 账号密码认证 杜绝内外网信息泄漏问题

This commit is contained in:
疯狂的狮子Li
2024-07-24 20:07:56 +08:00
parent 5ee78233f1
commit 2575d2a711
4 changed files with 44 additions and 5 deletions

View File

@@ -39,9 +39,7 @@ public class WebSecurityConfigurer {
.authorizeHttpRequests((authorize) ->
authorize.requestMatchers(
new AntPathRequestMatcher(adminContextPath + "/assets/**"),
new AntPathRequestMatcher(adminContextPath + "/login"),
new AntPathRequestMatcher("/actuator"),
new AntPathRequestMatcher("/actuator/**")
new AntPathRequestMatcher(adminContextPath + "/login")
).permitAll()
.anyRequest().authenticated())
.formLogin((formLogin) ->