summaryrefslogtreecommitdiffstats
path: root/apps/files_external/appinfo
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-09-15 19:36:43 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-09-15 19:36:43 +0100
commit0667c4363d2777b3534e72afe536eb9a9aa0ef3e (patch)
treec6d60bfea748404f01d0208d9ac08680fbbede06 /apps/files_external/appinfo
parent6379b1932ff6440865f765a918ff097849ed785f (diff)
parent230029e5090b3deecb941e75bbc34a6bcb98c374 (diff)
downloadnextcloud-server-0667c4363d2777b3534e72afe536eb9a9aa0ef3e.tar.gz
nextcloud-server-0667c4363d2777b3534e72afe536eb9a9aa0ef3e.zip
Merge branch 'master' into smb-workgroup
Diffstat (limited to 'apps/files_external/appinfo')
-rw-r--r--apps/files_external/appinfo/app.php102
-rw-r--r--apps/files_external/appinfo/application.php40
-rw-r--r--apps/files_external/appinfo/routes.php10
3 files changed, 32 insertions, 120 deletions
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index 3d8e610db4d..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,106 +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\AmazonS3', [
- 'backend' => (string)$l->t('Amazon S3'),
- 'priority' => 100,
- 'configuration' => [
- 'key' => (string)$l->t('Key'),
- 'secret' => '*'.$l->t('Secret'),
- 'bucket' => (string)$l->t('Bucket'),
- ],
- 'has_dependencies' => true,
-]);
-
-OC_Mount_Config::registerBackend('\OC\Files\Storage\AmazonS3', [
- 'backend' => (string)$l->t('Amazon S3 and compliant'),
- 'priority' => 100,
- 'configuration' => [
- 'key' => (string)$l->t('Access Key'),
- 'secret' => '*'.$l->t('Secret Key'),
- 'bucket' => (string)$l->t('Bucket'),
- 'hostname' => '&'.$l->t('Hostname'),
- 'port' => '&'.$l->t('Port'),
- 'region' => '&'.$l->t('Region'),
- 'use_ssl' => '!'.$l->t('Enable SSL'),
- 'use_path_style' => '!'.$l->t('Enable Path Style')
- ],
- 'has_dependencies' => true,
-]);
-
-OC_Mount_Config::registerBackend('\OC\Files\Storage\Dropbox', [
- 'backend' => 'Dropbox',
- 'priority' => 100,
- 'configuration' => [
- 'configured' => '#configured',
- 'app_key' => (string)$l->t('App key'),
- 'app_secret' => '*'.$l->t('App secret'),
- 'token' => '#token',
- 'token_secret' => '#token_secret'
- ],
- 'custom' => 'dropbox',
- 'has_dependencies' => true,
-]);
-
-OC_Mount_Config::registerBackend('\OC\Files\Storage\Google', [
- 'backend' => 'Google Drive',
- 'priority' => 100,
- 'configuration' => [
- 'configured' => '#configured',
- 'client_id' => (string)$l->t('Client ID'),
- 'client_secret' => '*'.$l->t('Client secret'),
- 'token' => '#token',
- ],
- 'custom' => 'google',
- 'has_dependencies' => true,
-]);
-
-
-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 4520a8737be..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,20 +35,13 @@ 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();
+
+ // app developers: do NOT depend on this! it will disappear with oC 9.0!
+ \OC::$server->getEventDispatcher()->dispatch(
+ 'OCA\\Files_External::loadAdditionalBackends'
+ );
}
/**
@@ -65,11 +57,17 @@ class Application extends App {
$container->query('OCA\Files_External\Lib\Backend\DAV'),
$container->query('OCA\Files_External\Lib\Backend\OwnCloud'),
$container->query('OCA\Files_External\Lib\Backend\SFTP'),
+ $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'),
]);
}
}
@@ -91,6 +89,22 @@ class Application extends App {
// AuthMechanism::SCHEME_PASSWORD mechanisms
$container->query('OCA\Files_External\Lib\Auth\Password\Password'),
$container->query('OCA\Files_External\Lib\Auth\Password\SessionCredentials'),
+
+ // AuthMechanism::SCHEME_OAUTH1 mechanisms
+ $container->query('OCA\Files_External\Lib\Auth\OAuth1\OAuth1'),
+
+ // 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 4462ad1f274..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()
)
@@ -46,10 +46,10 @@ namespace OCA\Files_External\AppInfo;
)
);
-$this->create('files_external_dropbox', 'ajax/dropbox.php')
- ->actionInclude('files_external/ajax/dropbox.php');
-$this->create('files_external_google', 'ajax/google.php')
- ->actionInclude('files_external/ajax/google.php');
+$this->create('files_external_oauth1', 'ajax/oauth1.php')
+ ->actionInclude('files_external/ajax/oauth1.php');
+$this->create('files_external_oauth2', 'ajax/oauth2.php')
+ ->actionInclude('files_external/ajax/oauth2.php');
$this->create('files_external_list_applicable', '/applicable')