From 2505e21e564ea292fdead40c7f2b78e4baefef01 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Mon, 5 Feb 2024 13:49:43 +0000 Subject: [PATCH] fix(php): Added missing AuthenticationFailedException --- CHANGELOG.md | 3 +++ src/BaseClient.php | 7 ++++--- src/Exception/AuthenticationFailedException.php | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 src/Exception/AuthenticationFailedException.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 445e942..7cc4a6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.3.1] - 2023-06-28 +- Added missing AuthenticationFailedException + ## [1.3.0] - 2023-06-28 - Introducing new live streams restream feature - Introducing new analytics endpoints diff --git a/src/BaseClient.php b/src/BaseClient.php index 6f550fb..da6bff5 100644 --- a/src/BaseClient.php +++ b/src/BaseClient.php @@ -2,6 +2,7 @@ namespace ApiVideo\Client; +use ApiVideo\Client\Exception\AuthenticationFailedException; use ApiVideo\Client\Exception\ExpiredAuthTokenException; use ApiVideo\Client\Exception\HttpException; use ApiVideo\Client\Resource\Video\Video; @@ -77,7 +78,7 @@ public function __construct(string $baseUri, ?string $apiKey, ClientInterface $h $this->originSdkHeaderValue = ""; if ($apiKey) { - $this->authenticator = new Authenticator($this, $apiKey, 'php:1.3.0'); + $this->authenticator = new Authenticator($this, $apiKey, 'php:1.3.1'); } } @@ -85,7 +86,7 @@ public function __construct(string $baseUri, ?string $apiKey, ClientInterface $h * @param Request $commandRequest * * @return array|null - * @throws ClientExceptionInterface + * @throws ClientExceptionInterface|AuthenticationFailedException */ public function request(Request $commandRequest, bool $skipAuthRequest = false): ?array { @@ -110,7 +111,7 @@ public function request(Request $commandRequest, bool $skipAuthRequest = false): if($this->originSdkHeaderValue) { $request = $request->withHeader('AV-Origin-Sdk', $this->originSdkHeaderValue); } - $request = $request->withHeader('AV-Origin-Client', 'php:1.3.0'); + $request = $request->withHeader('AV-Origin-Client', 'php:1.3.1'); return $this->sendRequest($request, $skipAuthRequest); } diff --git a/src/Exception/AuthenticationFailedException.php b/src/Exception/AuthenticationFailedException.php new file mode 100644 index 0000000..abe4825 --- /dev/null +++ b/src/Exception/AuthenticationFailedException.php @@ -0,0 +1,8 @@ +