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:
@@ -52,7 +52,7 @@ public function getName()
|
||||
*
|
||||
* @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;
|
||||
|
@@ -50,7 +50,7 @@ public function getName()
|
||||
*
|
||||
* @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(),
|
||||
|
@@ -33,7 +33,7 @@ abstract class RsaSha1 extends SignatureMethod
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return "RSA-SHA1";
|
||||
return 'RSA-SHA1';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ abstract protected function fetchPrivateCert(&$request);
|
||||
*
|
||||
* @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;
|
||||
|
@@ -42,7 +42,7 @@ abstract public function getName();
|
||||
*
|
||||
* @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.
|
||||
|
Reference in New Issue
Block a user