Various code cleanup.

This commit is contained in:
James Cole
2017-12-29 09:05:35 +01:00
parent cf66ae61e1
commit 3815f9836f
135 changed files with 1021 additions and 973 deletions

View File

@@ -40,8 +40,6 @@ abstract class SpectreRequest
* @var int
*/
protected $expiresAt = 0;
/** @var ServerPublicKey */
protected $serverPublicKey;
/** @var string */
protected $serviceSecret = '';
/** @var string */
@@ -104,22 +102,6 @@ abstract class SpectreRequest
return $this->server;
}
/**
* @return ServerPublicKey
*/
public function getServerPublicKey(): ServerPublicKey
{
return $this->serverPublicKey;
}
/**
* @param ServerPublicKey $serverPublicKey
*/
public function setServerPublicKey(ServerPublicKey $serverPublicKey)
{
$this->serverPublicKey = $serverPublicKey;
}
/**
* @return string
*/
@@ -144,14 +126,6 @@ abstract class SpectreRequest
$this->privateKey = $privateKey;
}
/**
* @param string $secret
*/
public function setSecret(string $secret)
{
$this->secret = $secret;
}
/**
* @param string $method
* @param string $uri
@@ -169,8 +143,6 @@ abstract class SpectreRequest
if ('get' === strtolower($method) || 'delete' === strtolower($method)) {
$data = '';
}
// base64(sha1_signature(private_key, "Expires-at|request_method|original_url|post_body|md5_of_uploaded_file|")))
// Prepare the signature
$toSign = $this->expiresAt . '|' . strtoupper($method) . '|' . $uri . '|' . $data . ''; // no file so no content there.
Log::debug(sprintf('String to sign: "%s"', $toSign));
$signature = '';