Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@
'OCP\\Authentication\\Events\\AnyLoginFailedEvent' => $baseDir . '/lib/public/Authentication/Events/AnyLoginFailedEvent.php',
'OCP\\Authentication\\Events\\LoginFailedEvent' => $baseDir . '/lib/public/Authentication/Events/LoginFailedEvent.php',
'OCP\\Authentication\\Exceptions\\CredentialsUnavailableException' => $baseDir . '/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php',
'OCP\\Authentication\\Exceptions\\ExpiredTokenException' => $baseDir . '/lib/public/Authentication/Exceptions/ExpiredTokenException.php',
'OCP\\Authentication\\Exceptions\\InvalidTokenException' => $baseDir . '/lib/public/Authentication/Exceptions/InvalidTokenException.php',
'OCP\\Authentication\\Exceptions\\IExpiredTokenException' => $baseDir . '/lib/public/Authentication/Exceptions/IExpiredTokenException.php',
'OCP\\Authentication\\Exceptions\\IInvalidTokenException' => $baseDir . '/lib/public/Authentication/Exceptions/IInvalidTokenException.php',
'OCP\\Authentication\\Exceptions\\IWipeTokenException' => $baseDir . '/lib/public/Authentication/Exceptions/IWipeTokenException.php',
'OCP\\Authentication\\Exceptions\\PasswordUnavailableException' => $baseDir . '/lib/public/Authentication/Exceptions/PasswordUnavailableException.php',
'OCP\\Authentication\\Exceptions\\WipeTokenException' => $baseDir . '/lib/public/Authentication/Exceptions/WipeTokenException.php',
'OCP\\Authentication\\IAlternativeLogin' => $baseDir . '/lib/public/Authentication/IAlternativeLogin.php',
'OCP\\Authentication\\IApacheBackend' => $baseDir . '/lib/public/Authentication/IApacheBackend.php',
'OCP\\Authentication\\IProvideUserSecretBackend' => $baseDir . '/lib/public/Authentication/IProvideUserSecretBackend.php',
Expand Down
6 changes: 3 additions & 3 deletions lib/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OCP\\Authentication\\Events\\AnyLoginFailedEvent' => __DIR__ . '/../../..' . '/lib/public/Authentication/Events/AnyLoginFailedEvent.php',
'OCP\\Authentication\\Events\\LoginFailedEvent' => __DIR__ . '/../../..' . '/lib/public/Authentication/Events/LoginFailedEvent.php',
'OCP\\Authentication\\Exceptions\\CredentialsUnavailableException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php',
'OCP\\Authentication\\Exceptions\\ExpiredTokenException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/ExpiredTokenException.php',
'OCP\\Authentication\\Exceptions\\InvalidTokenException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/InvalidTokenException.php',
'OCP\\Authentication\\Exceptions\\IExpiredTokenException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/IExpiredTokenException.php',
'OCP\\Authentication\\Exceptions\\IInvalidTokenException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/IInvalidTokenException.php',
'OCP\\Authentication\\Exceptions\\IWipeTokenException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/IWipeTokenException.php',
'OCP\\Authentication\\Exceptions\\PasswordUnavailableException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/PasswordUnavailableException.php',
'OCP\\Authentication\\Exceptions\\WipeTokenException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/WipeTokenException.php',
'OCP\\Authentication\\IAlternativeLogin' => __DIR__ . '/../../..' . '/lib/public/Authentication/IAlternativeLogin.php',
'OCP\\Authentication\\IApacheBackend' => __DIR__ . '/../../..' . '/lib/public/Authentication/IApacheBackend.php',
'OCP\\Authentication\\IProvideUserSecretBackend' => __DIR__ . '/../../..' . '/lib/public/Authentication/IProvideUserSecretBackend.php',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,16 @@
namespace OC\Authentication\Exceptions;

use OC\Authentication\Token\IToken;
use OCP\Authentication\Exceptions\IExpiredTokenException;

/**
* @deprecated 28.0.0 use {@see \OCP\Authentication\Exceptions\ExpiredTokenException} instead
*/
class ExpiredTokenException extends \OCP\Authentication\Exceptions\ExpiredTokenException {
class ExpiredTokenException extends InvalidTokenException implements IExpiredTokenException {
public function __construct(
IToken $token,
private IToken $token,
) {
parent::__construct($token);
parent::__construct();
}

public function getToken(): IToken {
$token = parent::getToken();
/** @var IToken $token We know that we passed OC interface from constructor */
return $token;
return $this->token;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*/
namespace OC\Authentication\Exceptions;

/**
* @deprecated 28.0.0 use OCP version instead
*/
class InvalidTokenException extends \OCP\Authentication\Exceptions\InvalidTokenException {
use OCP\Authentication\Exceptions\IInvalidTokenException;

class InvalidTokenException extends \Exception implements IInvalidTokenException {
}
14 changes: 5 additions & 9 deletions lib/private/Authentication/Exceptions/WipeTokenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,16 @@
namespace OC\Authentication\Exceptions;

use OC\Authentication\Token\IToken;
use OCP\Authentication\Exceptions\IWipeTokenException;

/**
* @deprecated 28.0.0 use {@see \OCP\Authentication\Exceptions\WipeTokenException} instead
*/
class WipeTokenException extends \OCP\Authentication\Exceptions\WipeTokenException {
class WipeTokenException extends InvalidTokenException implements IWipeTokenException {
public function __construct(
IToken $token,
private IToken $token,
) {
parent::__construct($token);
parent::__construct();
}

public function getToken(): IToken {
$token = parent::getToken();
/** @var IToken $token We know that we passed OC interface from constructor */
return $token;
return $this->token;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,9 @@
/**
* @since 28.0.0
*/
class ExpiredTokenException extends InvalidTokenException {
interface IExpiredTokenException extends IInvalidTokenException {
/**
* @since 28.0.0
*/
public function __construct(
private IToken $token,
) {
parent::__construct();
}

/**
* @since 28.0.0
*/
public function getToken(): IToken {
return $this->token;
}
public function getToken(): IToken;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
*/
namespace OCP\Authentication\Exceptions;

use Exception;

/**
* @since 28.0.0
*/
class InvalidTokenException extends Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interface IInvalidTokenException extends \Throwable {
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,9 @@
/**
* @since 28.0.0
*/
class WipeTokenException extends InvalidTokenException {
interface IWipeTokenException extends IInvalidTokenException {
/**
* @since 28.0.0
*/
public function __construct(
private IToken $token,
) {
parent::__construct();
}

/**
* @since 28.0.0
*/
public function getToken(): IToken {
return $this->token;
}
public function getToken(): IToken;
}
12 changes: 6 additions & 6 deletions lib/public/Authentication/Token/IProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
*/
namespace OCP\Authentication\Token;

use OCP\Authentication\Exceptions\ExpiredTokenException;
use OCP\Authentication\Exceptions\InvalidTokenException;
use OCP\Authentication\Exceptions\WipeTokenException;
use OCP\Authentication\Exceptions\IExpiredTokenException;
use OCP\Authentication\Exceptions\IInvalidTokenException;
use OCP\Authentication\Exceptions\IWipeTokenException;

/**
* @since 24.0.8
Expand All @@ -47,9 +47,9 @@ public function invalidateTokensOfUser(string $uid, ?string $clientName);
* Get a token by token string id
*
* @since 28.0.0
* @throws InvalidTokenException
* @throws ExpiredTokenException
* @throws WipeTokenException
* @throws IInvalidTokenException
* @throws IExpiredTokenException
* @throws IWipeTokenException
* @return IToken
*/
public function getToken(string $tokenId): IToken;
Expand Down