Package io.jmix.securityoauth2.impl
Class LastSecurityFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
io.jmix.securityoauth2.impl.LastSecurityFilter
- All Implemented Interfaces:
javax.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
public class LastSecurityFilter
extends org.springframework.web.filter.OncePerRequestFilter
The last filter in the security filters chain. It does the following:
- logs all REST API methods access
- parses the request locale and sets it to the authentication
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationEventPublisherprotected RequestLocaleProviderprotected TokenMaskerFields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIXFields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) protected StringgetRequestURL(javax.servlet.http.HttpServletRequest request) protected voidlogRequest(javax.servlet.ServletRequest request) Method logs REST API method invocationprotected voidparseRequestLocale(javax.servlet.ServletRequest request) Method parses the request locale and sets it to the authenticationvoidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) voidsetLocaleProvider(RequestLocaleProvider localeUtils) voidsetTokenMasker(TokenMasker tokenMasker) Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Field Details
-
applicationEventPublisher
protected org.springframework.context.ApplicationEventPublisher applicationEventPublisher -
tokenMasker
-
localeProvider
-
-
Constructor Details
-
LastSecurityFilter
public LastSecurityFilter()
-
-
Method Details
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) -
setTokenMasker
-
setLocaleProvider
-
doFilterInternal
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws IOException - Specified by:
doFilterInternalin classorg.springframework.web.filter.OncePerRequestFilter- Throws:
IOException
-
logRequest
protected void logRequest(javax.servlet.ServletRequest request) Method logs REST API method invocation -
parseRequestLocale
protected void parseRequestLocale(javax.servlet.ServletRequest request) Method parses the request locale and sets it to the authentication -
getRequestURL
-