Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/main/java/com/trinity/ctc/global/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@
public class SecurityConfig {
private final JWTUtil jwtUtil;
private final ObjectMapper objectMapper;
private final RefreshTokenRepository refreshTokenRepository;
private final UserRepository userRepository;
private final KakaoApiService kakaoApiService;
private final AuthService authService;

private final RefreshTokenRepository refreshTokenRepository;
private final CustomAuthenticationEntryPoint customAuthenticationEntryPoint;
private final CustomAccessDeniedHandler customAccessDeniedHandler;

@Bean
public AuthenticationManager authenticationManager(AuthenticationConfiguration configuration) throws Exception {
Expand All @@ -59,9 +55,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http, UserRepository
.csrf(AbstractHttpConfigurer::disable) // POST 테스트 시 CSRF 비활성화
.cors(cors -> cors.configurationSource(corsConfigurationSource())) // CORS 설정
.authorizeHttpRequests(auth -> auth
.requestMatchers("/api/login", "/api/token", "/api/token/reissue", "/users/kakao/login", "/api/fcmTokens/register", "/api/fcmTokens/delete", "/api/data/**", "trigger/notifications/**").permitAll()
.requestMatchers("/api/login", "/api/token", "/api/token/reissue", "/users/kakao/login", "/api/fcmTokens/register", "/api/fcmTokens/delete", "/api/data/**", "/api/search/noauthenticaiton/**").permitAll()
.requestMatchers("/api/users/onboarding/**").hasRole("TEMPORARILY_UNAVAILABLE")
.requestMatchers("/api/login", "/api/token", "/api/token/reissue", "/users/kakao/login", "/api/fcmTokens/register", "/api/fcmTokens/delete", "/api/data/**", "api/notifications/trigger/**","/api/search/noauthenticaiton/**").permitAll()
.requestMatchers("/api/users/onboarding").hasRole("TEMPORARILY_UNAVAILABLE")
.requestMatchers("/api/**", "/api/logout", "/users/kakao/logout").hasRole("AVAILABLE")
.requestMatchers("/swagger-ui/**", "/swagger-ui.html", "/api-docs/**", "/v3/api-docs/**").permitAll()
.anyRequest().authenticated() // 그 외 경로는 인증 필요
Expand Down