Commit Graph

466 Commits

Author SHA1 Message Date
Roeland Jago Douma 4bb96a5553 Construct valid URL 2016-02-03 11:29:36 +01:00
Roeland Jago Douma dc32f49c6e [Share 2.0] Use GenericShareException 2016-02-02 14:23:45 +01:00
Roeland Jago Douma 4d7130ad31 [Share 2.0] Add exceptions to OCP 2016-02-02 14:07:11 +01:00
Roeland Jago Douma 6151a0540b Update the initiator of the share as well in migration 2016-01-28 19:24:23 +01:00
Roeland Jago Douma b85770d636 Update reshares in batches as not to run out of memory 2016-01-28 19:24:23 +01:00
Björn Schießle dc8d43575f upgrade to sharing 2.0, remove hierarchical re-shares 2016-01-28 19:24:23 +01:00
Roeland Jago Douma 2831884e74 Fix OCS unit tests after two share merges
* Use getNode
* Return IShare object so typechecking is happy
2016-01-28 13:17:16 +01:00
Thomas Müller 295de6aad7 Merge pull request #21960 from owncloud/share2_ocs_fix_passing_empty_strings
Share2 ocs fix passing empty strings
2016-01-28 11:58:35 +01:00
Robin Appelman 1369f2c684 cleanup shared cache 2016-01-28 11:46:43 +01:00
Roeland Jago Douma 34e912ab6b [Share 2.0] Fix interfaces and comments
* Made comments more clear
* Removed unneeded methods
* IShares shareTime is now a proper DateTime object
* IShares getPath -> getNode & setPath -> setNode
* Fix unit tests
2016-01-28 07:54:09 +01:00
Roeland Jago Douma 185b9c6edd [Share 2.0] Move IShare to OCP 2016-01-27 22:04:37 +01:00
Roeland Jago Douma 6957917b20 [Share 2.0] Allow using permissions to update link share 2016-01-27 20:36:36 +01:00
Roeland Jago Douma f5c45dfe7b [Share 2.0] Still allow isolated updates
Still allow isolated updates of parameters
2016-01-27 20:36:31 +01:00
Roeland Jago Douma b321ceef60 [Share 2.0] Also handle empty parameter in updateShare
* More sanity checks
* More unit tests
2016-01-27 20:34:06 +01:00
Roeland Jago Douma 35a3432793 [Share 2.0] When passing empty strings don't fail
The password and expiration date can be set to empty strings when
created. This is now handled gracefully.
2016-01-27 20:34:06 +01:00
Joas Schilling d46cd6a245 Fix tests 2016-01-26 14:02:32 +01:00
Roeland Jago Douma 18421e7e68 Directly get from the server container
* Updated unit tests
2016-01-20 21:12:26 +01:00
Roeland Jago Douma 8734ebe505 [Share 2.0] Make link share download use share manager 2016-01-20 21:12:26 +01:00
Roeland Jago Douma 717697313b [Share 2.0] Move tests over the sharemanager
Nice side effect... pure unit tests!
2016-01-20 21:12:26 +01:00
Roeland Jago Douma d33e578665 [Share 2.0] Add share owner information to OCS Share API 2016-01-15 20:21:47 +01:00
Robin Appelman 5d0451b848 Safe teardowns 2016-01-14 12:54:42 +01:00
Roeland Jago Douma cbd3050f4c [Share 2.0] Use full share id (providerId:shareId)
Now that we support multiple managers we communicate shares to the
outside as 'providerId:shareId'. This makes sures that id's are unique
when references from the OCS API.

However, since we do not want to break the OCS API v1 we need to
somewhat hack around this.

When we switch to OCS API v2 (which we should when we support more
custom providers). We will change the id to always be the fullShareId.
2016-01-13 16:35:15 +01:00
Thomas Müller 682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Roeland Jago Douma be8125b8e2 Add unit tests to make sure we do not lower the search 2016-01-12 10:34:38 +01:00
Roeland Jago Douma 98c4951f45 getLowStrengthGenerator does not do anything anymore 2016-01-11 19:59:15 +01:00
Roeland Jago Douma 17a066c18e Properly close db cursors 2016-01-08 20:27:01 +01:00
Roeland Jago Douma 629bac22fd Make sure to respect deleted group shares by user 2016-01-08 20:27:01 +01:00
Roeland Jago Douma 066e3770bb Make sure that permissions stay in sync for share_type 2
When a file/folder is shared with a group and one of the group members
moves this file/folder an extra entry is created in the share table.

When the permission of the group share is updated we used to only
sometimes update the shares for individual users.

* Added intergration tests
2016-01-08 20:27:01 +01:00
Vincent Petry 9b595474af Fix public page URL JS test
Stub the port so it doesn't use the one configured by karma
2016-01-08 13:25:38 +01:00
Thomas Müller 601457d221 Merge pull request #20773 from owncloud/share2.0_create
[Sharing 2.0] create share
2016-01-07 14:57:05 +01:00
Vincent Petry 9742e9b113 Add token in webdav download link of public page 2016-01-07 13:37:18 +01:00
Roeland Jago Douma 527b434cd2 [Sharing 2.0] Do not use static function to get numeric storage id 2016-01-06 14:53:43 +01:00
Roeland Jago Douma 38d3a638ed [Share 2.0] Enable share creation via OCS API 2016-01-06 14:53:43 +01:00
Roeland Jago Douma 1f715289bf Removed deprecated function OC_User::deleteUser
Replaced with proper OCP calls
2015-12-17 16:18:40 +01:00
Roeland Jago Douma 835911bce5 Removed deprecated private OC_User::createUser
All function calls are replaced with the recommended (which was already
the body of the function).
2015-12-17 16:18:40 +01:00
Thomas Müller 1285b78086 Merge pull request #21200 from owncloud/files-authorizationheader
Use Authorization headers for public webdav in web UI
2015-12-17 15:30:13 +01:00
Thomas Müller 1ecda59c24 Merge pull request #21189 from owncloud/fix_21187
File shares can't have create permissions
2015-12-15 13:18:22 +01:00
Vincent Petry 1d37e7abfc Fixed JS unit tests for fed owner display name 2015-12-14 18:00:35 +01:00
Vincent Petry ab9849e72f Use Authorization headers for public webdav instead of URL
Instead of prepending the token as username in the URL, use the
Authorization header instead. This is because IE9 considers this a
cross-domain call and refuses to do it in the first place.
2015-12-14 17:42:13 +01:00
Björn Schießle c4b65170f2 show display name but internally use the user name 2015-12-14 17:25:10 +01:00
Roeland Jago Douma 843cf906b1 File shares can't have create permissions
fixes #21187
2015-12-14 14:03:14 +01:00
Robin Appelman 3d5a7b307f Add test case for group share propagation 2015-12-10 13:53:50 +01:00
Joas Schilling 5453daab03 More fixes to the docs 2015-12-08 09:11:50 +01:00
Scrutinizer Auto-Fixer 0f1be1b601 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-12-07 20:08:20 +00:00
Scrutinizer Auto-Fixer 453e1bf66e Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-12-07 15:43:36 +00:00
Joas Schilling 372f54075f Only return the exact match, when it's allowed 2015-12-02 16:01:01 +01:00
Thomas Müller fd79511d68 Merge pull request #20688 from owncloud/publiclink-getdownloadurl-webdav
Fix public link getDownloadUrl to return Webdav public link
2015-11-30 15:07:36 +01:00
Thomas Müller 757aa45db7 Adding more DB groups to test suits
Adding more DB groups to test suits
2015-11-30 10:55:06 +01:00
Thomas Müller 3bb6dcea64 Apply DB group annotation ... 2015-11-30 10:55:05 +01:00
Vincent Petry 42091cecf9 Fix public link getDownloadUrl to return Webdav public link
This is for apps that use getDownloadUrl() to access the Webdav endpoint
for example for streaming.
Also happens when clicking on the download action of a file.

Note that the regular visible download URL is still the same.
2015-11-25 17:39:49 +01:00
Thomas Müller 9ec2f8886e Merge pull request #20691 from owncloud/share2.0_di_fixes
[Sharing 2.0] di fixes
2015-11-25 15:25:50 +01:00
Thomas Müller 50f6817ce9 Merge pull request #20439 from owncloud/etag-propagate-in-storage
Take submount etag into account for folder etags
2015-11-25 12:49:54 +01:00
Roeland Jago Douma 8d309767d7 [Sharing 2.0] Use the rootfolder to get the path of a share
We need to use the rootfolder here since we also other people than the
shareOwner can request a share.
2015-11-24 10:26:36 +01:00
Roeland Jago Douma ab02b5c36e [Sharing 2.0] Move authentication to the OCS API 2015-11-24 10:26:36 +01:00
Roeland Jago Douma aeae73b364 [Sharing 2.0] Removed unused DI stuff
The share manager etc should not care about filtering stuff. They should
return what is asked for them.
2015-11-24 10:26:36 +01:00
Thomas Müller ab1d786d87 Fix port issue - options.host already has the port attached 2015-11-22 16:05:51 +01:00
Vincent Petry f20232d4bd Make public link share page work with Webdav and add operations
The public page now uses the public.php/webdav endpoint.

Also enabled more file operations like rename, move, delete and create
folder from the public page, which are now all possible thanks to the
public.php/webdav endpoint.
2015-11-22 16:05:50 +01:00
Vincent Petry fa2be0750c Make files app use Webdav for most operations 2015-11-22 16:05:50 +01:00
Robin Appelman a95d4c2b22 update tests 2015-11-19 13:32:04 +01:00
Robin Appelman 888df3933d take the etag of child mounts into account for the folder etag
this replaces shared etag propagation
2015-11-19 13:32:00 +01:00
Roeland Jago Douma 1e9fc33212 [Share2.0] OCS Share API getShare uses new code 2015-11-16 13:32:28 +01:00
Robin Appelman 20cad09f7f Add tests for FileInfo owner 2015-11-10 11:06:48 +01:00
Roeland Jago Douma 6624fa212a The new sharing code now handles deletion
OCS -> ShareManager -> DefaultShareProvider
2015-11-05 15:59:09 +01:00
Vincent Petry dcfaf3afdc Bring back delete permission in share overview 2015-10-29 17:56:54 +01:00
Lukas Reschke 8f09d5b67c Update license headers 2015-10-26 14:04:01 +01:00
Lukas Reschke 13e817e901 Throw exception on `getPath` if file does not exist
Currently the `getPath` methods returned `NULL` in case when a file with the specified ID does not exist. This however mandates that developers are checking for the `NULL` case and if they do not the door for bugs with all kind of impact is widely opened.

This is especially harmful if used in context with Views where the final result is limited based on the result of `getPath`, if `getPath` returns `NULL` PHP type juggles this to an empty string resulting in all possible kind of bugs.

While one could argue that this is a misusage of the API the fact is that it is very often misused and an exception will trigger an immediate stop of execution as well as log this behaviour and show a pretty error page.

I also adjusted some usages where I believe that we need to catch these errors, in most cases this is though simply an error that should hard-fail.
2015-10-25 17:58:21 +01:00
Roeland Jago Douma ec296b0b7d Add backgroundjob to expire link shares
Simple background job to expire the link shares.

* added unit tests
2015-10-20 08:18:53 +02:00
Robin Appelman 8efd037eb8 Make shared folder size propagation test work with object home storage 2015-10-16 21:41:51 +02:00
Robin Appelman e7f75484f8 Fix shared storage tests for non local home storage 2015-10-16 21:41:51 +02:00
Robin Appelman 0cdd46de60 fix sabre connector tests when using a non local home storage 2015-10-16 21:41:51 +02:00
Thomas Müller 17ffa4a244 Merge pull request #19414 from owncloud/swift_primary_storage_tests
Swift primary storage tests
2015-10-08 14:08:56 +02:00
Thomas Müller b2872ef759 Merge pull request #19589 from owncloud/shares-external-mount-provider
Move the setup of external share mounts to a mountprovider
2015-10-07 17:46:33 +02:00
Robin Appelman 59cf817308 Merge pull request #19511 from owncloud/etag-share-permissions-update
Mark shares as dirty when changing permissions
2015-10-06 18:09:12 +02:00
Jörn Friedrich Dreyer 5646e39248 test objectstore with ceph docker
use default config for swift primary storage test config

allow testsuite to complete

fix timeout, script cleanup, enable debug for now

use btrfs loopback device, requires privileged container and absolute path

throw exception when storage has problems

debug by echo ...

sleep more, more debug
2015-10-06 16:27:25 +02:00
Vincent Petry d546c5bb59 Propagate shares etag when group membership changed 2015-10-06 15:02:22 +02:00
Robin Appelman 41f9946272 clear hooks for tests 2015-10-06 11:38:41 +02:00
Robin Appelman 0817024e6f Mark shares as dirty when changing permissions 2015-10-06 11:38:41 +02:00
Morris Jobke b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Robin Appelman 52c8b488cb fix test 2015-10-05 16:43:10 +02:00
Robin Appelman 76a528e511 Make the external share manager a mount provider 2015-10-05 16:18:14 +02:00
Thomas Müller 710b7dd81c Merge pull request #19487 from owncloud/split_share_middleware
Split files_sharing middelware
2015-10-05 10:57:11 +02:00
Roeland Jago Douma 4adc78b78b Fix and extend unit tests 2015-10-02 12:45:52 +02:00
Roeland Jago Douma 3d2acb5003 sharingcheckmiddleware now handles externalshares as well
Added new annotations for the externalsharescontroller class
* @NoOutgoingFederatedSharingRequired
* @NoIncomingFederatedSharingRequired

By default both are required for all functions in the
externalSharesController.

A proper exception is thrown and then a 405 is returned instead of the
default error page. Since it is only an API endpoint this makes more
sense.

Unit tests added and updated
2015-10-02 12:03:53 +02:00
Roeland Jago Douma dc38e674a5 Split files_sharing middelware
Since for external shares there is no need for link shares to be enabled
we should check which controller is actually being called.

This makes sure that in all cases we verify that the files_sharing app
is enabled. But only for the share controller (public shares) we check
if the API is enabled and if links are enabled.

TODO: add checks for federated sharing as well
2015-10-02 11:56:11 +02:00
Joas Schilling 17ab8e6c39 Use shorter text on the sidebar for files_sharing activities 2015-10-02 10:01:33 +02:00
Lukas Reschke 22e724e829 Only intercept exceptions of type "NotFoundException" instead of any Exception
The sharing backend may throw another exception for example when the activity app encounters a problem. Previously this just triggered a 404 error page and the exception got not logged at all. With this change such exceptions get not intercepted and regularly handled as exceptions so that we have meaningful log data. Also the user will be shown a window informing him that an error happened.

Helps to debug cases such as https://github.com/owncloud/core/issues/19465
2015-09-30 13:32:20 +02:00
Vincent Petry d47d240a35 Still show share link when recipient but no share permission
This makes it possible for the recipient to still trigger the sidebar
and share tab to see information about the share.

In the case where the file is not shared and no permissions exists, no
action icon will be displayed.
2015-09-28 16:23:33 +02:00
Roeland Jago Douma db02173627 Reflect enabled shareAPI in capabilities
If the shareAPI is disabled we not return the other sharing
capabilities.

This allows clients to properly check if sharing is even available.
2015-09-25 20:12:41 +02:00
Joas Schilling 19e7a08cbf Do not allow user enumeration if the config is disabled 2015-09-23 15:11:02 +02:00
Roeland Jago Douma 4dba046712 Respect disabled sharing API settings
If the sharing API setting is disabled that sharing check middle ware
should block the request. Thus making link shares unavailable.
Fixes #18970

* Unit test added
* Unit tests updated
2015-09-22 15:12:16 +02:00
Lukas Reschke 36ce254ffd Move dummy backend to Tests namespace 2015-09-22 11:01:11 +02:00
Thomas Müller 93eb73b0bb Merge pull request #18986 from owncloud/federated_capabilities
Expose federated sharing capabilities to authenticated users
2015-09-18 11:58:54 +02:00
Thomas Müller 4cff2f1ab3 Merge pull request #19046 from owncloud/issue-18924-throw-error-on-invalid-page
Throw an error when the page count or perPage setting is invalid
2015-09-17 13:02:14 +02:00
Vincent Petry 886f1ed660 Update JS unit tests for share dialog (WIP) 2015-09-16 07:23:29 +02:00
Joas Schilling 754850f473 Fix status code 2015-09-15 15:51:54 +02:00
Roeland Jago Douma 91dfcab055 Expose federated sharing capabilities to authenticated users 2015-09-15 15:10:13 +02:00
Joas Schilling aa8b1b2894 Throw an error when the page count or perPage setting is invalid 2015-09-15 15:04:04 +02:00
Joas Schilling 665716095b Fix parameter name to match the specs 2015-09-15 12:14:14 +02:00
Joas Schilling 805f1d0096 Scrap the notifications when the share is accepted or declined 2015-09-08 09:01:01 +02:00
Björn Schießle 39bd4ea8f2 Merge pull request #18234 from owncloud/ocs_api_for_sharees_list
Add OCS API for sharees list
2015-09-01 17:09:57 +02:00