Make the Token arg of buildSignature() methods optional.

RSA-SHA1 buildSignature() doesn't use it at all, and the other two allow for there to be no token, as on the initial client request. The token shared-secret as taken to be an empty string.
This commit is contained in:
GaryJones 2012-11-22 16:27:47 +00:00
parent bfabd20ae4
commit af1993ac3a
4 changed files with 5 additions and 5 deletions

View File

@ -52,7 +52,7 @@ class HmacSha1 extends SignatureMethod
*
* @return string
*/
public function buildSignature(Request $request, Client $client, Token $token)
public function buildSignature(Request $request, Client $client, Token $token = null)
{
$base_string = $request->getSignatureBaseString();
$request->base_string = $base_string;

View File

@ -50,7 +50,7 @@ class PlainText extends SignatureMethod
*
* @return string
*/
public function buildSignature(Request $request, Client $client, Token $token)
public function buildSignature(Request $request, Client $client, Token $token = null)
{
$key_parts = array(
$client->getSecret(),

View File

@ -33,7 +33,7 @@ abstract class RsaSha1 extends SignatureMethod
*/
public function getName()
{
return "RSA-SHA1";
return 'RSA-SHA1';
}
/**
@ -64,7 +64,7 @@ abstract class RsaSha1 extends SignatureMethod
*
* @return string
*/
public function buildSignature(Request $request, Client $client, Token $token)
public function buildSignature(Request $request, Client $client, Token $token = null)
{
$base_string = $request->getSignatureBaseString();
//$request->base_string = $base_string;

View File

@ -42,7 +42,7 @@ abstract class SignatureMethod
*
* @return string
*/
abstract public function buildSignature(Request $request, Client $client, Token $token);
abstract public function buildSignature(Request $request, Client $client, Token $token = null);
/**
* Verifies that a given signature is correct.