You are here

function fonts_com_api_headers in @font-your-face 6.2

Same name and namespace in other branches
  1. 7.2 modules/fonts_com/api.inc \fonts_com_api_headers()
  2. 7 modules/fonts_com/fonts_com.module \fonts_com_api_headers()

Provides headers with api parameters.

3 calls to fonts_com_api_headers()
fonts_com_get_domains_in_project in modules/fonts_com/fonts_com.module
Gets list of domains in a given project.
fonts_com_get_fonts_in_project in modules/fonts_com/fonts_com.module
Gets list of fonts in a given project.
fonts_com_get_projects in modules/fonts_com/fonts_com.module
Gets list of projects from API.

File

modules/fonts_com/fonts_com.module, line 276

Code

function fonts_com_api_headers($path) {
  list($public_key, $private_key) = explode('--', variable_get('fonts_com_token', ''));
  $encoded = base64_encode(hash_hmac('md5', $public_key . '|' . $path, $private_key, TRUE));
  $auth = urlencode($public_key . ':' . $encoded);
  return array(
    'Authorization' => $auth,
    'AppKey' => FONTS_COM_API_APP_KEY,
  );
}