Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2016-11-08 11:15:02 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2017-01-11 21:20:09 +0300
commita6dca9e7a0c344f0914ce53982e1c6f926e620ac (patch)
tree4cad81fd7692543f873972601f8794a84abb9532 /lib/public/Authentication
parentfab82e9780ad06e20808b9bd2d9c9612eb45e8d0 (diff)
add login credential store
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/public/Authentication')
-rw-r--r--lib/public/Authentication/Exceptions/CredentialsUnavailableException.php34
-rw-r--r--lib/public/Authentication/LoginCredentials/ICredentials.php46
-rw-r--r--lib/public/Authentication/LoginCredentials/IStore.php42
3 files changed, 122 insertions, 0 deletions
diff --git a/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php b/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php
new file mode 100644
index 00000000000..44ae8d37ffb
--- /dev/null
+++ b/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @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 Exception;
+
+/**
+ * @since 9.2
+ */
+class CredentialsUnavailableException extends Exception {
+
+}
diff --git a/lib/public/Authentication/LoginCredentials/ICredentials.php b/lib/public/Authentication/LoginCredentials/ICredentials.php
new file mode 100644
index 00000000000..97c88dda5de
--- /dev/null
+++ b/lib/public/Authentication/LoginCredentials/ICredentials.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @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\LoginCredentials;
+
+/**
+ * @since 9.2
+ */
+interface ICredentials {
+
+ /**
+ * @return string
+ */
+ public function getUID();
+
+ /**
+ * @return string
+ */
+ public function getLoginName();
+
+ /**
+ * @return string
+ */
+ public function getPassword();
+}
diff --git a/lib/public/Authentication/LoginCredentials/IStore.php b/lib/public/Authentication/LoginCredentials/IStore.php
new file mode 100644
index 00000000000..a35e9214e7e
--- /dev/null
+++ b/lib/public/Authentication/LoginCredentials/IStore.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @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\LoginCredentials;
+
+use OCP\Authentication\Exceptions\CredentialsUnavailableException;
+
+/**
+ * @since 9.2
+ */
+interface IStore {
+
+ /**
+ * @since 9.2
+ *
+ * @throws CredentialsUnavailableException
+ * @return ICredentials the login credentials of the current user
+ */
+ public function getLoginCredentials();
+
+}