public class

JiraLoginFilter

extends Object
implements Filter
java.lang.Object
   ↳ com.atlassian.jira.web.filters.JiraLoginFilter

Class Overview

This javax.servlet.Filter implementation is a composite of the Seraph provided com.atlassian.seraph.filter.LoginFilter and com.atlassian.seraph.filter.HttpAuthFilter, which will allow HTTP basic Auth and os_username based login.

It can be derived because of the fragile base class pattern in Java but really it because Serpah was never designed to be extended and has package protected classes and other shenanigans that prevent proper derivation. Buts that ok, because this pattern is more unit testable and less fragile! Long live interfaces!

Also as it turns out this class is logically the same as having a com.atlassian.seraph.filter.HttpAuthFilter follow a com.atlassian.seraph.filter.LoginFilter in the web.xml. But by making a composite we dont have to rely on one failign to work followed by one working. Instead we make a decision as to which one to call and thn invoke it.

And if we change the login rules in the future, we are in a better position this way in terms of coupling and encapsulation.

Summary

Public Constructors
JiraLoginFilter()
This is the production constructor that will be called by the servlet container.
Public Methods
void destroy()
Delegates the filter destroy to both filters.
void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
void init(FilterConfig filterConfig)
Delegates the initialisation to both filters.
[Expand]
Inherited Methods
From class java.lang.Object
From interface javax.servlet.Filter

Public Constructors

public JiraLoginFilter ()

This is the production constructor that will be called by the servlet container. It is the one that sets up the com.atlassian.seraph.filter.LoginFilter and com.atlassian.seraph.filter.HttpAuthFilter

Public Methods

public void destroy ()

Delegates the filter destroy to both filters.

public void doFilter (ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)

Throws
IOException
ServletException

public void init (FilterConfig filterConfig)

Delegates the initialisation to both filters.

Parameters
filterConfig the servlet filter config in play
Throws
ServletException if stuff goes wrong