function acquia_search_valid_response in Acquia Connector 7.2
Same name and namespace in other branches
- 7.3 acquia_search/acquia_search.module \acquia_search_valid_response()
- 7 acquia_search/acquia_search.module \acquia_search_valid_response()
Validate the authenticity of returned data using a nonce and HMAC-SHA1.
Return value
TRUE or FALSE.
2 calls to acquia_search_valid_response()
- AcquiaSearchService::authenticateResponse in acquia_search/
Acquia_Search_Service.php - Validate the hmac for the response body.
- AcquiaSearchUnitTestCase::testValidResponse in acquia_search/
tests/ acquia_search.test - Tests validating a response via the API functions.
File
- acquia_search/
acquia_search.module, line 777 - Integration between Acquia Drupal and Acquia's hosted solr search service.
Code
function acquia_search_valid_response($hmac, $nonce, $string, $derived_key = NULL, $env_id = NULL) {
if (empty($derived_key)) {
$derived_key = _acquia_search_derived_key($env_id);
}
return $hmac == hash_hmac('sha1', $nonce . $string, $derived_key);
}