Skip to content

Add support for meta-path-for-user propfind - #2741

Merged
micbar merged 2 commits into
cs3org:edgefrom
kulmann:propfind-meta-path-for-user
Apr 27, 2022
Merged

micbar merged 2 commits into
cs3org:edgefrom
kulmann:propfind-meta-path-for-user

Conversation

@kulmann

@kulmann kulmann commented Apr 13, 2022 •

Copy link
Copy Markdown
Member

This PR adds support for the meta-path-for-user prop in propfinds to the /dav/meta endpoint. This is needed in oC Web for following situations:
a) when no resource path but only its id is given in the browser URL, fetch the path to make a propfind afterwards
b) when a resource path and id is given in the browser URL but resolves to an outdated location (e.g. resource has been moved), fetch new path to make another propfind with the correct path afterwards

Based on outdated/closed #2321 and #1604

Spec can be found here: https://doc.owncloud.com/server/next/developer_manual/webdav_api/meta.html

An example request:
curl -u einstein:relativity --insecure -X PROPFIND -H "Depth: 0" -H "Content-Type: text/xml" --data "@meta-files.xml" 'https://localhost:9200/remote.php/dav/meta/ddc2004c-0977-11eb-9d3f-a793888cd0f8!aa07d86a-f564-4e26-9e36-632ef63df9f0' | xmllint --format -

with content of meta-files.xml being:

<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns">
    <a:prop>
        <oc:meta-path-for-user/>
    </a:prop>
</a:propfind>

@kulmann
kulmann requested review from a team, ishank011 and labkode as code owners April 13, 2022 13:27
@update-docs

This comment was marked as resolved.

@kulmann
kulmann force-pushed the propfind-meta-path-for-user branch from 794dca3 to 6e0bf17 Compare April 13, 2022 13:29
@kulmann
kulmann requested a review from glpatcern as a code owner April 13, 2022 13:29
@kulmann
kulmann force-pushed the propfind-meta-path-for-user branch from 6e0bf17 to bfac65c Compare April 14, 2022 12:09
@phil-davis

phil-davis commented Apr 26, 2022 •

Copy link
Copy Markdown
Contributor

Now we just have: https://drone.cernbox.cern.ch/cs3org/reva/6755/16/6

  Scenario: User cannot access meta folder of a file which does not exist                                                                                                             # /drone/src/tmp/testrunner/tests/acceptance/features/apiVersions/fileVersions.feature:388
    Given user "Brian" has been created with default attributes and without skeleton files                                                                                            # FeatureContext::userHasBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles()
When user "Brian" sends HTTP method "PROPFIND" to URL "/remote.php/dav/meta/MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU2OjhjY2QyNzUxLTkwYTQtNDBmMi1iOWYzLTYxZWRmODQ0MjFmNA==" # FeatureContext::userSendsHTTPMethodToUrl()
--
<span class="ansi-red-fg">      cURL error 52: Empty reply from server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://revad-services:20080/remote.php/dav/meta/MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU2OjhjY2QyNzUxLTkwYTQtNDBmMi1iOWYzLTYxZWRmODQ0MjFmNA== (GuzzleHttp\Exception\ConnectException)</span>

Maybe the server code is "completely silent" if the request does not match any resource?
(and previously this passed - the server must have returned something - a 404 not found)

@micbar
micbar force-pushed the propfind-meta-path-for-user branch from a71699e to 692c40e Compare April 27, 2022 20:03
@micbar micbar self-assigned this Apr 27, 2022
@micbar
micbar requested a review from butonic April 27, 2022 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants