com.atlassian.seraph.util
Class SecurityUtils

java.lang.Object
  extended by com.atlassian.seraph.util.SecurityUtils

public class SecurityUtils
extends Object


Nested Class Summary
static class SecurityUtils.UserPassCredentials
          User credentials including a username and a password.
 
Constructor Summary
SecurityUtils()
           
 
Method Summary
static SecurityUtils.UserPassCredentials decodeBasicAuthorizationCredentials(String basicAuthorizationHeader)
          Extracts the username and password from the given header string (including the 'Basic ' prefix).
static void disableSeraphFiltering(javax.servlet.ServletRequest request)
          Disables seraph filtering
static String encodeBasicAuthorizationCredentials(String username, String password)
          Reverses the operation of decodeBasicAuthorizationCredentials.
static Authenticator getAuthenticator(javax.servlet.ServletContext servletContext)
           
static boolean isBasicAuthorizationHeader(String header)
           
static boolean isSeraphFilteringDisabled(javax.servlet.ServletRequest request)
          Checks if Seraph filtering is disabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityUtils

public SecurityUtils()
Method Detail

getAuthenticator

public static Authenticator getAuthenticator(javax.servlet.ServletContext servletContext)

isBasicAuthorizationHeader

public static boolean isBasicAuthorizationHeader(String header)

decodeBasicAuthorizationCredentials

public static SecurityUtils.UserPassCredentials decodeBasicAuthorizationCredentials(String basicAuthorizationHeader)
Extracts the username and password from the given header string (including the 'Basic ' prefix).

Parameters:
basicAuthorizationHeader - the header to decode.
Returns:
the credentials, or a username and password of "" if there were no credentials to decode.

encodeBasicAuthorizationCredentials

public static String encodeBasicAuthorizationCredentials(String username,
                                                         String password)
Reverses the operation of decodeBasicAuthorizationCredentials. Mainly for unit tests, or ServletFilters faking basic authorization.

Parameters:
username - the username to encode.
password - the password to encode.
Returns:
the encoded credentials.

disableSeraphFiltering

public static void disableSeraphFiltering(javax.servlet.ServletRequest request)
Disables seraph filtering

Parameters:
request -
Since:
2.5

isSeraphFilteringDisabled

public static boolean isSeraphFilteringDisabled(javax.servlet.ServletRequest request)
Checks if Seraph filtering is disabled

Parameters:
request -
Returns:
disabled
Since:
2.5


Copyright © 2013 Atlassian. All Rights Reserved.