CWIS Developer Documentation
|
This class provides a general-purpose library for encrypted REST calls and responses. More...
Public Member Functions | |
__construct ($APIUrl, $APIPassword, $CheckForDuplicateFn, $RegisterMessageFn) | |
Constructor. More... | |
DoRestCommand ($Params) | |
Run a REST API command against a remote site. More... | |
EncodeEncryptedMessage ($Data) | |
Construct an encrypted message packet from provided data. More... | |
DecodeEncryptedMessage ($PostData) | |
Decrypt an encrypted message packet. More... | |
This class provides a general-purpose library for encrypted REST calls and responses.
It is intended both for use in CWIS and for use in CWIS-companion plugins for other systems (e.g., the cwis_user Drupal plugin that takes to the CWIS DrupalSync plugin). As such, functions in this class should not use CWIS objects (StdLib, Database, CWUser, etc) that won't be available in other environments.
Definition at line 19 of file RestAPIHelper.php.
RestAPIHelper::__construct | ( | $APIUrl, | |
$APIPassword, | |||
$CheckForDuplicateFn, | |||
$RegisterMessageFn | |||
) |
Constructor.
string | $APIUrl | Url to which REST calls will be directed. |
string | $APIPassword | Password for encrypting and authenticating rest calls. |
callable | $CheckForDuplicateFn | Function to check for duplicated messages. |
callable | $RegisterMessageFn | Function to register a message as received. |
Definition at line 31 of file RestAPIHelper.php.
RestAPIHelper::DecodeEncryptedMessage | ( | $PostData | ) |
Decrypt an encrypted message packet.
array | $PostData | Encrypted data. |
Definition at line 149 of file RestAPIHelper.php.
Referenced by DoRestCommand().
RestAPIHelper::DoRestCommand | ( | $Params | ) |
Run a REST API command against a remote site.
array | $Params | REST API call parameters (often from $_POST). |
Definition at line 46 of file RestAPIHelper.php.
References DecodeEncryptedMessage(), and EncodeEncryptedMessage().
RestAPIHelper::EncodeEncryptedMessage | ( | $Data | ) |
Construct an encrypted message packet from provided data.
array | $Data | Data to encapsulate |
Definition at line 100 of file RestAPIHelper.php.
Referenced by DoRestCommand().