-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add public-files to DAV #29369
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
Add public-files to DAV #29369
Conversation
|
cbf7c73 to
8c0eb7b
Compare
Codecov Report
@@ Coverage Diff @@
## master #29369 +/- ##
============================================
- Coverage 62.27% 61.79% -0.48%
- Complexity 18229 19112 +883
============================================
Files 1141 1096 -45
Lines 68119 61616 -6503
Branches 1230 0 -1230
============================================
- Hits 42420 38077 -4343
+ Misses 25336 23539 -1797
+ Partials 363 0 -363
Continue to review full report at Codecov.
|
PVince81
left a comment
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.
Code looks good so far, see some proposed additions.
| * @inheritdoc | ||
| */ | ||
| function challenge(RequestInterface $request, ResponseInterface $response) { | ||
| } |
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.
if purposefully left empty, please add a comment stating so
|
|
||
| function __construct() { | ||
| $this->l10n = \OC::$server->getL10N('dav'); | ||
| $this->shareManager = \OC::$server->getShareManager(); |
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.
use DI ?
| use Sabre\DAV\Collection; | ||
| use Sabre\DAV\INode; | ||
|
|
||
| class ShareNode extends Collection { |
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.
PHPDoc, what is this node about ?
| $this->share = $share; | ||
| } | ||
| /** | ||
| * Returns an array with all the child nodes |
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.
I suggest clarifying and saying we are returning both SharedFolder and SharedFile nodes depending on child types
| use Sabre\DAVACL\IACL; | ||
|
|
||
| /** | ||
| * Class MetaFile |
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.
please adjust, smells like copy-pasted from another PR 😉
| } | ||
|
|
||
| // function setName($name) { | ||
| // $this->file->setName($name); |
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.
I think we can forbid renaming share file here. This is because the name itself isn't visible anyway but someone might attempt to hack the API to try it out.
For local shares the file name is a received mount point. But here for link shares this is no mount point.
Throw Forbidden ?
| use Sabre\DAVACL\IACL; | ||
|
|
||
| /** | ||
| * Class MetaFolder |
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.
phpdoc
| return $this->folder->getName(); | ||
| } | ||
|
|
||
| function getLastModified() { |
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.
Please add getEtag() maybe.
We'll likely do a PROPFIND on this folder so it's good to get the etag to know if there were changes inside the folder.
Also add this to SharedFile.
Sounds like we might need a custom INode interface which has the getEtag method ? Or does Sabre retrieve the Etag differently ? (I forgot)
|
@ownclouders rebase |
|
Hey! This pull request is being rebased automatically. Please DO NOT push while rebase is in progress or your changes would be lost! |
|
Automated rebase failed! Please rebase your pull request manually via the command line. Error: |
389e677 to
078723b
Compare
078723b to
8376c96
Compare
8376c96 to
fc5590b
Compare
fc5590b to
137b795
Compare
|
Does it work with link password ? This would obsolete the "public.php/webdav" endpoint which takes userid=$token and password=$password. |
password handling in in here - |
|
|
reconsider for Phoenix ? |
|
Fixes #23269 |
|
As discussed in #35777 the master branch will from now on hold the ownCloud 10 codebase. This PR targetted ownCloud 11 which is postponed to a far distant future. Because of that I'm closing this PR and kindly ask you to re-submit this PR in a few days. Thanks a lot for your patience |
Description
Add webdav resource for public shared files and folders
Motivation and Context
DAV rules!
How Has This Been Tested?
Types of changes
Checklist: