Commit 5a957024 authored by lisong's avatar lisong

Merge remote-tracking branch 'origin/alpha_cafas_v3.6.0.7_pl6_20221128_temp'…

Merge remote-tracking branch 'origin/alpha_cafas_v3.6.0.7_pl6_20221128_temp' into alpha_cafas_v3.6.0.7_pl6_20221128_temp
parents 5643bd7c cce9b627
...@@ -53,18 +53,8 @@ ...@@ -53,18 +53,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-component-authtoken</artifactId> <artifactId>amos-component-security</artifactId>
<version>1.7.13-SNAPSHOT</version> <version>1.7.13-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.springfox</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -9,7 +9,7 @@ import java.util.concurrent.TimeUnit; ...@@ -9,7 +9,7 @@ import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.component.authtoken.robot.AmosRequestContext; import com.yeejoin.amos.component.robot.AmosRequestContext;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
......
package com.yeejoin.amos;
import org.springframework.context.annotation.Configuration;
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.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// 授权
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.headers()
.frameOptions()
.disable()
.and()
.authorizeRequests()
.regexMatchers("^(?!/actuator).*$").permitAll()
.regexMatchers("/actuator/health").permitAll()
.regexMatchers("/actuator/info").permitAll()
.anyRequest().authenticated().and()
.formLogin();
}
}
package com.yeejoin.amos;
import org.springframework.context.annotation.Configuration;
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.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// 授权
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.headers()
.frameOptions()
.disable()
.and()
.authorizeRequests()
.regexMatchers("^(?!/actuator).*$").permitAll()
.regexMatchers("/actuator/health").permitAll()
.regexMatchers("/actuator/info").permitAll()
.anyRequest().authenticated().and()
.formLogin();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment