Make sure that OC interfaces returns OC interfaces for backward compatibility

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/41017/head
Côme Chilliet 3 years ago
parent b82e25ea7a
commit 1bdf952fde
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 3
      apps/settings/lib/Controller/AuthSettingsController.php
  2. 13
      lib/private/Authentication/Exceptions/ExpiredTokenException.php
  3. 13
      lib/private/Authentication/Exceptions/WipeTokenException.php
  4. 9
      lib/public/Authentication/Exceptions/ExpiredTokenException.php
  5. 3
      lib/public/Authentication/Exceptions/InvalidTokenException.php
  6. 9
      lib/public/Authentication/Exceptions/WipeTokenException.php

@ -53,14 +53,13 @@ use OCP\Session\Exceptions\SessionNotAvailableException;
use Psr\Log\LoggerInterface;
class AuthSettingsController extends Controller {
/** @var IProvider */
private $tokenProvider;
/** @var ISession */
private $session;
/** IUserSession */
/** @var IUserSession */
private $userSession;
/** @var string */

@ -25,8 +25,21 @@ declare(strict_types=1);
*/
namespace OC\Authentication\Exceptions;
use OC\Authentication\Token\IToken;
/**
* @deprecated 28.0.0 use OCP version instead
*/
class ExpiredTokenException extends \OCP\Authentication\Exceptions\ExpiredTokenException {
public function __construct(
IToken $token,
) {
parent::__construct($token);
}
public function getToken(): IToken {
$token = parent::getToken();
/** @var IToken $token We know that we passed OC interface from constructor */
return $token;
}
}

@ -25,8 +25,21 @@ declare(strict_types=1);
*/
namespace OC\Authentication\Exceptions;
use OC\Authentication\Token\IToken;
/**
* @deprecated 28.0.0 use OCP version instead
*/
class WipeTokenException extends \OCP\Authentication\Exceptions\WipeTokenException {
public function __construct(
IToken $token,
) {
parent::__construct($token);
}
public function getToken(): IToken {
$token = parent::getToken();
/** @var IToken $token We know that we passed OC interface from constructor */
return $token;
}
}

@ -27,13 +27,22 @@ namespace OCP\Authentication\Exceptions;
use OCP\Authentication\Token\IToken;
/**
* @since 28.0
*/
class ExpiredTokenException extends InvalidTokenException {
/**
* @since 28.0
*/
public function __construct(
private IToken $token,
) {
parent::__construct();
}
/**
* @since 28.0
*/
public function getToken(): IToken {
return $this->token;
}

@ -26,5 +26,8 @@ namespace OCP\Authentication\Exceptions;
use Exception;
/**
* @since 28.0
*/
class InvalidTokenException extends Exception {
}

@ -27,13 +27,22 @@ namespace OCP\Authentication\Exceptions;
use OCP\Authentication\Token\IToken;
/**
* @since 28.0
*/
class WipeTokenException extends InvalidTokenException {
/**
* @since 28.0
*/
public function __construct(
private IToken $token,
) {
parent::__construct();
}
/**
* @since 28.0
*/
public function getToken(): IToken {
return $this->token;
}

Loading…
Cancel
Save