update 修改 健康检查权限 改为用户放行 提高安全性
This commit is contained in:
parent
ed22f395ba
commit
09dfb25d73
@ -120,11 +120,11 @@ security:
|
|||||||
- /*/api-docs
|
- /*/api-docs
|
||||||
# druid 监控配置
|
# druid 监控配置
|
||||||
- /druid/**
|
- /druid/**
|
||||||
|
# 用户放行
|
||||||
|
permit-all:
|
||||||
# actuator 监控配置
|
# actuator 监控配置
|
||||||
- /actuator
|
- /actuator
|
||||||
- /actuator/**
|
- /actuator/**
|
||||||
# 用户放行
|
|
||||||
permit-all:
|
|
||||||
|
|
||||||
# 重复提交
|
# 重复提交
|
||||||
repeat-submit:
|
repeat-submit:
|
||||||
|
@ -2,7 +2,6 @@ package com.ruoyi.monitor.admin.config;
|
|||||||
|
|
||||||
import de.codecentric.boot.admin.server.config.AdminServerProperties;
|
import de.codecentric.boot.admin.server.config.AdminServerProperties;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||||
@ -15,7 +14,6 @@ import org.springframework.security.web.authentication.SavedRequestAwareAuthenti
|
|||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true, proxyTargetClass = true)
|
|
||||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
private final String adminContextPath;
|
private final String adminContextPath;
|
||||||
@ -34,8 +32,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
//授予对所有静态资产和登录页面的公共访问权限。
|
//授予对所有静态资产和登录页面的公共访问权限。
|
||||||
.antMatchers(adminContextPath + "/assets/**").permitAll()
|
.antMatchers(adminContextPath + "/assets/**").permitAll()
|
||||||
.antMatchers(adminContextPath + "/login").permitAll()
|
.antMatchers(adminContextPath + "/login").permitAll()
|
||||||
.antMatchers("/actuator").anonymous()
|
.antMatchers("/actuator").permitAll()
|
||||||
.antMatchers("/actuator/**").anonymous()
|
.antMatchers("/actuator/**").permitAll()
|
||||||
//必须对每个其他请求进行身份验证
|
//必须对每个其他请求进行身份验证
|
||||||
.anyRequest().authenticated().and()
|
.anyRequest().authenticated().and()
|
||||||
//配置登录和注销
|
//配置登录和注销
|
||||||
|
Loading…
x
Reference in New Issue
Block a user