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

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.context.ApplicationEventPublisher
     
     
    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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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 invocation
    protected void
    parseRequestLocale(javax.servlet.ServletRequest request)
    Method parses the request locale and sets it to the authentication
    void
    setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
     
    void
     
    void
     

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • applicationEventPublisher

      protected org.springframework.context.ApplicationEventPublisher applicationEventPublisher
    • tokenMasker

      protected TokenMasker tokenMasker
    • localeProvider

      protected RequestLocaleProvider localeProvider
  • Constructor Details

    • LastSecurityFilter

      public LastSecurityFilter()
  • Method Details

    • setApplicationEventPublisher

      public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
    • setTokenMasker

      public void setTokenMasker(TokenMasker tokenMasker)
    • setLocaleProvider

      public void setLocaleProvider(RequestLocaleProvider localeUtils)
    • doFilterInternal

      protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws IOException
      Specified by:
      doFilterInternal in class org.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

      protected String getRequestURL(javax.servlet.http.HttpServletRequest request)