-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCS endpoint to list remote shares #19386
Conversation
$shareInfo = $externalManager->getShare($params['id']); | ||
|
||
if ($shareInfo === false) { | ||
return new \OC_OCS_Result(null, 404, 'share does not exists'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/exists/exist/
Maybe remote_shares/pending or do want to use the same endpoint for normal shares in the future? This needs a PR to fix the URLs in the Pyoc client |
Possible for sharing 2.0 yes. |
9eb6858
to
8a9cec6
Compare
Hmmm ... do we really want to change the behavior of already existing public routes? This is a no go from my perspective - but maybe I missed something. |
This route was introduced in 8.2. So it is not yet officially released. |
THX. Fine then |
$getShare = $this->connection->prepare(' | ||
SELECT `remote`, `remote_id`, `share_token`, `name` | ||
SELECT * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to expose all of the data?
Thinking about password and share_token, I'm not sure they should be leaked like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I agree we should limit what we show. But we also show * in the listing of pending shares.. https://github.com/owncloud/core/blob/master/apps/files_sharing/lib/external/manager.php#L400-L430
So this doesn't introduce anything new.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay fine by me then
8a9cec6
to
9073b71
Compare
@rullzer Ready to review or not? |
@MorrisJobke not yet. I think I need to add some stuff. For #19501 to work properly. |
btw while preparing a patch for the PyoC Client to change the URL, I realised we can't reuse the same endpoint for remote and normal shares! 💣 |
@nickvergessen warg... unique id's are needed then indeed... |
9073b71
to
0e95eb6
Compare
@nickvergessen I guess this is then the most logical solution. |
Ok extra info added.. do now you actually know something about the remote shares. Review time. |
41e48b5
to
7477fa7
Compare
* list incoming remote shares at 'remote_shares' * get per share info at 'remote_shares/<ID>' * delete remote share with a DELETE to 'remote_shares/<ID>'
Since we need a unique id to accept/reject shares for now we keep the pending shares under remote_shares. * remote_shares/pending lists pending shares * PUT/DELETE to remote_shares/pending/<ID> will accept/reject the share
The data from the share_external is not to much. Thus we enrich this data with info from the filecache. This allows endpoints using this to actually show usefull information. The filecache might not be up to date but that is a sacrifice we need to make in terms of speed. Else the number of remote PROPFINDS grows lineary with the number of remote shares wich will make this endpoint practically unusable.
7477fa7
to
7ecd15d
Compare
7ecd15d
to
c924b67
Compare
Ok cleaned up a bit more so we return a little less cluttered stuff. |
OCI failure seems unrelated. |
Didn't test, but looks good. 👍 |
Works 👍 I get the JS code will need to be adjusted later. |
PyOC patch owncloud/pyocclient#122 |
Ah yes, the JS code update is here #19514 |
OCS endpoint to list remote shares
@rullzer Is this only for 8.2? |
yes |
thanks @nickvergessen |
Required for #9098
../remote_shares
->../pending_shares
../remote_shares
that allows listing of incoming remote shares.@nickvergessen since you wrote the original
../remote_shares
stuff are you fine with this?I'm not really happy with this. But as stated in #9098 (comment) this is the cleanest hack I can think of. Comments?
CC: @cmonteroluque @DeepDiver1975