public class JiraLoginFilter
extends com.atlassian.core.filters.AbstractHttpFilter
Filter
implementation is a composite of the Seraph provided LoginFilter
and 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 HttpAuthFilter
follow a 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.
This filter also invalidates session marked as invalid in JiraUserSessionTracker
Constructor and Description |
---|
JiraLoginFilter()
This is the production constructor that will be called by the servlet container.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Delegates the filter destroy to both filters.
|
protected void |
doFilter(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse,
javax.servlet.FilterChain filterChain) |
void |
init(javax.servlet.FilterConfig filterConfig)
Delegates the initialisation to both filters.
|
public JiraLoginFilter()
LoginFilter
and HttpAuthFilter
protected void doFilter(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException
doFilter
in class com.atlassian.core.filters.AbstractHttpFilter
IOException
javax.servlet.ServletException
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
init
in class com.atlassian.core.filters.AbstractHttpFilter
filterConfig
- the servlet filter config in playjavax.servlet.ServletException
- if stuff goes wrongpublic void destroy()
destroy
in interface javax.servlet.Filter
destroy
in class com.atlassian.core.filters.AbstractHttpFilter
Copyright © 2002-2024 Atlassian. All Rights Reserved.