Skip to content

Commit

Permalink
Rename setApiHostname to setApiUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenclouston committed Dec 8, 2024
1 parent f2bc012 commit e56fa2e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ Authsignal has multiple api hosting regions. To view your hostname for your tena
| AU (Sydney) | https://au.signal.authsignal.com/v1 |
| EU (Dublin) | https://eu.signal.authsignal.com/v1 |

You can set the hostname via the following code. If the `setApiHostname` function is not called, the api call defaults to the main Authsignal US region hostname `https://signal.authsignal.com`
You can set the hostname via the following code. If the `setApiUrl` function is not called, the api call defaults to the main Authsignal US region hostname `https://signal.authsignal.com`

An example setting the client to use the AU region.

```php
Authsignal::setApiHostname("https://au.signal.authsignal.com");
Authsignal::setApiUrl("https://au.signal.authsignal.com");
```

Alternatively, an environment variable can be used to set the API URL:
Expand Down
6 changes: 3 additions & 3 deletions lib/Authsignal/Authsignal.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class Authsignal

public static $apiSecretKey;

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

public static $apiVersion = 'v1';

Expand All @@ -29,9 +29,9 @@ public static function setApiSecretKey($apiSecretKey)
self::$apiSecretKey = $apiSecretKey;
}

public static function setApiHostname($hostname)
public static function setApiUrl($apiUrl)
{
self::$apiHostname = $hostname;
self::$apiUrl = $apiUrl;
}

public static function setCurlOpts($curlOpts)
Expand Down
2 changes: 1 addition & 1 deletion lib/Authsignal/AuthsignalClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public static function apiUrl($path='')
{
$apiEndpoint = getenv('AUTHSIGNAL_SERVER_API_ENDPOINT');
if ( !$apiEndpoint ) {
$apiURL = Authsignal::$apiHostname;
$apiURL = Authsignal::$apiUrl;
$apiVersion = Authsignal::getApiVersion();
$apiEndpoint = $apiURL.'/'.$apiVersion;
}
Expand Down
2 changes: 1 addition & 1 deletion test/AuthsignalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static function setUpBeforeClass(): void {
self::$server = new MockWebServer;
self::$server->start();

Authsignal::setApiHostname(self::$server->getServerRoot());
Authsignal::setApiUrl(self::$server->getServerRoot());
}

static function tearDownAfterClass(): void {
Expand Down

0 comments on commit e56fa2e

Please sign in to comment.