Commit Graph

49 Commits

Author SHA1 Message Date
Robin Appelman c2c6caee93 remove global credentials 2016-02-17 13:55:27 +01:00
Jesús Macias 8fa96435b0 Add credentials dialog for user provided auth 2016-02-04 16:33:08 +01:00
Robin Appelman 9dfe9f77f2 Add global auth backend for files external 2016-02-04 14:57:17 +01:00
Thomas Müller a2e13aea15 Merge pull request #21909 from owncloud/files-external-visibility
Prevent invalid storages being displayed in the storages view
2016-02-01 15:05:54 +01:00
Robin Appelman 6b18134ceb inject logger 2016-01-29 14:51:30 +01:00
Robin Appelman efcf790eff minor fixes 2016-01-29 14:51:30 +01:00
Robin Appelman 03c79ac24f remove custom controler for user provided password auth 2016-01-29 14:51:30 +01:00
Robin Appelman 860d51487b Allow setting user provided credentials from the personal settings page 2016-01-29 14:51:30 +01:00
Robin Appelman f3e9729a5f expose user provided credentials for admin mounts 2016-01-29 14:50:52 +01:00
Robin Appelman 419507c118 Add user provided credentials mechanism 2016-01-29 14:50:52 +01:00
Robin McCorkell 30509a479f Prevent invalid storages being displayed in the storages view 2016-01-26 10:41:59 +00:00
Robin Appelman 7ba715d144 fix test 2016-01-18 12:08:58 +01:00
Robin Appelman 7e01f32c27 Pass the user when updating external storage status 2016-01-18 11:10:41 +01:00
Thomas Müller f0c869d22e Merge pull request #21662 from owncloud/external-list-non-admin
Allow non admins to list their own mounts
2016-01-13 11:01:27 +01:00
Robin Appelman b1a706999f Allow non admins to list their own mounts 2016-01-12 17:46:53 +01:00
Thomas Müller 682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Jesús Macias f4f53e328d Fix duplicate use in storage controller 2015-12-03 10:00:01 +01:00
Jesús Macias 98f5c50aa4 Migrate storate status code to storagenotavailablexception 2015-12-03 09:59:45 +01:00
Jesús Macias 4ead2bc861 Fix code from PR comments 2015-12-03 09:58:55 +01:00
Jesús Macias 9d1ec02c5a Change exception catch order 2015-12-03 09:58:30 +01:00
Jesús Macias 7cd13f462a Add new external storage exceptions for different errors 2015-12-03 09:57:59 +01:00
Jesús Macias b17f26834d Add different storage status codes managed by StoragedNotAvailableException 2015-12-03 09:57:54 +01:00
Robin McCorkell 8f4b780a90 Fix external storage priority logic 2015-11-21 22:54:21 +00:00
Robin McCorkell 28876bf463 Display applicable global storages in personal mount list 2015-11-21 22:54:21 +00:00
Robin McCorkell a1704c8623 Render external storages list in JS 2015-11-21 22:54:21 +00:00
Robin McCorkell 9a4d37f626 Display storage status as tooltip 2015-10-23 15:25:07 +02:00
Morris Jobke 8366ce2767 deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
Morris Jobke b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Robin McCorkell 2404333300 Perform visibility checks on storages
StoragesService::getStorages() will check the visibility of the backend
and auth mechanism for the storage, and if either are not visible to the
user (aka disabled by admin) then the storage will be filtered out. The
original method StoragesService::getAllStorages() still exists in case
such storages need to be detected, but its use is discouraged.
2015-09-23 16:00:11 +01: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 d2e3c17c00 Introduce MODIFY permission for external storages 2015-08-28 17:43:30 +01:00
Robin McCorkell f0c8cfa9a6 Validate permissions for created admin storages, auth mechanism
Backend and auth mechanism permissions are checked on storage creation,
both for personal storages and for admin storages
2015-08-28 17:28:44 +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 080fafe63a AjaxController uses RSA auth mechanism 2015-08-28 12:58:47 +01:00
Robin McCorkell 63218ec098 Prevent objectstore being set from client side 2015-08-25 16:14:31 +01:00
Robin McCorkell b6eb952ac6 Propagate auth mechanism/backend failures to filesystem layer
Failure to prepare the storage during backend or auth mechanism
manipulation will throw an InsufficientDataForMeaningfulAnswerException,
which is propagated to StorageNotAvailableException in the filesystem
layer via the FailedStorage helper class.

When a storage is unavailable not due to failure, but due to
insufficient data being available, a special 'indeterminate' status is
returned to the configuration UI.
2015-08-19 10:08:23 +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
Andreas Fischer 3b803db6d8 Update phpseclib to 2.0 2015-08-03 09:43:45 +02:00
Jenkins for ownCloud b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Vincent Petry e5e30924b1 Fix PHPDoc in files_external, add missing tag
Fix various PHPDoc issues in external storage app.

Added missing NoAdminRequired tag
2015-03-17 11:42:52 +01:00
Vincent Petry 06448170cf Fix PHPDoc for StoragesController 2015-03-16 14:39:48 +01:00
Vincent Petry 72632ad402 Generate storage config ids when missing
When reading in old mount.json files, they do not contain config ids.
Since these are needed to be able to use the UI and the new service
classes, these will be generated automatically.

The config grouping is based on a config hash.
2015-03-16 12:18:01 +01:00
Vincent Petry 34c8b1ac77 Mount options for ext storage are now passed around
The mount options are now passed to the UI and stored in a hidden field.
The ext storage controllers and services also know how to load/save them
from the legacy config.
2015-03-13 12:49:11 +01:00
Vincent Petry ce94a998dd Use storage id + appframework for ext storage CRUD
- Added StorageConfig class to replace ugly arrays
- Implemented StorageService and StorageController for Global and User
  storages
- Async status checking for storages (from Xenopathic)
- Auto-generate id for external storage configs (not the same as
  storage_id)
- Refactor JS classes for external storage settings, this mostly
  moves/encapsulated existing global event handlers into the
  MountConfigListView class.
- Added some JS unit tests for the external storage UI
2015-03-12 18:51:02 +01:00
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +01:00
Jenkins for ownCloud 6a1a4880f0 Updating license headers 2015-02-23 12:13:59 +01:00
Ross Nicoll 64f4f8fc84 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
2015-01-14 17:00:34 +00:00