summaryrefslogtreecommitdiffstats
path: root/apps/files_external/appinfo
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-09-13 19:38:22 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-09-13 19:38:22 +0100
commit0dc71813354407fad8fa1db113d75cad78dfc12f (patch)
treeb34b739c2035808f08b8d92dac5ff1a40977b6ea /apps/files_external/appinfo
parent2e7d50b7233dd812a0cca8bdc433fbfa41b8b31e (diff)
parent442f5269ef229afa09cbe1e06b2a73bb9656e8c4 (diff)
downloadnextcloud-server-0dc71813354407fad8fa1db113d75cad78dfc12f.tar.gz
nextcloud-server-0dc71813354407fad8fa1db113d75cad78dfc12f.zip
Merge pull request #18441 from owncloud/ext-backends.advanced
Migrate advanced external storage backends to new registration API [part 3]
Diffstat (limited to 'apps/files_external/appinfo')
-rw-r--r--apps/files_external/appinfo/app.php47
-rw-r--r--apps/files_external/appinfo/application.php23
-rw-r--r--apps/files_external/appinfo/routes.php2
3 files changed, 11 insertions, 61 deletions
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index 9db4b0a6330..f33012b5f09 100644
--- a/apps/files_external/appinfo/app.php
+++ b/apps/files_external/appinfo/app.php
@@ -37,11 +37,9 @@ OC::$CLASSPATH['OC\Files\Storage\OwnCloud'] = 'files_external/lib/owncloud.php';
OC::$CLASSPATH['OC\Files\Storage\Google'] = 'files_external/lib/google.php';
OC::$CLASSPATH['OC\Files\Storage\Swift'] = 'files_external/lib/swift.php';
OC::$CLASSPATH['OC\Files\Storage\SMB'] = 'files_external/lib/smb.php';
-OC::$CLASSPATH['OC\Files\Storage\SMB_OC'] = 'files_external/lib/smb_oc.php';
OC::$CLASSPATH['OC\Files\Storage\AmazonS3'] = 'files_external/lib/amazons3.php';
OC::$CLASSPATH['OC\Files\Storage\Dropbox'] = 'files_external/lib/dropbox.php';
OC::$CLASSPATH['OC\Files\Storage\SFTP'] = 'files_external/lib/sftp.php';
-OC::$CLASSPATH['OC\Files\Storage\SFTP_Key'] = 'files_external/lib/sftp_key.php';
OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php';
OC::$CLASSPATH['OCA\Files\External\Api'] = 'files_external/lib/api.php';
@@ -68,51 +66,6 @@ if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == '
// connecting hooks
OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\OC_Mount_Config', 'initMountPointsHook');
-OCP\Util::connectHook('OC_User', 'post_login', 'OC\Files\Storage\SMB_OC', 'login');
-OC_Mount_Config::registerBackend('\OC\Files\Storage\Swift', [
- 'backend' => (string)$l->t('OpenStack Object Storage'),
- 'priority' => 100,
- 'configuration' => [
- 'user' => (string)$l->t('Username'),
- 'bucket' => (string)$l->t('Bucket'),
- 'region' => '&'.$l->t('Region (optional for OpenStack Object Storage)'),
- 'key' => '&*'.$l->t('API Key (required for Rackspace Cloud Files)'),
- 'tenant' => '&'.$l->t('Tenantname (required for OpenStack Object Storage)'),
- 'password' => '&*'.$l->t('Password (required for OpenStack Object Storage)'),
- 'service_name' => '&'.$l->t('Service Name (required for OpenStack Object Storage)'),
- 'url' => '&'.$l->t('URL of identity endpoint (required for OpenStack Object Storage)'),
- 'timeout' => '&'.$l->t('Timeout of HTTP requests in seconds'),
- ],
- 'has_dependencies' => true,
-]);
-
-
-if (!OC_Util::runningOnWindows()) {
- OC_Mount_Config::registerBackend('\OC\Files\Storage\SMB_OC', [
- 'backend' => (string)$l->t('SMB / CIFS using OC login'),
- 'priority' => 90,
- 'configuration' => [
- 'host' => (string)$l->t('Host'),
- 'username_as_share' => '!'.$l->t('Username as share'),
- 'share' => '&'.$l->t('Share'),
- 'root' => '&'.$l->t('Remote subfolder'),
- ],
- 'has_dependencies' => true,
- ]);
-}
-
-OC_Mount_Config::registerBackend('\OC\Files\Storage\SFTP_Key', [
- 'backend' => (string)$l->t('SFTP with secret key login'),
- 'priority' => 100,
- 'configuration' => array(
- 'host' => (string)$l->t('Host'),
- 'user' => (string)$l->t('Username'),
- 'public_key' => (string)$l->t('Public key'),
- 'private_key' => '#private_key',
- 'root' => '&'.$l->t('Remote subfolder')),
- 'custom' => 'sftp_key',
- ]
-);
$mountProvider = $appContainer->query('OCA\Files_External\Config\ConfigAdapter');
\OC::$server->getMountProviderCollection()->registerProvider($mountProvider);
diff --git a/apps/files_external/appinfo/application.php b/apps/files_external/appinfo/application.php
index aa9e4fd913e..3a222141fb5 100644
--- a/apps/files_external/appinfo/application.php
+++ b/apps/files_external/appinfo/application.php
@@ -24,7 +24,6 @@
namespace OCA\Files_External\AppInfo;
-use \OCA\Files_External\Controller\AjaxController;
use \OCP\AppFramework\App;
use \OCP\IContainer;
use \OCA\Files_External\Service\BackendService;
@@ -36,18 +35,6 @@ class Application extends App {
public function __construct(array $urlParams=array()) {
parent::__construct('files_external', $urlParams);
- $container = $this->getContainer();
-
- /**
- * Controllers
- */
- $container->registerService('AjaxController', function (IContainer $c) {
- return new AjaxController(
- $c->query('AppName'),
- $c->query('Request')
- );
- });
-
$this->loadBackends();
$this->loadAuthMechanisms();
@@ -73,11 +60,14 @@ class Application extends App {
$container->query('OCA\Files_External\Lib\Backend\AmazonS3'),
$container->query('OCA\Files_External\Lib\Backend\Dropbox'),
$container->query('OCA\Files_External\Lib\Backend\Google'),
+ $container->query('OCA\Files_External\Lib\Backend\Swift'),
+ $container->query('OCA\Files_External\Lib\Backend\SFTP_Key'),
]);
if (!\OC_Util::runningOnWindows()) {
$service->registerBackends([
$container->query('OCA\Files_External\Lib\Backend\SMB'),
+ $container->query('OCA\Files_External\Lib\Backend\SMB_OC'),
]);
}
}
@@ -106,6 +96,13 @@ class Application extends App {
// AuthMechanism::SCHEME_OAUTH2 mechanisms
$container->query('OCA\Files_External\Lib\Auth\OAuth2\OAuth2'),
+ // AuthMechanism::SCHEME_PUBLICKEY mechanisms
+ $container->query('OCA\Files_External\Lib\Auth\PublicKey\RSA'),
+
+ // AuthMechanism::SCHEME_OPENSTACK mechanisms
+ $container->query('OCA\Files_External\Lib\Auth\OpenStack\OpenStack'),
+ $container->query('OCA\Files_External\Lib\Auth\OpenStack\Rackspace'),
+
// Specialized mechanisms
$container->query('OCA\Files_External\Lib\Auth\AmazonS3\AccessKey'),
]);
diff --git a/apps/files_external/appinfo/routes.php b/apps/files_external/appinfo/routes.php
index 5d7018c3476..a371273e74e 100644
--- a/apps/files_external/appinfo/routes.php
+++ b/apps/files_external/appinfo/routes.php
@@ -38,7 +38,7 @@ namespace OCA\Files_External\AppInfo;
'routes' => array(
array(
'name' => 'Ajax#getSshKeys',
- 'url' => '/ajax/sftp_key.php',
+ 'url' => '/ajax/public_key.php',
'verb' => 'POST',
'requirements' => array()
)