Commit Graph

33 Commits

Author SHA1 Message Date
Robin McCorkell 4717605d22 Fix storage backend class namespaces and move to subdir
All classes that were previously \OC\Files\Storage\FooBar are now
\OCA\Files_External\Lib\Storage\FooBar
2016-04-14 00:44:28 +01:00
Robin McCorkell 3fe802d931 Introduce 'login credentials' auth mechanism
Stores user credentials in the database after user login, uses the new
CredentialsManager class
2016-01-18 11:10:41 +01:00
Thomas Müller 682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Morris Jobke 8366ce2767 deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
Robin McCorkell 634c1c497c Mark SMB_OC and SFTP_Key as deprecated backends 2015-09-23 12:10:02 +02:00
Robin McCorkell 060d169615 Add deprecation mechanic to IdentifierTrait
Deprecation allows a backend/auth mechanism to designate an object that
it deprecates to, allowing clean transitions to updated codebases.
2015-09-23 12:10:02 +02:00
Robin McCorkell 38a260e963 Revert "Implement more fine-grained external storage permissions model"
This reverts commit 0b97a05e7b.
This reverts commit d2e3c17c00.
This reverts commit cc88c5f4b8.
2015-09-23 12:10:02 +02:00
Robin McCorkell b8cded6755 Correct manipulateStorageConfig parameter 2015-09-17 00:24:01 +01:00
Robin McCorkell 0667c4363d Merge branch 'master' into smb-workgroup 2015-09-15 19:36:43 +01:00
Robin McCorkell 522619f90e Fix dependency check for Swift and SMB_OC
Mistake caused during merging, where the API had changed
2015-09-13 21:41:02 +01:00
Robin McCorkell 0dc7181335 Merge pull request #18441 from owncloud/ext-backends.advanced
Migrate advanced external storage backends to new registration API [part 3]
2015-09-13 19:38:22 +01:00
Robin McCorkell 442f5269ef Fix Swift legacy auth mechanism fallback 2015-09-03 09:57:29 +01:00
Robin McCorkell e33d7b34fa Fix typo in SMB_OC 2015-09-03 09:57:18 +01:00
Robin McCorkell cd506f210d Make checkDependencies a real method
Replace ->setDependencyCheck(callable) with a real method
checkDependencies(). A polyfill is available for legacy storages.
2015-09-01 10:25:33 +01:00
Robin McCorkell 0b97a05e7b Prevent creation of deprecated backends 2015-08-28 17:43:41 +01:00
Robin McCorkell cc88c5f4b8 Implement more fine-grained external storage permissions model
VisibilityTrait -> PermissionsTrait

PermissionsTrait stores two sets of data, $permissions and
$allowedPermissions (analogous to $visibility and $allowedVisibility of
VisibilityTrait). Each set is a map of user type ('admin' or 'personal')
to permissions (mounting permission, create permission).

The result is that a backend can now be restricted for creation, while
still allowing it to be mounted. This is useful for deprecating backends
or auth mechanisms, preventing new storages being created, while still
allowing existing storages to be mounted.
2015-08-28 17:21:58 +01:00
Robin McCorkell 1084e3adc7 Migrate SFTP_Key external storage to new API
The SFTP backend now supports public key authentication alongside
password authentication.
2015-08-28 12:58:47 +01:00
Robin McCorkell cb1ef82702 Migrate SMB_OC external storage to new API
SMB_OC has been merged with SMB, via the identifier aliases mechanism.
Legacy migration is done to the Session Credentials password mechanism
2015-08-28 12:58:47 +01:00
Robin McCorkell 19bc5a452a Migrate Swift external storage to new API
The Rackspace/OpenStack differences have been split into separate auth
mechanisms, with correct legacy migration
2015-08-28 12:58:47 +01:00
Robin McCorkell 88a78237b0 Migrate Google external storage to new API 2015-08-25 00:22:10 +01:00
Robin McCorkell a50ef61876 Migrate Dropbox external storage to new API 2015-08-25 00:22:10 +01:00
Robin McCorkell ced04f9ad2 Migrate AmazonS3 external storage to new API 2015-08-25 00:22:10 +01:00
Robin McCorkell 6379b1932f Allow domain to be specified for SMB 2015-08-21 10:30:42 +01:00
Robin McCorkell 16389270ff Migrate SFTP external storage to new API 2015-08-19 14:41:44 +01:00
Robin McCorkell a99e524898 Migrate OwnCloud external storage to new API 2015-08-19 14:41:43 +01:00
Robin McCorkell 68418bdd34 Migrate DAV external storage to new API 2015-08-19 14:41:43 +01:00
Robin McCorkell ab8c738b8d Migrate SMB external storage to new API 2015-08-19 14:41:43 +01:00
Robin McCorkell 0f1809eced Migrate FTP external storage to new API 2015-08-19 14:41:43 +01:00
Robin McCorkell 0ffb51c6cc Migrate Local external storage to new API 2015-08-19 14:41:43 +01:00
Robin McCorkell 97dbc79c16 Compatibility shims for OC_Mount_Config
The following functions have been removed:
 - addMountPoint()
 - removeMountPoint()
 - movePersonalMountPoint()

registerBackend() has been rewritten as a shim around BackendService,
allowing legacy code to interact with the new API seamlessly

addMountPoint() was already disconnected from all production code, so
this commit completes the job and removes the function itself, along
with disconnecting and removing related functions. Unit tests have
likewise been removed.

getAbsoluteMountPoints(), getSystemMountPoints() and
getPersonalMountPoints() have been rewritten to use the StoragesServices
2015-08-19 10:08:14 +01:00
Robin McCorkell 1eeca031f8 Split backend identifiers from the class name
Prior to this, the storage class name was stored in mount.json under the
"class" parameter, and the auth mechanism class name under the
"authMechanism" parameter. This decouples the class name from the
identifier used to retrieve the backend or auth mechanism.

Now, backends/auth mechanisms have a unique identifier, which is saved in
the "backend" or "authMechanism" parameter in mount.json respectively.
An identifier is considered unique for the object it references, but the
underlying class may change (e.g. files_external gets pulled into core
and namespaces are modified).
2015-08-19 10:05:11 +01:00
Robin McCorkell 272a46ebe1 Authentication mechanisms for external storage backends
A backend can now specify generic authentication schemes that it
supports, instead of specifying the parameters for its authentication
method directly. This allows multiple authentication mechanisms to be
implemented for a single scheme, providing altered functionality.

This commit introduces the backend framework for this feature, and so at
this point the UI will be broken as the frontend does not specify the
required information.

Terminology:
 - authentication scheme
    Parameter interface for the authentication method. A backend
    supporting the 'password' scheme accepts two parameters, 'user' and
    'password'.
 - authentication mechanism
    Specific mechanism implementing a scheme. Basic mechanisms may
    forward configuration options directly to the backend, more advanced
    ones may lookup parameters or retrieve them from the session

New dropdown selector for external storage configurations to select the
authentication mechanism to be used.

Authentication mechanisms can have visibilities, just like backends.
The API was extended too to make it easier to add/remove visibilities.
In addition, the concept of 'allowed visibility' has been introduced, so
a backend/auth mechanism can force a maximum visibility level (e.g.
Local storage type) that cannot be overridden by configuration in the
web UI.

An authentication mechanism is a fully instantiated implementation. This
allows an implementation to have dependencies injected into it, e.g. an
\OCP\IDB for database operations.

When a StorageConfig is being prepared for mounting, the authentication
mechanism implementation has manipulateStorage() called,
which inserts the relevant authentication method options into the
storage ready for mounting.
2015-08-19 10:05:11 +01:00
Robin McCorkell 37beb58c6f Introduce BackendService for managing external storage backends
Backends are registered to the BackendService through new data
structures:

Backends are concrete classes, deriving from
\OCA\Files_External\Lib\Backend\Backend. During construction, the
various configuration parameters of the Backend can be set, in a design
similar to Symfony Console.

DefinitionParameter stores a parameter configuration for an external
storage: name of parameter, human-readable name, type of parameter
(text, password, hidden, checkbox), flags (optional or not).

Storages in the StoragesController now get their parameters validated
server-side (fixes a TODO).
2015-08-19 10:05:11 +01:00