Clover Coverage Report - Atlassian Trusted Apps(Aggregated)
Coverage timestamp: Tue Jun 9 2009 19:34:44 CDT
3   47   4   0.75
0   25   1.33   4
4     1  
1    
 
 
  SeraphAuthenticationListener       Line # 15 3 4 57.1% 0.5714286
 
  (1)
 
1    package com.atlassian.security.auth.trustedapps.seraph.filter;
2   
3    import com.atlassian.security.auth.trustedapps.filter.AuthenticationListener;
4    import com.atlassian.security.auth.trustedapps.filter.Authenticator;
5    import com.atlassian.seraph.filter.BaseLoginFilter;
6    import com.atlassian.seraph.auth.DefaultAuthenticator;
7   
8    import javax.servlet.http.HttpServletRequest;
9    import javax.servlet.http.HttpServletResponse;
10   
11    /**
12    * Serpah implementation of {@link AuthenticationListener} that adds Seraph request and session attributes on
13    * authentication sucess
14    */
 
15    public class SeraphAuthenticationListener implements AuthenticationListener
16    {
17    /**
18    * Adds Seraph authentication attribute to the request and session
19    */
 
20  1 toggle public void authenticationSuccess(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)
21    {
22  1 request.getSession().setAttribute(DefaultAuthenticator.LOGGED_IN_KEY, result.getUser());
23  1 request.getSession().setAttribute(DefaultAuthenticator.LOGGED_OUT_KEY, null);
24  1 request.setAttribute(BaseLoginFilter.OS_AUTHSTATUS_KEY, BaseLoginFilter.LOGIN_SUCCESS);
25    }
26   
27    /**
28    * no-op
29    */
 
30  0 toggle public void authenticationFailure(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)
31    {
32    }
33   
34    /**
35    * no-op
36    */
 
37  0 toggle public void authenticationError(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)
38    {
39    }
40   
41    /**
42    * no-op
43    */
 
44  0 toggle public void authenticationNotAttempted(HttpServletRequest request, HttpServletResponse response)
45    {
46    }
47    }