summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-02-08 08:34:54 +0100
committerGitHub <noreply@github.com>2019-02-08 08:34:54 +0100
commitb40603d2501059752db43bafb74ef5c11eb57b99 (patch)
tree9e61588dea11c0278ccd7215625ca62dbdd9f69f /lib
parentdd9428047ecdb820b8b7171cbd1ae51a8a1411b8 (diff)
parent4532ed356d4815beba2db69b971e05708f9b33ee (diff)
downloadnextcloud-server-b40603d2501059752db43bafb74ef5c11eb57b99.tar.gz
nextcloud-server-b40603d2501059752db43bafb74ef5c11eb57b99.zip
Merge pull request #13702 from nextcloud/feature/6717/rename-app-passwords
Make it possible to rename app passwords
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php1
-rw-r--r--lib/composer/composer/autoload_static.php1
-rw-r--r--lib/private/Authentication/Token/DefaultToken.php7
-rw-r--r--lib/private/Authentication/Token/INamedToken.php34
-rw-r--r--lib/private/Authentication/Token/PublicKeyToken.php7
5 files changed, 46 insertions, 4 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index 45b6cc2117e..70079c985a5 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -499,6 +499,7 @@ return array(
'OC\\Authentication\\Token\\DefaultTokenCleanupJob' => $baseDir . '/lib/private/Authentication/Token/DefaultTokenCleanupJob.php',
'OC\\Authentication\\Token\\DefaultTokenMapper' => $baseDir . '/lib/private/Authentication/Token/DefaultTokenMapper.php',
'OC\\Authentication\\Token\\DefaultTokenProvider' => $baseDir . '/lib/private/Authentication/Token/DefaultTokenProvider.php',
+ 'OC\\Authentication\\Token\\INamedToken' => $baseDir . '/lib/private/Authentication/Token/INamedToken.php',
'OC\\Authentication\\Token\\IProvider' => $baseDir . '/lib/private/Authentication/Token/IProvider.php',
'OC\\Authentication\\Token\\IToken' => $baseDir . '/lib/private/Authentication/Token/IToken.php',
'OC\\Authentication\\Token\\Manager' => $baseDir . '/lib/private/Authentication/Token/Manager.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 3a9ce29649a..54bdccceac1 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -529,6 +529,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Authentication\\Token\\DefaultTokenCleanupJob' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/DefaultTokenCleanupJob.php',
'OC\\Authentication\\Token\\DefaultTokenMapper' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/DefaultTokenMapper.php',
'OC\\Authentication\\Token\\DefaultTokenProvider' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/DefaultTokenProvider.php',
+ 'OC\\Authentication\\Token\\INamedToken' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/INamedToken.php',
'OC\\Authentication\\Token\\IProvider' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/IProvider.php',
'OC\\Authentication\\Token\\IToken' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/IToken.php',
'OC\\Authentication\\Token\\Manager' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/Manager.php',
diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php
index 85ea0dc4cdd..b1095d0a23b 100644
--- a/lib/private/Authentication/Token/DefaultToken.php
+++ b/lib/private/Authentication/Token/DefaultToken.php
@@ -30,7 +30,6 @@ use OCP\AppFramework\Db\Entity;
* @method void setId(int $id)
* @method void setUid(string $uid);
* @method void setLoginName(string $loginname)
- * @method void setName(string $name)
* @method string getToken()
* @method void setType(int $type)
* @method int getType()
@@ -39,7 +38,7 @@ use OCP\AppFramework\Db\Entity;
* @method int getLastActivity()
* @method void setVersion(int $version)
*/
-class DefaultToken extends Entity implements IToken {
+class DefaultToken extends Entity implements INamedToken {
const VERSION = 1;
@@ -179,6 +178,10 @@ class DefaultToken extends Entity implements IToken {
return parent::getName();
}
+ public function setName(string $name): void {
+ parent::setName($name);
+ }
+
public function getRemember(): int {
return parent::getRemember();
}
diff --git a/lib/private/Authentication/Token/INamedToken.php b/lib/private/Authentication/Token/INamedToken.php
new file mode 100644
index 00000000000..ede075a21c0
--- /dev/null
+++ b/lib/private/Authentication/Token/INamedToken.php
@@ -0,0 +1,34 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2019, Daniel Kesselberg (mail@danielkesselberg.de)
+ *
+ * @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 OC\Authentication\Token;
+
+
+interface INamedToken extends IToken {
+ /**
+ * Set token name
+ *
+ * @param string $name
+ * @return void
+ */
+ public function setName(string $name): void;
+} \ No newline at end of file
diff --git a/lib/private/Authentication/Token/PublicKeyToken.php b/lib/private/Authentication/Token/PublicKeyToken.php
index b6f55146707..b3d87fea7ea 100644
--- a/lib/private/Authentication/Token/PublicKeyToken.php
+++ b/lib/private/Authentication/Token/PublicKeyToken.php
@@ -31,7 +31,6 @@ use OCP\AppFramework\Db\Entity;
* @method void setId(int $id)
* @method void setUid(string $uid);
* @method void setLoginName(string $loginname)
- * @method void setName(string $name)
* @method string getToken()
* @method void setType(int $type)
* @method int getType()
@@ -45,7 +44,7 @@ use OCP\AppFramework\Db\Entity;
* @method void setVersion(int $version)
* @method bool getPasswordInvalid()
*/
-class PublicKeyToken extends Entity implements IToken {
+class PublicKeyToken extends Entity implements INamedToken {
const VERSION = 2;
@@ -197,6 +196,10 @@ class PublicKeyToken extends Entity implements IToken {
return parent::getName();
}
+ public function setName(string $name): void {
+ parent::setName($name);
+ }
+
public function getRemember(): int {
return parent::getRemember();
}