|
|
@@ -1,81 +0,0 @@
|
|
|
-//package seecoder.devcloud.web.infrastructure.security;
|
|
|
-//
|
|
|
-//
|
|
|
-//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-//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.WebSecurity;
|
|
|
-//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
|
|
-//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
|
-//import org.springframework.security.core.userdetails.UserDetailsService;
|
|
|
-//import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
|
|
-//import seecoder.devcloud.api.ApplicationProperties;
|
|
|
-//import seecoder.devcloud.web.dao.user.UserMapper;
|
|
|
-//import seecoder.devcloud.web.service.user.UserService;
|
|
|
-//
|
|
|
-//
|
|
|
-//@EnableWebSecurity
|
|
|
-//@EnableGlobalMethodSecurity(jsr250Enabled = true)
|
|
|
-//public class WebSecurityConfiguration {
|
|
|
-//// @Configuration
|
|
|
-//// @Order(Ordered.LOWEST_PRECEDENCE)
|
|
|
-//// public static class ApiWebSecurityConfiguration extends WebSecurityConfigurerAdapter {
|
|
|
-//// @Override
|
|
|
-//// protected void configure(HttpSecurity http) throws Exception {
|
|
|
-//// http.antMatcher("/api/**")
|
|
|
-//// .authorizeRequests()
|
|
|
-//// .anyRequest().authenticated()
|
|
|
-//// .and()
|
|
|
-//// .httpBasic()
|
|
|
-//// .and()
|
|
|
-//// .csrf().disable()
|
|
|
-//// .cors();
|
|
|
-//// }
|
|
|
-//// }
|
|
|
-//
|
|
|
-// @Configuration
|
|
|
-// public static class DefaultWebSecurityConfiguration extends WebSecurityConfigurerAdapter {
|
|
|
-// private final UserDetailsService userDetailsService;
|
|
|
-// private final LoginRedirectHandler loginRedirectHandler;
|
|
|
-// @Autowired
|
|
|
-// private UserMapper userMapper;
|
|
|
-// @Autowired
|
|
|
-// private ApplicationProperties applicationProperties;
|
|
|
-// @Autowired
|
|
|
-// private UserService userService;
|
|
|
-//
|
|
|
-// @Autowired
|
|
|
-// public DefaultWebSecurityConfiguration(UserDetailsServiceImpl userDetailsService, LoginRedirectHandler loginRedirectHandler) {
|
|
|
-// this.userDetailsService = userDetailsService;
|
|
|
-// this.loginRedirectHandler = loginRedirectHandler;
|
|
|
-// }
|
|
|
-// @Override
|
|
|
-// protected void configure(HttpSecurity http) throws Exception {
|
|
|
-// JwtAuthenticationFilter jwtAuthenticationFilter =
|
|
|
-// new JwtAuthenticationFilter(authenticationManager(),
|
|
|
-// userDetailsService, new RestAuthorEntry(),
|
|
|
-// new AntPathRequestMatcher("/api/auth/receive", "GET"),
|
|
|
-// applicationProperties,
|
|
|
-// userMapper,
|
|
|
-// userService);
|
|
|
-// http
|
|
|
-// .authorizeRequests()
|
|
|
-// .antMatchers("/api/auth/register","/test" ,"/internal/**").permitAll()
|
|
|
-// .antMatchers("/file/**").hasAnyAuthority(TEACHER_AUTHORITY.getAuthority(), ADMIN_AUTHORITY.getAuthority())
|
|
|
-// .anyRequest().authenticated()
|
|
|
-// .and()
|
|
|
-// .addFilter(jwtAuthenticationFilter)
|
|
|
-// .cors()
|
|
|
-// .and()
|
|
|
-// .csrf().disable();
|
|
|
-// }
|
|
|
-//
|
|
|
-// @Override
|
|
|
-// public void configure(WebSecurity web) throws Exception {
|
|
|
-// web
|
|
|
-// .ignoring()
|
|
|
-// .antMatchers("/api/auth/register","/test" ,"/internal/**");
|
|
|
-// }
|
|
|
-// }
|
|
|
-//}
|