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
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationEventPublisher
protected RequestLocaleProvider
protected TokenMasker
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doFilterInternal
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) protected String
getRequestURL
(javax.servlet.http.HttpServletRequest request) protected void
logRequest
(javax.servlet.ServletRequest request) Method logs REST API method invocationprotected void
parseRequestLocale
(javax.servlet.ServletRequest request) Method parses the request locale and sets it to the authenticationvoid
setApplicationEventPublisher
(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) void
setLocaleProvider
(RequestLocaleProvider localeUtils) void
setTokenMasker
(TokenMasker tokenMasker) Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
Methods 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:
doFilterInternal
in 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
-