summaryrefslogtreecommitdiffstats
path: root/apps/files_external/appinfo
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-08-12 22:20:08 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-08-28 12:58:47 +0100
commit1084e3adc7636787a139b68335112715b187b3bb (patch)
tree5f3d22280f28ad0328f8ed811bbab3c3c1152831 /apps/files_external/appinfo
parentcb1ef827028126dd55c21fc3f3720723e5cc25a6 (diff)
downloadnextcloud-server-1084e3adc7636787a139b68335112715b187b3bb.tar.gz
nextcloud-server-1084e3adc7636787a139b68335112715b187b3bb.zip
Migrate SFTP_Key external storage to new API
The SFTP backend now supports public key authentication alongside password authentication.
Diffstat (limited to 'apps/files_external/appinfo')
-rw-r--r--apps/files_external/appinfo/app.php13
-rw-r--r--apps/files_external/appinfo/application.php4
-rw-r--r--apps/files_external/appinfo/routes.php2
3 files changed, 5 insertions, 14 deletions
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index 351b87c4c8b..f33012b5f09 100644
--- a/apps/files_external/appinfo/app.php
+++ b/apps/files_external/appinfo/app.php
@@ -40,7 +40,6 @@ OC::$CLASSPATH['OC\Files\Storage\SMB'] = 'files_external/lib/smb.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,17 +67,5 @@ if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == '
// connecting hooks
OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\OC_Mount_Config', 'initMountPointsHook');
-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 e5275c29b39..ed236af0ec5 100644
--- a/apps/files_external/appinfo/application.php
+++ b/apps/files_external/appinfo/application.php
@@ -69,6 +69,7 @@ class Application extends App {
$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()) {
@@ -103,6 +104,9 @@ 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'),
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()
)