Package com.tivoli.am.rba.extensions
Class PluginUtils
java.lang.Object
com.tivoli.am.rba.extensions.PluginUtils
This class exposes methods for any RBA extensions such
as matchers or Javascript Policy Information Points to use.
- Since:
- 8.0.0.3
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
decodeBase64
(String b64Str) Returns a string that has been base64 decoded.static String
Returns a string that has been URL decoded.static String
encodeBase64
(String str) Returns a Base64 encoded stringstatic String
Returns a encoded URL.static String
Returns a UTC time stamp with the format YYYY-MM-DDThh:mm:ss.sTZDstatic String
Returns the attributes that are hashedstatic String
getHashingAlgorithm
(String hash) Returns the algorithm used to hash the input stringstatic String
Hashes the cleartext with the specified hashing algorithmstatic boolean
Checks if a string is hashedstatic boolean
isValidUsername
(String username) Validates that the given username is valid for the underlying user registry.static boolean
isValidUsernamePassword
(String username, String password) Validates that the given username and password are valid for the underlying user registry.static void
logAuditEvent
(String username, String message, boolean result) Audit - Generate audit log eventstatic void
sleep
(long timeInMillis) Sleep for a number of milliseconds.static void
This method allows for javascript rules / PIPs to log trace entries.
-
Field Details
-
sourceCodeID
- See Also:
-
copyright
-
logger
public static final Logger logger
-
-
Constructor Details
-
PluginUtils
public PluginUtils()
-
-
Method Details
-
getCurrentTime
Returns a UTC time stamp with the format YYYY-MM-DDThh:mm:ss.sTZD- Returns:
- returns the current time in the format YYYY-MM-DDThh:mm:ss.sTZD
- Since:
- 8.0.0.3
-
hash
Hashes the cleartext with the specified hashing algorithm- Parameters:
cleartext
- is the string that you want hashedalgorithm
- is the algorithm to use to hash the cleartext string- Returns:
- a hashed string of the cleartext passed in
- Since:
- 8.0.0.3
-
getHashingAlgorithm
Returns the algorithm used to hash the input string- Parameters:
hash
- is the string that you want to determine what hashing algorithm is used- Returns:
- the string value of the hashing algorithm
- Since:
- 8.0.0.3
-
isHashed
Checks if a string is hashed- Parameters:
value
- is the string to check if hashed- Returns:
- true if hashed and false if not
- Since:
- 8.0.0.3
-
getHashedAttributes
Returns the attributes that are hashed- Returns:
- hashed attributes
- Since:
- 8.0.0.3
-
trace
This method allows for javascript rules / PIPs to log trace entries.- Parameters:
traceMsg
- is the message to add to the trace logs- Since:
- 8.0.0.3
-
decodeBase64
Returns a string that has been base64 decoded. If the decoded string isn't a string the result will be a garbled string result.- Parameters:
b64Str
- is the base 64 encoded string to decode- Returns:
- the base 64 decoded string
- Since:
- 8.0.0.3
-
encodeBase64
Returns a Base64 encoded string- Parameters:
str
- is the string to encode- Returns:
- base 64 encoded string of the string passed in
- Since:
- 8.0.0.3
-
decodeURL
Returns a string that has been URL decoded.- Parameters:
encodedURL
- is the URL encoded string to decode- Returns:
- the URL decoded string
- Since:
- 8.0.0.3
-
encodeURL
Returns a encoded URL.- Parameters:
str
- is the string value to URL encode- Returns:
- URL encoded string
- Since:
- 8.0.0.3
-
isValidUsernamePassword
Validates that the given username and password are valid for the underlying user registry.- Parameters:
username
- is the user to validatepassword
- is the user's password- Returns:
- true if the username and password are valid and false if not
- Throws:
Exception
- Since:
- 8.0.1.0
-
isValidUsername
Validates that the given username is valid for the underlying user registry.- Parameters:
username
- is the user to validate- Returns:
- true if the username is valid and false if not
- Throws:
Exception
- Since:
- 9.0.2.0
-
logAuditEvent
Audit - Generate audit log event- Parameters:
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 successful- Since:
- 8.0.1.0
-
sleep
public static void sleep(long timeInMillis) Sleep for a number of milliseconds.- Parameters:
timeInMillis
- to sleep for
-