Credentials
Authentication informations, used on server and on browser.
Example:
API:
->set_credentials(arg_datas):nothing - check and set crendtials datas.
->dump():string - dump credentials to a readable string without sensitive datas.
->digest_password(arg_string):string - hash credentials password (static).
->serialize(arg_app_secret):string - transform credentials to a string.
->deserialize(string, arg_app_secret):boolean - load credentials from a string.string
->encrypt(arg_app_key):string - encrypted string.
->decrypt(arg_string, arg_app_key):boolean - success or failure.
->extract(arg_string):object - extract a record with credentials values from a formatted string.
Static Method Summary
Static Public Methods | ||
public static |
digest_password(arg_password: string): string Transform credentials password with a hash method. |
|
public static |
Get empty credentials record. |
Constructor Summary
Public Constructor | ||
public |
constructor(arg_datas: object): nothing Create a Credentials instance. |
Member Summary
Public Members | ||
public |
Class type flag. |
|
public |
Update handler. |
Private Members | ||
private |
_credentials: Immutable.Map Credentials settings. |
Method Summary
Public Methods | ||
public |
Decrypt credentials encrypted string. |
|
public |
deserialize(arg_string: string): boolean Deserialize credentials from a string without encryption. |
|
public |
Dump credentials datas to a readable string without sensitive datas. |
|
public |
Transform credentials to a string with encryption. |
|
public |
Extract credentials fields from a string (password should be hashed and encoded, only [a-zA-Z0-9_] chars). |
|
public |
Get credentials application. |
|
public |
Get credentials datas. |
|
public |
Get credentials datas. |
|
public |
Get credentials environment. |
|
public |
Get credentials user. |
|
public |
get_tenant(): string | undefined Get credentials tenant. |
|
public |
Get credentials token. |
|
public |
Get credentials url part. |
|
public |
Get credentials user. |
|
public |
Credentials are valid for access. |
|
public |
Transform credentials to a string without encryption which could be sent over a network. |
|
public |
set_credentials(arg_datas: object): boolean Check and set credentials datas. |
Static Public Methods
Public Constructors
Public Members
Private Members
Public Methods
public decrypt(arg_string: string, arg_app_key: string): string source
Decrypt credentials encrypted string.
public deserialize(arg_string: string): boolean source
Deserialize credentials from a string without encryption. @TODO: use RegExp to split the string into credentials attributes.
Params:
Name | Type | Attribute | Description |
arg_string | string | serialized string. |
public encrypt(arg_app_key: string): string source
Transform credentials to a string with encryption.
Params:
Name | Type | Attribute | Description |
arg_app_key | string | encryption key. |
public extract(arg_string: string): object source
Extract credentials fields from a string (password should be hashed and encoded, only [a-zA-Z0-9_] chars).
Params:
Name | Type | Attribute | Description |
arg_string | string | string as "CREDENTIALS:{tenant:%s,env:%s,app:%s,token:%s,user:%s,pass:%s}". |