aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib/Auth/AuthMechanism.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Lib/Auth/AuthMechanism.php')
-rw-r--r--apps/files_external/lib/Lib/Auth/AuthMechanism.php61
1 files changed, 21 insertions, 40 deletions
diff --git a/apps/files_external/lib/Lib/Auth/AuthMechanism.php b/apps/files_external/lib/Lib/Auth/AuthMechanism.php
index 28d1dde4375..7b0544100fb 100644
--- a/apps/files_external/lib/Lib/Auth/AuthMechanism.php
+++ b/apps/files_external/lib/Lib/Auth/AuthMechanism.php
@@ -1,34 +1,19 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Robin Appelman <robin@icewind.nl>
- * @author Robin McCorkell <robin@mccorkell.me.uk>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @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/>
- *
+ * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
-
namespace OCA\Files_External\Lib\Auth;
-use \OCA\Files_External\Lib\StorageConfig;
-use \OCA\Files_External\Lib\VisibilityTrait;
-use \OCA\Files_External\Lib\IdentifierTrait;
-use \OCA\Files_External\Lib\FrontendDefinitionTrait;
-use \OCA\Files_External\Lib\StorageModifierTrait;
+use OCA\Files_External\Lib\FrontendDefinitionTrait;
+use OCA\Files_External\Lib\IdentifierTrait;
+use OCA\Files_External\Lib\IFrontendDefinition;
+use OCA\Files_External\Lib\IIdentifier;
+use OCA\Files_External\Lib\StorageConfig;
+use OCA\Files_External\Lib\StorageModifierTrait;
+use OCA\Files_External\Lib\VisibilityTrait;
/**
* Authentication mechanism
@@ -37,7 +22,7 @@ use \OCA\Files_External\Lib\StorageModifierTrait;
* such as \OCP\IDB for database operations. This allows an authentication
* mechanism to perform advanced operations based on provided information.
*
- * An authenication scheme defines the parameter interface, common to the
+ * An authentication scheme defines the parameter interface, common to the
* storage implementation, the backend and the authentication mechanism.
* A storage implementation expects parameters according to the authentication
* scheme, which are provided from the authentication mechanism.
@@ -50,16 +35,15 @@ use \OCA\Files_External\Lib\StorageModifierTrait;
* - StorageModifierTrait
* Object can affect storage mounting
*/
-class AuthMechanism implements \JsonSerializable {
-
+class AuthMechanism implements \JsonSerializable, IIdentifier, IFrontendDefinition {
/** Standard authentication schemes */
- const SCHEME_NULL = 'null';
- const SCHEME_BUILTIN = 'builtin';
- const SCHEME_PASSWORD = 'password';
- const SCHEME_OAUTH1 = 'oauth1';
- const SCHEME_OAUTH2 = 'oauth2';
- const SCHEME_PUBLICKEY = 'publickey';
- const SCHEME_OPENSTACK = 'openstack';
+ public const SCHEME_NULL = 'null';
+ public const SCHEME_BUILTIN = 'builtin';
+ public const SCHEME_PASSWORD = 'password';
+ public const SCHEME_OAUTH2 = 'oauth2';
+ public const SCHEME_PUBLICKEY = 'publickey';
+ public const SCHEME_OPENSTACK = 'openstack';
+ public const SCHEME_SMB = 'smb';
use VisibilityTrait;
use FrontendDefinitionTrait;
@@ -90,10 +74,8 @@ class AuthMechanism implements \JsonSerializable {
/**
* Serialize into JSON for client-side JS
- *
- * @return array
*/
- public function jsonSerialize() {
+ public function jsonSerialize(): array {
$data = $this->jsonSerializeDefinition();
$data += $this->jsonSerializeIdentifier();
@@ -118,5 +100,4 @@ class AuthMechanism implements \JsonSerializable {
return $this->validateStorageDefinition($storage);
}
-
}