Qorus Integration Engine® Enterprise Edition 6.0.1_dev
Loading...
Searching...
No Matches
OMQ::UserApi::Workflow::SensitiveDataHelper Class Reference

This class is a helper class that allows workflow sensitive data to be read and updated atomically; the write lock for the data is grabbed in the constructor and released in the destructor. More...

Private:Internal Member Methods

 destructor ()
 destroys the object and releases the write lock
 
auto get (string skey, string svalue, auto field)
 returns the value one or more keys in the workflow sensitive data hash for the given sensitive data key and value More...
 
hash< auto > getFromAlias (string alias, auto field)
 returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of one or more keys in the workflow sensitive data hash for the given sensitive data alias corresponding to a sensitive data key and value More...
 
hash< auto > getMetadata (string skey, string svalue)
 Returns the sensitive metadata hash for the given sensitive data key and value if present, otherwise returns an empty hash. More...
 
hash< auto > getMetadataFromAlias (string alias)
 returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of the sensitive metadata hash for the given sensitive data alias corresponding to a sensitive data key and value More...
 
hash< auto > getAliases ()
 returns a hash of all sensitive data aliases for the current order or an empty hash if there are none More...
 
hash< auto > getKeyValues ()
 Returns a hash of sensitive data keys and values saved against the order; the sensitive data hashes themselves are not returned, just the information used to index sensitive data against the order. More...
 
nothing replace (string skey, string svalue, *hash< auto > new_data, *softlist aliases, *hash< auto > meta)
 replaces sensitive data for the sensitive key value given; the data has already been committed to the database when the method returns More...
 
nothing replaceMulti (hash< string, hash< string, hash< SensitiveDataInfo > > > sinfo)
 replaces sensitive data for one more more sensitive key values given; the data has already been committed to the database when the method returns More...
 
nothing replaceFromAlias (string alias, *hash< auto > new_data, *hash< auto > meta)
 replaces sensitive data for the sensitive alias given; the data has already been committed to the database when the method returns More...
 
nothing update (string skey, string svalue, hash< auto > new_data, *softlist aliases, *hash< auto > meta)
 Updates or creates the values of one or more keys in the workflow order's sensitive data hash for the given sensitive data key and value; the data has already been committed to the database when the method returns. More...
 
nothing updateFromAlias (string alias, hash< auto > new_data, *hash< auto > meta)
 Updates or creates the values of one or more keys in the workflow order's sensitive data hash for the given sensitive data alias; the data has already been committed to the database when the method returns. More...
 
bool deleteKey (string skey, string svalue, softlist< softstring > keysv)
 Deletes one or more keys from the workflow order data instance’s sensitive data hash for the given sensitive data key and value; the changes have already been committed to the database when the method returns. More...
 
bool del (string skey, string svalue)
 Deletes the sensitive data hash for the given sensitive data key and value; the changes have already been committed to the database when the method returns. More...
 

Detailed Description

This class is a helper class that allows workflow sensitive data to be read and updated atomically; the write lock for the data is grabbed in the constructor and released in the destructor.

Calls to the following workflow API functions related to sensitive data can be made normally while this object exists and the write lock is held.

Note
in Python available as wf.SensitiveDataHelper
See also
Sensitive Data
Since
Qorus 3.1.1

Member Function Documentation

◆ del()

bool OMQ::UserApi::Workflow::SensitiveDataHelper::del ( string  skey,
string  svalue 
)
private:internal

Deletes the sensitive data hash for the given sensitive data key and value; the changes have already been committed to the database when the method returns.

Python Example
sdh.del("personal_id", personal_id)
Qore Example
sdh.del("personal_id", personal_id);
Parameters
skeythe type of sensitive key provided in svalue
svaluethe value of the sensitive data key identified by skey
Returns
True if the data existed and was deleted, False if no such sensitive data key and value were present in the order
Note
  • The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ deleteKey()

bool OMQ::UserApi::Workflow::SensitiveDataHelper::deleteKey ( string  skey,
string  svalue,
softlist< softstring >  keysv 
)
private:internal

Deletes one or more keys from the workflow order data instance’s sensitive data hash for the given sensitive data key and value; the changes have already been committed to the database when the method returns.

Python Example
# delete the "tax_number" and "insurance_number" keys from the sensitive data hash for the given person
sdh.deleteKey("personal_id", personal_id, ("tax_number", "insurance_number"))
Qore Example
# delete the "tax_number" and "insurance_number" keys from the sensitive data hash for the given person
sdh.deleteKey("personal_id", personal_id, ("tax_number", "insurance_number"));
Parameters
skeythe type of sensitive key provided in svalue
svaluethe value of the sensitive data key identified by skey
keysva single key or a list of keys to delete in the workflow order's sensitive data hash for the given sensitive key-value pair
Returns
True if the data existed and was deleted, False if no data was deleted
Note
  • The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ get()

auto OMQ::UserApi::Workflow::SensitiveDataHelper::get ( string  skey,
string  svalue,
auto  field 
)
private:internal

returns the value one or more keys in the workflow sensitive data hash for the given sensitive data key and value

Python Example
# get the tax number for the person
tax_number = sdh.get("personal_id", personal_id, "tax_number")
Qore Example
# get the tax number for the person
string tax_number = sdh.get("personal_id", personal_id, "tax_number");
Parameters
skeythe type of value provided in svalue
svaluethe value of the sensitive data key identified by skey
fieldzero or more string key fields to return
Returns
the value of the entire hash (if no arguments were requested), or a hash of the requested keys (if more than one key was requested), or the given value (if set, if one value is requested)

◆ getAliases()

hash< auto > OMQ::UserApi::Workflow::SensitiveDataHelper::getAliases ( )
private:internal

returns a hash of all sensitive data aliases for the current order or an empty hash if there are none

Python Example
ah = sdh.getAliases()
Qore Example
hash<auto> ah = sdh.getAliases();
Returns
a hash of all sensitive data aliases for the current order or an empty hash if there are none, otherwise keys are alias names and values are hashes with the following keys:
  • skey: (string) the sensitive data key type
  • svalue: (string) the sensitive data value (considered sensitive itself)
Note
  • returns sensitive data; take care not to log any of the sensitive data returned by this function

◆ getFromAlias()

hash< auto > OMQ::UserApi::Workflow::SensitiveDataHelper::getFromAlias ( string  alias,
auto  field 
)
private:internal

returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of one or more keys in the workflow sensitive data hash for the given sensitive data alias corresponding to a sensitive data key and value

Python Example
# get the tax number for the person
tax_number = sdh.getFromAlias("0", "tax_number")
Qore Example
# get the tax number for the person
string tax_number = sdh.getFromAlias("0", "tax_number").svalue;
Parameters
aliasthe alias to lookup; if the alias is unknown, an INVALID-ALIAS exception is raised
fieldzero or more string key fields to return
Returns
a hash of information corresponding to the arguments; the hash returned has the following keys:
  • skey: (string) the sensitive data key type
  • svalue: (string) the sensitive data value (considered sensitive itself)
  • value: the value of the entire hash (if no arguments were requested), or a hash of the requested keys (if more than one key was requested), or the given value (if set, if one value is requested)
Exceptions
INVALID-ALIASthe given alias is unknown

◆ getKeyValues()

hash< auto > OMQ::UserApi::Workflow::SensitiveDataHelper::getKeyValues ( )
private:internal

Returns a hash of sensitive data keys and values saved against the order; the sensitive data hashes themselves are not returned, just the information used to index sensitive data against the order.

Python Example
h = sdh.getKeyValues()
Qore Example
hash<auto> h = sdh.getKeyValues();
Returns
a hash of sensitive data keys and values saved against the order; the sensitive data hashes themselves are not returned, just the information used to index sensitive data against the order; if no sensitive data is stored against the order, an empty hash is returned
Note
returns sensitive data; sensitive data values should not be logged
See also

◆ getMetadata()

hash< auto > OMQ::UserApi::Workflow::SensitiveDataHelper::getMetadata ( string  skey,
string  svalue 
)
private:internal

Returns the sensitive metadata hash for the given sensitive data key and value if present, otherwise returns an empty hash.

Python Example
# get the tax number for the person
tax_number = sdh.getFromAlias("0", "tax_number")
Qore Example
hash<auto> metadata = sdh.getMetadata("personal_id", personal_id);
Parameters
skeythe type of sensitive key provided in svalue
svaluethe value of the sensitive data key identified by skey
Returns
the sensitive metadata hash stored according to the sensitive data key and value; if no such sensitive key and value exist for the order, or no metadata is present for the given sensitive key and value, then an empty hash is returned
Note
  • returns sensitive data; take care not to log any of the data returned by this function
See also

◆ getMetadataFromAlias()

hash< auto > OMQ::UserApi::Workflow::SensitiveDataHelper::getMetadataFromAlias ( string  alias)
private:internal

returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of the sensitive metadata hash for the given sensitive data alias corresponding to a sensitive data key and value

Python Example
# get sensitive metadata
metadata = sdh.getMetadataFromAlias('0')['value']
Qore Example
# get sensitive metadata
hash<auto> metadata = sdh.getMetadataFromAlias("0").value;
Parameters
aliasthe alias to lookup; if the alias is unknown, an INVALID-ALIAS exception is raised
Returns
a hash of information corresponding to the arguments; the hash returned has the following keys:
  • skey: (string) the sensitive data key type
  • svalue: (string) the sensitive data value (considered sensitive itself)
  • value: (hash) the value of the sensitive metadata hash, if any
Exceptions
INVALID-ALIASthe given alias is unknown
Note
  • returns sensitive data; take care not to log any of the sensitive data returned by this function
See also

◆ replace()

nothing OMQ::UserApi::Workflow::SensitiveDataHelper::replace ( string  skey,
string  svalue,
*hash< auto >  new_data,
*softlist  aliases,
*hash< auto >  meta 
)
private:internal

replaces sensitive data for the sensitive key value given; the data has already been committed to the database when the method returns

Python Example
sdh.replace("personal_id", personal_id, new_data)
Qore Example
sdh.replace("personal_id", h.personal_id, h{upd});
Parameters
skeythe type of value provided in svalue; must not be longer than 100 bytes long or a SENSITIVE-DATA-ERROR exception is raised
svaluethe value of the sensitive data key identified by skey; if this string is empty or longer than 100 bytes, a SENSITIVE-DATA-ERROR exception is raised
new_datathe data to use to replace the sensitive data hash for the given sensitive data key and value
aliaseszero or more aliases for the sensitive key value given
metaoptional sensitve data metadata with the following recommended keys:
  • PURPOSE: free-form information about the purpose of the sensitive data
  • CATEGORIES: free-form information about the categories of sensitive data
  • RECIPIENTS: free-form information about the recipients or recipient catories of sensitive data
  • STORAGE: free-form information about the storage time or rules for sensitive data
Exceptions
SENSITIVE-DATA-ERRORno sensitive key value was provided; sensitive key or alias value too long (100 bytes maximum length in the encoding used by the system schema)
Note
  • there is currently no function equivalent to this method for sensitive dynamic data; this method replaces all the sensitive data for the given sensitive key and value
  • The metadata keys listed above are recommended for consistency's sake but are not checked; a hash with any keys can be stored with this API
  • The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
  • this method only replaces sensitive data for a single sensitive data key and value, for a method that replaces sensitive data for multiple sensitive data keys and values in a single transaction, see replaceMulti()
  • use replaceMulti() when replacing sensitive data for more than one key and value at a time as it is more efficient from a database transaction I/O point of view

◆ replaceFromAlias()

nothing OMQ::UserApi::Workflow::SensitiveDataHelper::replaceFromAlias ( string  alias,
*hash< auto >  new_data,
*hash< auto >  meta 
)
private:internal

replaces sensitive data for the sensitive alias given; the data has already been committed to the database when the method returns

Python Example
sdh.replaceWithAlias(alias, new_data)
Qore Example
sdh.replaceWithAlias(alias, h{upd});
Parameters
aliasthe sensitive data alias; must be an existing alias or an INVALID-ALIAS exception is raised
new_datathe data to use to replace the sensitive data hash for the given sensitive data alias
metaoptional sensitve data metadata with the following recommended keys:
  • PURPOSE: free-form information about the purpose of the sensitive data
  • CATEGORIES: free-form information about the categories of sensitive data
  • RECIPIENTS: free-form information about the recipients or recipient catories of sensitive data
  • STORAGE: free-form information about the storage time or rules for sensitive data
Exceptions
INVALID-ALIASthe given alias is unknown
Note
  • there is currently no function equivalent to this method for sensitive dynamic data; this method replaces all the sensitive data for the given sensitive key and value
  • The metadata keys listed above are recommended for consistency's sake but are not checked; a hash with any keys can be stored with this API
  • The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible

◆ replaceMulti()

nothing OMQ::UserApi::Workflow::SensitiveDataHelper::replaceMulti ( hash< string, hash< string, hash< SensitiveDataInfo > > >  sinfo)
private:internal

replaces sensitive data for one more more sensitive key values given; the data has already been committed to the database when the method returns

Qore Example
hash<string, hash<string, hash<SensitiveDataInfo>>> sinfo();
# get_my_data() returns a hash of sensitive "personal_id" keys and sensitive data hashes
# this is then mapped to the data structure required for the call
map sinfo.personal_id{$1.key} = new hash<SensitiveDataInfo>(("data": $1.value)), get_my_data().pairIterator();
sdh.replaceMulti(sinfo);
Parameters
sinfoa hash keyed by sensitive data key, where each value is a hash keyed by sensitive data value, where each value of that hash is a SensitiveDataInfo hash giving the sensitive information for the given sensitive data key and value
Exceptions
SENSITIVE-DATA-ERRORno sensitive key value was provided; sensitive key or alias value too long (100 bytes maximum length in the encoding used by the system schema)
Note
  • there is currently no function equivalent to this method for sensitive dynamic data; this method replaces all the sensitive data for the given sensitive keys and values
  • metadata keys are not checked; a hash with any metadata keys can be stored with this API
  • The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
  • this method replaces sensitive data for multiple sensitive data keys and values in a single transaction and therefore is preferred when updating multiple sensitive data elements over replace()
Since
Qorus 3.1.1.p1

◆ update()

nothing OMQ::UserApi::Workflow::SensitiveDataHelper::update ( string  skey,
string  svalue,
hash< auto >  new_data,
*softlist  aliases,
*hash< auto >  meta 
)
private:internal

Updates or creates the values of one or more keys in the workflow order's sensitive data hash for the given sensitive data key and value; the data has already been committed to the database when the method returns.

Python Example
sdh.update("personal_id", personal_id, new_data, new_data["tax_number"])
Qore Example
sdh.update("personal_id", h.person.personal_id, h, h{"tax_number",});
Parameters
skeythe type of value provided in svalue; must not be longer than 100 bytes long or a SENSITIVE-DATA-ERROR exception is raised
svaluethe value of the sensitive data key identified by skey; if this string is empty or longer than 100 bytes, a SENSITIVE-DATA-ERROR exception is raised
new_datathe data to create or update against skey; existing keys will be replaced; new keys will be added; if the new hash does not refer to existing keys, then those existing keys remain untouched
aliaseszero or more string aliases for the sensitive key and value given
metaoptional sensitve data metadata with the following recommended keys:
  • PURPOSE: free-form information about the purpose of the sensitive data
  • CATEGORIES: free-form information about the categories of sensitive data
  • RECIPIENTS: free-form information about the recipients or recipient categories of sensitive data
  • STORAGE: free-form information about the storage time or rules for sensitive data
Exceptions
SENSITIVE-DATA-ERRORno sensitive key value was provided; sensitive key or alias value too long (100 bytes maximum length in the encoding used by the system schema)
Note
  • do not use sensitive data for the sensitive key names itself (skey) or alias(es) (aliases); key names and aliases may be logged to provide an audit trail of changes to sensitive data
  • metadata keys listed above for the meta argument are recommended for consistency's sake but are not checked; a hash with any keys can be stored with this API
  • The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ updateFromAlias()

nothing OMQ::UserApi::Workflow::SensitiveDataHelper::updateFromAlias ( string  alias,
hash< auto >  new_data,
*hash< auto >  meta 
)
private:internal

Updates or creates the values of one or more keys in the workflow order's sensitive data hash for the given sensitive data alias; the data has already been committed to the database when the method returns.

Python Example
sdh.updateFromAlias(alias, new_data)
Qore Example
sdh.updateFromAlias(alias, h);
Parameters
aliasthe sensitive data alias; must be an existing alias or an INVALID-ALIAS exception is raised
new_datathe data to create or update against skey; existing keys will be replaced; new keys will be added; if the new hash does not refer to existing keys, then those existing keys remain untouched
metaoptional sensitve data metadata with the following recommended keys:
  • PURPOSE: free-form information about the purpose of the sensitive data
  • CATEGORIES: free-form information about the categories of sensitive data
  • RECIPIENTS: free-form information about the recipients or recipient categories of sensitive data
  • STORAGE: free-form information about the storage time or rules for sensitive data
Exceptions
INVALID-ALIASthe given alias is unknown
Note
  • do not use sensitive data for the sensitive data alias value; alias values can be logged to provide an audit trail of changes to sensitive data
  • metadata keys listed above for the meta argument are recommended for consistency's sake but are not checked; a hash with any keys can be stored with this API
  • The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

The documentation for this class was generated from the following file: