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:
parent
bfabd20ae4
commit
af1993ac3a
@ -52,7 +52,7 @@ class HmacSha1 extends SignatureMethod
|
|||||||
*
|
*
|
||||||
* @return string
|
* @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();
|
$base_string = $request->getSignatureBaseString();
|
||||||
$request->base_string = $base_string;
|
$request->base_string = $base_string;
|
||||||
|
@ -50,7 +50,7 @@ class PlainText extends SignatureMethod
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function buildSignature(Request $request, Client $client, Token $token)
|
public function buildSignature(Request $request, Client $client, Token $token = null)
|
||||||
{
|
{
|
||||||
$key_parts = array(
|
$key_parts = array(
|
||||||
$client->getSecret(),
|
$client->getSecret(),
|
||||||
|
@ -33,7 +33,7 @@ abstract class RsaSha1 extends SignatureMethod
|
|||||||
*/
|
*/
|
||||||
public function getName()
|
public function getName()
|
||||||
{
|
{
|
||||||
return "RSA-SHA1";
|
return 'RSA-SHA1';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,7 +64,7 @@ abstract class RsaSha1 extends SignatureMethod
|
|||||||
*
|
*
|
||||||
* @return string
|
* @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();
|
$base_string = $request->getSignatureBaseString();
|
||||||
//$request->base_string = $base_string;
|
//$request->base_string = $base_string;
|
||||||
|
@ -42,7 +42,7 @@ abstract class SignatureMethod
|
|||||||
*
|
*
|
||||||
* @return string
|
* @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.
|
* Verifies that a given signature is correct.
|
||||||
|
Loading…
Reference in New Issue
Block a user