public class PluginUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PluginUtils.RgyHelperCache |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
copyright |
static Logger |
logger |
static java.lang.String |
sourceCodeID |
| Constructor and Description |
|---|
PluginUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
decodeBase64(java.lang.String b64Str)
Returns a string that has been base64 decoded.
|
static java.lang.String |
decodeURL(java.lang.String encodedURL)
Returns a string that has been URL decoded.
|
static java.lang.String |
encodeBase64(java.lang.String str)
Returns a Base64 encoded string
|
static java.lang.String |
encodeURL(java.lang.String str)
Returns a encoded URL.
|
static java.lang.String |
getCurrentTime()
Returns a UTC time stamp with the format
YYYY-MM-DDThh:mm:ss.sTZD
|
static java.lang.String |
getHashedAttributes()
Returns the attributes that are hashed
|
static java.lang.String |
getHashingAlgorithm(java.lang.String hash)
Returns the algorithm used to hash the input string
|
static java.lang.String |
hash(java.lang.String cleartext,
java.lang.String algorithm)
Hashes the cleartext with the specified hashing algorithm
|
static boolean |
isHashed(java.lang.String value)
Checks if a string is hashed
|
static boolean |
isValidUsername(java.lang.String username)
Validates that the given username is valid for the underlying user registry.
|
static boolean |
isValidUsernamePassword(java.lang.String username,
java.lang.String password)
Validates that the given username and password are valid for the underlying user registry.
|
static void |
logAuditEvent(java.lang.String username,
java.lang.String message,
boolean result)
Audit - Generate audit log event
|
static void |
sleep(long timeInMillis)
Sleep for a number of milliseconds.
|
static void |
trace(java.lang.String traceMsg)
This method allows for javascript rules / PIPs to log trace entries.
|
public static final java.lang.String sourceCodeID
public static final java.lang.String copyright
public static final Logger logger
public static java.lang.String getCurrentTime()
public static java.lang.String hash(java.lang.String cleartext,
java.lang.String algorithm)
cleartext - is the string that you want hashedalgorithm - is the algorithm to use to hash the cleartext stringpublic static java.lang.String getHashingAlgorithm(java.lang.String hash)
hash - is the string that you want to determine what hashing algorithm is usedpublic static boolean isHashed(java.lang.String value)
value - is the string to check if hashedpublic static java.lang.String getHashedAttributes()
public static void trace(java.lang.String traceMsg)
traceMsg - is the message to add to the trace logspublic static java.lang.String decodeBase64(java.lang.String b64Str)
b64Str - is the base 64 encoded string to decodepublic static java.lang.String encodeBase64(java.lang.String str)
str - is the string to encodepublic static java.lang.String decodeURL(java.lang.String encodedURL)
encodedURL - is the URL encoded string to decodepublic static java.lang.String encodeURL(java.lang.String str)
str - is the string value to URL encodepublic static boolean isValidUsernamePassword(java.lang.String username,
java.lang.String password)
throws java.lang.Exception
username - is the user to validatepassword - is the user's passwordjava.lang.Exceptionpublic static boolean isValidUsername(java.lang.String username)
throws java.lang.Exception
username - is the user to validatejava.lang.Exceptionpublic static void logAuditEvent(java.lang.String username,
java.lang.String message,
boolean result)
username - user information to include in the audit record; may be nullmessage - the message to include in the audit recordresult - boolean to indicate if the operation being audited was successfulpublic static void sleep(long timeInMillis)
timeInMillis - to sleep for