Class OmpassFilter

java.lang.Object
io.jenkins.plugins.ompass.OmpassFilter
All Implemented Interfaces:
jakarta.servlet.Filter

public class OmpassFilter extends Object implements jakarta.servlet.Filter
Servlet filter that intercepts all requests to enforce OMPASS 2FA authentication. Unauthenticated requests, static resources, API calls, and plugin-specific URLs are allowed through. Authenticated users who have not completed 2FA are redirected to the OMPASS authentication page. This filter follows a fail-open strategy: if an exception occurs during 2FA evaluation, the request is allowed through rather than blocking access.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain filterChain)
     
    void
    init(jakarta.servlet.FilterConfig filterConfig)
     
    static void
    Registers this filter with the Jenkins plugin servlet filter chain.

    Methods inherited from class java.lang.Object

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

    • OmpassFilter

      public OmpassFilter()
  • Method Details

    • registerFilter

      @Initializer(after=PLUGINS_PREPARED) public static void registerFilter() throws jakarta.servlet.ServletException
      Registers this filter with the Jenkins plugin servlet filter chain. Called during Jenkins initialization after plugins are prepared.
      Throws:
      jakarta.servlet.ServletException
    • init

      public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException
      Specified by:
      init in interface jakarta.servlet.Filter
      Throws:
      jakarta.servlet.ServletException
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain filterChain) throws IOException, jakarta.servlet.ServletException
      Specified by:
      doFilter in interface jakarta.servlet.Filter
      Throws:
      IOException
      jakarta.servlet.ServletException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface jakarta.servlet.Filter