# Functions
CheckPassword Checks a hashed password against a string
password - string, the password that will be compared hash - string, the hashed password that will be compared
Returns:
out - bool, whether the passed password matches the hash.
CreateExternalJWT Creates a JWT for http API authentication
userID - string, the user ID that this JWT will be used for ip - string, the IP address of the machine that will be using this JWT hours - int, amount of hours the JWT will be active for minutes - int, amount of minutes the JWT will be active for payload - map[string]interface{}, optional set of key, value pairs to be added to the JWT payload
Returns:
out - string, JWT containing the pertinent claims and signed by the global private key.
CreateExternalJWTNoIP Creates a JWT for http API authentication
userID - string, the user ID that this JWT will be used for ip - string, the IP address of the machine that will be using this JWT hours - int, amount of hours the JWT will be active for minutes - int, amount of minutes the JWT will be active for payload - map[string]interface{}, optional set of key, value pairs to be added to the JWT payload
Returns:
out - string, JWT containing the pertinent claims and signed by the global private key.
CreateInternalJWT Creates a JWT for internal_api API authentication
service - string, the service that this JWT will be used for ip - string, the IP address of the machine that will be using this JWT hours - int, amount of hours the JWT will be active for
Returns:
out - string, JWT containing the pertinent claims and signed by the global private key.
No description provided by the author
HashData Hashes the passed data with SHA3-256
data - []byte, the data that will be hashed
Returns:
out - string, hex encoded SHA3-256 hash made of the passed data.
HashFile Hashes the contents of a file with SHA3-256
fp - string, the file path for the file that will be hashes
Returns:
out - string, hex encoded SHA3-256 hash made of passed file's contents.
HashPassword Hashes a password with bcrypt
password - string, the password that will be hashed
Returns:
out - string, a string representation of the hashed password.
LoadKeyFileRSA Loads RSA key from .pem file
path - string, filepath to the .pem file
Returns:
block - *rsa.PrivateKey, RSA private key loaded from file rest - *rsa.PublicKey, RSA public key loaded from file.
LoadToken Loads authentication token from the specified path Args:
path - string, the file path of the authentication token
Returns:
out - string, JWT token loaded from the passed file.
NormalizeURLForHash Normalizes a URL for hash calculation Strips url of all query parameters and fragments Args:
uri - string, url that will be normalized for hashing
Returns:
out - string, url that has been stripped of all of its query parameters and fragments.
PathExists Checks if a file path exists on the filesystem Args:
path - string, the file path of the source file
Returns:
out - bool, whether the filepath was found to exist on the filesystem.
ValidateExternalJWT Validates a JWT for internal_api API authentication
tokenString - string, JWT string that will be validated ip - string, IP address of the machine that will be using this JWT payload - map[string]interface{}, optional set of key, value pairs to be checked for in the JWT payload
Returns:
valid - bool, success status for the JWT validation userID - string, id of the user stored in the JWT payload - map[string]interface, payload of the jwt.
ValidateInternalJWT Validates a JWT for internal_api API authentication
tokenString - string, JWT string that will be validated service - string, service that this JWT will be used for ip - string, IP address of the machine that will be using this JWT validateIP - bool, validate the IP stored inside the JWT
Returns:
out - bool, success status for the JWT validation.
# Constants
No description provided by the author