[클라이언트 요청]
│
├─────────────┐
│ │
▼ ▼
[정적 파일 요청] [API 요청 (/api/**)]
/uploads/** /api/posts, /api/admin/** 등
│ │
│ ▼
│ +-------------------------+
│ | SecurityFilterChain |
│ | - HttpSecurity 설정 |
│ | - JWT 필터 등록 |
│ +-------------------------+
│ │
│ ▼
│ +-------------------------+
│ | JwtAuthFilter |
│ | - JWT 존재/유효성 검증 |
│ | - UserDetailsService 호출|
│ | - SecurityContext 저장 |
│ +-------------------------+
│ │
│ ▼
│ +-------------------------+
│ | 권한 검사 (HttpSecurity) |
│ | - /api/admin/** → ROLE_ADMIN |
│ | - /api/** → 인증 필요 |
│ | - 기타 → permitAll() |
│ +-------------------------+
│ │
▼ ▼
[WebConfig] [Controller 실행]
- addResourceHandlers - 서비스 로직 수행
- uploadDir 매핑 - DB 조회 / 처리
- Page<T> 결과 생성
│
▼
+-------------------------+
| PageResponse.from(Page<T>) |
| - List<T> content |
| - int page, size |
| - long totalElements |
| - int totalPages |
| - boolean first, last |
+-------------------------+
│
▼
[프론트에게 JSON 응답]
WebConfig.addResourceHandlers에서 서버 로컬 파일 읽어 클라이언트 응답SecurityFilterChain 처리JwtAuthFilter → UserDetailsService 호출 → SecurityContext 저장<aside> 💡
핵심 포인트
/uploads/**는 인증 없이 접근 가능하도록 Security에서 permitAll() 설정hasRole("ADMIN")으로 세분화 가능@Value로 외부에서 설정 → 배포 유연성 확보
</aside>