From 64f4f8fc84fd8fc27f0e9e316a2c4c2500c7134f Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Fri, 19 Dec 2014 17:23:24 +0000 Subject: Add support for SFTP key authentication Add support for external files accessed via SFTP using public key exchange authentication. Keys are generated automatically when the configuration is added, or can be regenerated on demand if a key is compromised. Creation of a new configuration row now triggers focus on that row. This is used to trigger auto-configuration for SFTP keys. Generated public keys are saved in user's data directory for easy retrieval by an external application. Add controller for SFTP key generation AJAX SFTP class initialisation no longer produces a warning if the password field is missing. Add unit tests for SFTP with key authentication backend --- apps/files_external/appinfo/app.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'apps/files_external/appinfo/app.php') diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index 0aafcad559a..74f0e337a12 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -18,6 +18,7 @@ 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'; @@ -177,5 +178,17 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\SFTP', array( 'password' => '*'.$l->t('Password'), 'root' => '&'.$l->t('Remote subfolder')))); +OC_Mount_Config::registerBackend('\OC\Files\Storage\SFTP_Key', [ + 'backend' => '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 = new \OCA\Files_External\Config\ConfigAdapter(); \OC::$server->getMountProviderCollection()->registerProvider($mountProvider); -- cgit v1.2.3