Package io.jenkins.plugins.ompass
Class OmpassFilter
java.lang.Object
io.jenkins.plugins.ompass.OmpassFilter
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain filterChain) voidinit(jakarta.servlet.FilterConfig filterConfig) static voidRegisters this filter with the Jenkins plugin servlet filter chain.
-
Constructor Details
-
OmpassFilter
public OmpassFilter()
-
-
Method Details
-
registerFilter
@Initializer(after=PLUGINS_PREPARED) public static void registerFilter() throws jakarta.servlet.ServletExceptionRegisters 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:
initin interfacejakarta.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:
doFilterin interfacejakarta.servlet.Filter- Throws:
IOExceptionjakarta.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroyin interfacejakarta.servlet.Filter
-