Class DefaultWebSudoManager
- java.lang.Object
-
- com.atlassian.confluence.security.websudo.DefaultWebSudoManager
-
- All Implemented Interfaces:
WebSudoManager
public class DefaultWebSudoManager extends Object implements WebSudoManager
SeeWebSudoManager
for further documentation.
-
-
Constructor Summary
Constructors Constructor Description DefaultWebSudoManager(SettingsManager settingsManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description URI
buildAuthenticationRedirectUri(javax.servlet.http.HttpServletRequest request)
boolean
hasValidSession(javax.servlet.http.HttpSession session)
Check if this is a valid WebSudo session.void
invalidateSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Invalidate the current WebSudo session.static boolean
isElevatedDefaultPath(String servletPath)
boolean
isEnabled()
boolean
isWebSudoRequest(javax.servlet.http.HttpServletRequest request)
Checks if therequest
is a WebSudo request.void
markWebSudoRequest(javax.servlet.http.HttpServletRequest request)
Marks therequest
as a request for a WebSudo resource.boolean
matches(String requestServletPath, Class<?> actionClass, Method method)
Check if the action method should be WebSudo protected for the given requestServletPath.void
startSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Start a new WebSudo session.
-
-
-
Constructor Detail
-
DefaultWebSudoManager
public DefaultWebSudoManager(SettingsManager settingsManager)
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceWebSudoManager
- Returns:
- true if WebSudo is enabled, false otherwise.
-
isElevatedDefaultPath
public static boolean isElevatedDefaultPath(String servletPath)
-
matches
public boolean matches(String requestServletPath, Class<?> actionClass, Method method)
Description copied from interface:WebSudoManager
Check if the action method should be WebSudo protected for the given requestServletPath.- Specified by:
matches
in interfaceWebSudoManager
- Parameters:
requestServletPath
- - the requestServletPath for this action methodactionClass
- - the current action classmethod
- - the action method that is executed- Returns:
- true if the action method should be WebSudo protected, false otherwise.
-
hasValidSession
public boolean hasValidSession(javax.servlet.http.HttpSession session)
Description copied from interface:WebSudoManager
Check if this is a valid WebSudo session.- Specified by:
hasValidSession
in interfaceWebSudoManager
- Parameters:
session
- the currentHttpSession
. Can be null- Returns:
- true if the
HttpSession
is a WebSudo session.
-
startSession
public void startSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Description copied from interface:WebSudoManager
Start a new WebSudo session. Creates a newHttpSession
if necessary.- Specified by:
startSession
in interfaceWebSudoManager
- Parameters:
request
- the currentHttpServletRequest
response
- the currentHttpServletResponse
-
markWebSudoRequest
public void markWebSudoRequest(javax.servlet.http.HttpServletRequest request)
Description copied from interface:WebSudoManager
Marks therequest
as a request for a WebSudo resource.- Specified by:
markWebSudoRequest
in interfaceWebSudoManager
- Parameters:
request
- the currentHttpServletRequest
-
isWebSudoRequest
public boolean isWebSudoRequest(javax.servlet.http.HttpServletRequest request)
Description copied from interface:WebSudoManager
Checks if therequest
is a WebSudo request.- Specified by:
isWebSudoRequest
in interfaceWebSudoManager
- Parameters:
request
- the currentHttpServletRequest
- Returns:
- true if the current request is requesting a WebSudo protected web resource, false otherwise.
-
invalidateSession
public void invalidateSession(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Description copied from interface:WebSudoManager
Invalidate the current WebSudo session. This does NOT invalidate theHttpSession
.- Specified by:
invalidateSession
in interfaceWebSudoManager
- Parameters:
request
- the currentHttpServletRequest
response
- the currentHttpServletResponse
-
buildAuthenticationRedirectUri
public URI buildAuthenticationRedirectUri(javax.servlet.http.HttpServletRequest request)
- Specified by:
buildAuthenticationRedirectUri
in interfaceWebSudoManager
-
-