1   package com.atlassian.seraph.elevatedsecurity;
2   
3   import com.atlassian.seraph.config.SecurityConfig;
4   
5   import java.util.Map;
6   import javax.servlet.http.HttpServletRequest;
7   
8   /**
9    * This {@link com.atlassian.seraph.elevatedsecurity.ElevatedSecurityGuard} does nothing, as its name might suggest
10   *
11   * @since v2.1
12   */
13  public class NoopElevatedSecurityGuard implements ElevatedSecurityGuard
14  {
15      /**
16       * A singleton instance of NoopElevatedSecurityGuard that does nothing!
17       */
18      public static NoopElevatedSecurityGuard INSTANCE = new NoopElevatedSecurityGuard();
19      
20      private NoopElevatedSecurityGuard()
21      {
22      }
23  
24      public void init(final Map<String, String> params, final SecurityConfig config)
25      {
26      }
27  
28      public boolean performElevatedSecurityCheck(final HttpServletRequest httpServletRequest, final String userName)
29      {
30          // by returning true we are in effect saying "they passed any checks required"!
31          return true;
32      }
33  
34      public void onFailedLoginAttempt(final HttpServletRequest httpServletRequest, final String userName)
35      {
36      }
37  
38      public void onSuccessfulLoginAttempt(final HttpServletRequest httpServletRequest, final String userName)
39      {
40      }
41  }