updated code

This commit is contained in:
rajesh
2024-08-22 17:55:28 +05:30
parent 0a1be9d18f
commit dfbd9e0797
2 changed files with 13 additions and 11 deletions

View File

@@ -9,6 +9,7 @@ import org.springframework.security.config.annotation.authentication.configurati
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
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.WebSecurityCustomizer;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@@ -16,6 +17,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher; import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.web.servlet.handler.HandlerMappingIntrospector; import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.Components;
@@ -53,15 +55,16 @@ public class SecurityConfig {
return new MvcRequestMatcher.Builder(introspector); return new MvcRequestMatcher.Builder(introspector);
} }
// @Bean @Bean
// public WebSecurityCustomizer webSecurityCustomizer(MvcRequestMatcher.Builder mvc) { public WebSecurityCustomizer webSecurityCustomizer(MvcRequestMatcher.Builder mvc) {
// return (web) -> web.ignoring() return (web) -> web.ignoring().requestMatchers(mvc.pattern(HttpMethod.OPTIONS, "/**"))
// .requestMatchers(mvc.pattern(HttpMethod.OPTIONS, "/**")) .requestMatchers(new AntPathRequestMatcher("/i18n/**"))
// .requestMatchers(new AntPathRequestMatcher("/i18n/**")) .requestMatchers(new AntPathRequestMatcher("/content/**"))
// .requestMatchers(new AntPathRequestMatcher("/content/**")) .requestMatchers(new AntPathRequestMatcher("/swagger-ui/index.html"))
// .requestMatchers(new AntPathRequestMatcher("/swagger-ui/index.html")) .requestMatchers(new AntPathRequestMatcher("/swagger-ui/**"));
// .requestMatchers(new AntPathRequestMatcher("/swagger-ui/**")); }
// }
// //
// @Bean // @Bean
// public CorsFilter corsFilter() { // public CorsFilter corsFilter() {

View File

@@ -4,7 +4,6 @@ import net.gepafin.tendermanagement.config.Translator;
import net.gepafin.tendermanagement.constants.GepafinConstant; import net.gepafin.tendermanagement.constants.GepafinConstant;
import net.gepafin.tendermanagement.entities.RoleEntity; import net.gepafin.tendermanagement.entities.RoleEntity;
import net.gepafin.tendermanagement.entities.UserEntity; import net.gepafin.tendermanagement.entities.UserEntity;
import net.gepafin.tendermanagement.enums.CallTypeEnum;
import net.gepafin.tendermanagement.enums.UserStatusEnum; import net.gepafin.tendermanagement.enums.UserStatusEnum;
import net.gepafin.tendermanagement.model.request.LoginReq; import net.gepafin.tendermanagement.model.request.LoginReq;
import net.gepafin.tendermanagement.model.request.UpdateUserReq; import net.gepafin.tendermanagement.model.request.UpdateUserReq;