Skip to content

Commit

Permalink
Merge pull request #85 from apivideo/fix-php-authentication-exception
Browse files Browse the repository at this point in the history
fix(php): Added missing AuthenticationFailedException
  • Loading branch information
bot-api-video authored Feb 5, 2024
2 parents bdce91f + 2505e21 commit 7d420d9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -77,15 +78,15 @@ 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');
}
}

/**
* @param Request $commandRequest
*
* @return array|null
* @throws ClientExceptionInterface
* @throws ClientExceptionInterface|AuthenticationFailedException
*/
public function request(Request $commandRequest, bool $skipAuthRequest = false): ?array
{
Expand All @@ -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);
}
Expand Down
8 changes: 8 additions & 0 deletions src/Exception/AuthenticationFailedException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace ApiVideo\Client\Exception;

class AuthenticationFailedException extends \Exception implements ExceptionInterface
{

}

0 comments on commit 7d420d9

Please sign in to comment.