- GET /api/auth/check: Nginx auth_request용 쿠키 기반 인증/RBAC 권한 체크 - GC_SESSION 쿠키: 로그인 시 JWT를 HttpOnly 쿠키로 자동 설정 - gc_proxy_auth 캐시 쿠키: HMAC 서명 기반 24시간 캐시 (DB 조회 최소화) - AntPathMatcher로 사용자 롤의 URL 패턴과 X-Original-URI 매칭 - 관리자는 모든 프록시 URL 자동 허용, 일반 사용자는 롤 기반 제어 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
720 B
Java
21 lines
720 B
Java
package com.gcsc.guide.config;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
@Configuration
|
|
@RequiredArgsConstructor
|
|
public class WebMvcConfig implements WebMvcConfigurer {
|
|
|
|
private final ApiAccessLogInterceptor apiAccessLogInterceptor;
|
|
|
|
@Override
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
registry.addInterceptor(apiAccessLogInterceptor)
|
|
.addPathPatterns("/api/**")
|
|
.excludePathPatterns("/api/health", "/api/health/**", "/api/auth/check");
|
|
}
|
|
}
|