- 클리언트가 어플리케이션에게 request를 보내면 스프링 컨테이너는 filterChain을 생성함
- filterChain은 Servlet과 filter 인스턴스들을 포함하고 있음
- Servlet
- HttpServeletRequest가 지나가야만 하는 곳
- DispatcherServlet의 인스턴스
- 한 Servlet은 하나의 HttpServletRequest와 HttpServletResponse를 다룸
- filter
- 하나 이상의 필터가 사용될 수 있음
- 하나 이상의 필터가 사용될 수 있음
- 하나 이상의 필터를 사용하여 다음 작업을 수행할 수 있음
- 다운스트림 필터나 서블릿이 호출되지 않도록 할 수 있음
- 이 경우 필터는 일반적으로 HttpServletResponse를 작성함
- 다운스트림 필터 인스턴스 및 서블릿에서 사용하는 HttpServletRequest 또는 HttpServletResponse를 수정합니다.
- 필터는 다운스트림 필터와 서블릿에 영향을 끼치기 때문에 각각의 위치가 굉장히 중요함
- 다운스트림 필터나 서블릿이 호출되지 않도록 할 수 있음
- Servlet
- filterChain은 Servlet과 filter 인스턴스들을 포함하고 있음
https://docs.spring.io/spring-security/reference/servlet/architecture.html#servlet-filters-review
Architecture :: Spring Security
The Security Filters are inserted into the FilterChainProxy with the SecurityFilterChain API. Those filters can be used for a number of different purposes, like authentication, authorization, exploit protection, and more. The filters are executed in a spec
docs.spring.io
'2024' 카테고리의 다른 글
[노마더 코드] 7.0.2 마이그레이션 (0) | 2024.12.09 |
---|---|
[Java] 람다 - 함수형 인터페이스 (0) | 2024.01.24 |
[Spring-Security] 스프링 시큐리티 Exception 과정 (로그인과 연관있음) (0) | 2024.01.22 |
[JWT] 사전 지식 - HMAC, RSA, SHA256, HS256, RS256 (0) | 2024.01.19 |
[Security] CIA (0) | 2024.01.17 |