From 64704384dbfce74605b9ba51768b6c58221cef86 Mon Sep 17 00:00:00 2001 From: thefosk Date: Wed, 20 Feb 2013 00:43:14 +0100 Subject: [PATCH] bugfix --- main/mashape/authentication/AuthenticationUtil.php | 9 ++------- main/mashape/authentication/MashapeAuthentication.php | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/main/mashape/authentication/AuthenticationUtil.php b/main/mashape/authentication/AuthenticationUtil.php index b2c0918..23e654d 100755 --- a/main/mashape/authentication/AuthenticationUtil.php +++ b/main/mashape/authentication/AuthenticationUtil.php @@ -26,13 +26,8 @@ class AuthenticationUtil { - public static function generateAuthenticationHeader($publicKey, $privateKey) { - $header = ""; - if (!($publicKey == null || $privateKey == null)) { - $hash = hash_hmac("sha1", $publicKey, $privateKey); - $header = "X-Mashape-Authorization: " . base64_encode($publicKey . ":" . $hash); - } - return $header; + public static function generateAuthenticationHeader($mashapeKey) { + return "X-Mashape-Authorization: " . $mashapeKey; } } diff --git a/main/mashape/authentication/MashapeAuthentication.php b/main/mashape/authentication/MashapeAuthentication.php index d864ba0..e2c55b8 100644 --- a/main/mashape/authentication/MashapeAuthentication.php +++ b/main/mashape/authentication/MashapeAuthentication.php @@ -6,8 +6,8 @@ class MashapeAuthentication extends HeaderAuthentication { private $headers; - function __construct($publicKey, $privateKey) { - $this->headers = array(AuthenticationUtil::generateAuthenticationHeader($publicKey, $privateKey)); + function __construct($mashapeKey) { + $this->headers = array(AuthenticationUtil::generateAuthenticationHeader($mashapeKey)); } public function handleHeaders() {