]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move Exceptions used in OCP to OCP
authorCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 23 Oct 2023 08:18:20 +0000 (10:18 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 23 Oct 2023 08:26:25 +0000 (10:26 +0200)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/Authentication/Exceptions/ExpiredTokenException.php
lib/private/Authentication/Exceptions/InvalidTokenException.php
lib/private/Authentication/Exceptions/WipeTokenException.php
lib/public/Authentication/Exceptions/ExpiredTokenException.php [new file with mode: 0644]
lib/public/Authentication/Exceptions/InvalidTokenException.php [new file with mode: 0644]
lib/public/Authentication/Exceptions/WipeTokenException.php [new file with mode: 0644]
lib/public/Authentication/Token/IProvider.php

index 0dc92b45920514bab734eda285a009c626fe27f5..c23a1176faef5f9e225a0bb7c3f848c3a0a7c5eb 100644 (file)
@@ -25,19 +25,8 @@ declare(strict_types=1);
  */
 namespace OC\Authentication\Exceptions;
 
-use OC\Authentication\Token\IToken;
-
-class ExpiredTokenException extends InvalidTokenException {
-       /** @var IToken */
-       private $token;
-
-       public function __construct(IToken $token) {
-               parent::__construct();
-
-               $this->token = $token;
-       }
-
-       public function getToken(): IToken {
-               return $this->token;
-       }
+/**
+ * @deprecated 28.0.0 use OCP version instead
+ */
+class ExpiredTokenException extends \OCP\Authentication\Exceptions\ExpiredTokenException {
 }
index acaabff6b88a7a3d32e4cfd3137bdea0a40e9528..7de6e1522fac5ae9b25b73b18dd867a9f436c05b 100644 (file)
@@ -24,7 +24,8 @@ declare(strict_types=1);
  */
 namespace OC\Authentication\Exceptions;
 
-use Exception;
-
-class InvalidTokenException extends Exception {
+/**
+ * @deprecated 28.0.0 use OCP version instead
+ */
+class InvalidTokenException extends \OCP\Authentication\Exceptions\InvalidTokenException {
 }
index 1c60ab9da78ee3434f63c6a3cc727f95bb2dd0bf..8ae4f74e4d79540b4ed136024406738fbea82fd9 100644 (file)
@@ -25,19 +25,8 @@ declare(strict_types=1);
  */
 namespace OC\Authentication\Exceptions;
 
-use OC\Authentication\Token\IToken;
-
-class WipeTokenException extends InvalidTokenException {
-       /** @var IToken */
-       private $token;
-
-       public function __construct(IToken $token) {
-               parent::__construct();
-
-               $this->token = $token;
-       }
-
-       public function getToken(): IToken {
-               return $this->token;
-       }
+/**
+ * @deprecated 28.0.0 use OCP version instead
+ */
+class WipeTokenException extends \OCP\Authentication\Exceptions\WipeTokenException {
 }
diff --git a/lib/public/Authentication/Exceptions/ExpiredTokenException.php b/lib/public/Authentication/Exceptions/ExpiredTokenException.php
new file mode 100644 (file)
index 0000000..eab68ba
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @author Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+namespace OCP\Authentication\Exceptions;
+
+use OCP\Authentication\Token\IToken;
+
+class ExpiredTokenException extends InvalidTokenException {
+       public function __construct(
+               private IToken $token,
+       ) {
+               parent::__construct();
+       }
+
+       public function getToken(): IToken {
+               return $this->token;
+       }
+}
diff --git a/lib/public/Authentication/Exceptions/InvalidTokenException.php b/lib/public/Authentication/Exceptions/InvalidTokenException.php
new file mode 100644 (file)
index 0000000..2556e19
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2016, ownCloud, Inc.
+ *
+ * @author Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+namespace OCP\Authentication\Exceptions;
+
+use Exception;
+
+class InvalidTokenException extends Exception {
+}
diff --git a/lib/public/Authentication/Exceptions/WipeTokenException.php b/lib/public/Authentication/Exceptions/WipeTokenException.php
new file mode 100644 (file)
index 0000000..aa2da67
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @author Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+namespace OCP\Authentication\Exceptions;
+
+use OCP\Authentication\Token\IToken;
+
+class WipeTokenException extends InvalidTokenException {
+       public function __construct(
+               private IToken $token,
+       ) {
+               parent::__construct();
+       }
+
+       public function getToken(): IToken {
+               return $this->token;
+       }
+}
index 4c324d685b7290cac6907dbaf8dcea2a7b4b14f2..59d2b8f3649ce00796b70bfa7c3b56833b04257a 100644 (file)
@@ -24,6 +24,10 @@ declare(strict_types=1);
  */
 namespace OCP\Authentication\Token;
 
+use OCP\Authentication\Exceptions\ExpiredTokenException;
+use OCP\Authentication\Exceptions\InvalidTokenException;
+use OCP\Authentication\Exceptions\WipeTokenException;
+
 /**
  * @since 24.0.8
  */