You are here

function acquia_search_authenticator in Acquia Search 6

Same name and namespace in other branches
  1. 6.3 acquia_search.module \acquia_search_authenticator()

Creates an authenticator based on a data string and HMAC-SHA1.

1 call to acquia_search_authenticator()
acquia_search_auth_cookie in ./acquia_search.module
Modify a solr base url and construct a hmac authenticator cookie.

File

./acquia_search.module, line 331
Integration between Acquia Drupal and Acquia's hosted solr search service.

Code

function acquia_search_authenticator($string, $nonce, $derived_key = NULL) {
  if (empty($derived_key)) {
    $derived_key = _acquia_search_derived_key();
  }
  if (empty($derived_key)) {

    // Expired or invalid subscription - don't continue.
    return '';
  }
  else {
    $time = time();
    return 'acquia_solr_time=' . $time . '; acquia_solr_nonce=' . $nonce . '; acquia_solr_hmac=' . _acquia_search_hmac($derived_key, $time . $nonce . $string) . ';';
  }
}