Class RequestValidationInterceptor
- java.lang.Object
-
- org.springframework.web.servlet.handler.HandlerInterceptorAdapter
-
- de.adorsys.psd2.xs2a.web.interceptor.validator.RequestValidationInterceptor
-
- All Implemented Interfaces:
org.springframework.web.servlet.AsyncHandlerInterceptor,org.springframework.web.servlet.HandlerInterceptor
@Component public class RequestValidationInterceptor extends org.springframework.web.servlet.handler.HandlerInterceptorAdapterThis interceptor is used for headers, query and path parameters and body validation of incoming HTTP requests. The main purposes: collect the list of human-readable errors in case of using wrong headers, parameters or JSON fields (ex, IBAN has wrong format, some mandatory header is missing etc). Each error in the incoming request (validated in accordance with the PSD2 documentation) results in one text message in the response.Please note, this interceptor can only return the response with the HTTP code 400 (FORMAT ERROR).
No business validation is present here, as business validation requires some specific options to process (ex, SCA approach, bank-profile configuration). It is implemented in the controllers and services layers.
-
-
Constructor Summary
Constructors Constructor Description RequestValidationInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler)
-
-
-
Method Detail
-
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) throws IOException- Specified by:
preHandlein interfaceorg.springframework.web.servlet.HandlerInterceptor- Overrides:
preHandlein classorg.springframework.web.servlet.handler.HandlerInterceptorAdapter- Throws:
IOException
-
-