com.atlassian.seraph.elevatedsecurity
Class NoopElevatedSecurityGuard

java.lang.Object
  extended by com.atlassian.seraph.elevatedsecurity.NoopElevatedSecurityGuard
All Implemented Interfaces:
ElevatedSecurityGuard, Initable

public class NoopElevatedSecurityGuard
extends Object
implements ElevatedSecurityGuard

This ElevatedSecurityGuard does nothing, as its name might suggest

Since:
v2.1

Field Summary
static NoopElevatedSecurityGuard INSTANCE
          A singleton instance of NoopElevatedSecurityGuard that does nothing!
 
Method Summary
 void init(Map<String,String> params, SecurityConfig config)
          Initialise the configuration object with the given "init-params".
 void onFailedLoginAttempt(javax.servlet.http.HttpServletRequest httpServletRequest, String userName)
          This is called when a user fails a login check, either because they failed the elevated security check or they failed the more basic username and password check.
 void onSuccessfulLoginAttempt(javax.servlet.http.HttpServletRequest httpServletRequest, String userName)
          This is called when a user passes a login check.
 boolean performElevatedSecurityCheck(javax.servlet.http.HttpServletRequest httpServletRequest, String userName)
          This will be called to perform an elevated security check for a given user name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static NoopElevatedSecurityGuard INSTANCE
A singleton instance of NoopElevatedSecurityGuard that does nothing!

Method Detail

init

public void init(Map<String,String> params,
                 SecurityConfig config)
Description copied from interface: Initable
Initialise the configuration object with the given "init-params".

Specified by:
init in interface Initable
Parameters:
params - The map of "init-params" extracted from the Seraph config file. This is guaranteed not null.
config - The Seraph SecurityConfig class that is initialising the config objects. This object will only be partially initialised at this time.

performElevatedSecurityCheck

public boolean performElevatedSecurityCheck(javax.servlet.http.HttpServletRequest httpServletRequest,
                                            String userName)
Description copied from interface: ElevatedSecurityGuard
This will be called to perform an elevated security check for a given user name. Its up to the implementor to decide what if any tests needs to be done. It should return true if the authentication can proceed.

Specified by:
performElevatedSecurityCheck in interface ElevatedSecurityGuard
Parameters:
httpServletRequest - the HTTP request in play
userName - the name of the user to get login information about
Returns:
true if the user passed the elevated security check or false if not. If you dont want any elevated security checks done them always return true.

onFailedLoginAttempt

public void onFailedLoginAttempt(javax.servlet.http.HttpServletRequest httpServletRequest,
                                 String userName)
Description copied from interface: ElevatedSecurityGuard
This is called when a user fails a login check, either because they failed the elevated security check or they failed the more basic username and password check.

The username MAY be null if a valid username cannot be found for example

Specified by:
onFailedLoginAttempt in interface ElevatedSecurityGuard
Parameters:
httpServletRequest - the HTTP request in play
userName - the name of the user to get login information about

onSuccessfulLoginAttempt

public void onSuccessfulLoginAttempt(javax.servlet.http.HttpServletRequest httpServletRequest,
                                     String userName)
Description copied from interface: ElevatedSecurityGuard
This is called when a user passes a login check.

The username MAY be null if a valid username cannot be found for example

Specified by:
onSuccessfulLoginAttempt in interface ElevatedSecurityGuard
Parameters:
httpServletRequest - the HTTP request in play
userName - the name of the user to get login information about


Copyright © 2013 Atlassian. All Rights Reserved.