Skip to content

Commit

Permalink
Replace apiKey with apiSecretKey
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenclouston committed Dec 8, 2024
1 parent 68a9d90 commit f2bc012
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Check out our [official PHP SDK documentation](https://docs.authsignal.com/sdks/
Initialize the Authsignal SDK, ensuring you do not hard code the Authsignal Secret Key, always keep this safe.

```php
Authsignal::setApiKey('secretKey');
Authsignal::setApiSecretKey('secretKey');
```

You can find your `secretKey` in the [Authsignal Portal](https://portal.authsignal.com/organisations/tenants/api).
Expand Down
10 changes: 5 additions & 5 deletions lib/Authsignal/Authsignal.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ abstract class Authsignal
{
const VERSION = '3.0.1';

public static $apiKey;
public static $apiSecretKey;

public static $apiHostname = 'https://signal.authsignal.com';

Expand All @@ -19,14 +19,14 @@ abstract class Authsignal
CURLOPT_TIMEOUT,
CURLOPT_TIMEOUT_MS);

public static function getApiKey()
public static function getApiSecretKey()
{
return self::$apiKey;
return self::$apiSecretKey;
}

public static function setApiKey($apiKey)
public static function setApiSecretKey($apiSecretKey)
{
self::$apiKey = $apiKey;
self::$apiSecretKey = $apiSecretKey;
}

public static function setApiHostname($hostname)
Expand Down
2 changes: 1 addition & 1 deletion lib/Authsignal/AuthsignalClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function handleResponse($request)

public function preCheck()
{
$key = Authsignal::getApiKey();
$key = Authsignal::getApiSecretKey();
if (empty($key)) {
throw new AuthsignalConfigurationError();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Authsignal/AuthsignalRequestTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function send($method, $url, $payload) {

// Set our default options.
$curlOptions[CURLOPT_URL] = $url;
$curlOptions[CURLOPT_USERPWD] = Authsignal::getApiKey() . ":";
$curlOptions[CURLOPT_USERPWD] = Authsignal::getApiSecretKey() . ":";
$curlOptions[CURLOPT_RETURNTRANSFER] = true;
$curlOptions[CURLOPT_CONNECTTIMEOUT] = 3;
$curlOptions[CURLOPT_TIMEOUT] = 10;
Expand Down
2 changes: 1 addition & 1 deletion test/AuthsignalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AuthsignalTest extends PHPUnit\Framework\TestCase {
protected static $server;

public static function setUpBeforeClass(): void {
Authsignal::setApiKey('secret');
Authsignal::setApiSecretKey('secret');
self::$server = new MockWebServer;
self::$server->start();

Expand Down

0 comments on commit f2bc012

Please sign in to comment.