Skip to content
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

Returning custom Webdav properties #721

Merged
merged 1 commit into from
May 7, 2020
Merged

Returning custom Webdav properties #721

merged 1 commit into from
May 7, 2020

Conversation

PVince81
Copy link
Contributor

@PVince81 PVince81 commented May 6, 2020

Adjust PROPFIND to process custom properties

Adjust storage provider to read custom properties from extended
attributes

  • check whether we want to allow owncloud-namespaced dead properties (non-processed)
  • add filter to xattr property list
  • debug xattr code
  • add todo/ticket for optimizing and providing a way to query specific properties from the storage instead of all

Adjusted OC storage provider to read custom properties from extended
attributes.
Adjusted PROPFIND handler to return requested custom properties.
@PVince81
Copy link
Contributor Author

PVince81 commented May 6, 2020

Fixed now:

curl -u einstein:relativity -X PROPPATCH -H "Content-Type: text/xml" --data-binary "@proppatch.xml" "http://localhost:9140/remote.php/webdav/litmus" | xmllint --format -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2025  100   944  100  1081  21454  24568 --:--:-- --:--:-- --:--:-- 46022
<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/webdav/litmus/</d:href>
    <d:propstat>
      <d:prop>
        <somename xmlns="http://example.com/alpha">manynsvalue</somename>
        <somename xmlns="http://example.com/beta">manynsvalue</somename>
        <somename xmlns="http://example.com/gamma">manynsvalue</somename>
        <somename xmlns="http://example.com/delta">manynsvalue</somename>
        <somename xmlns="http://example.com/epsilon">manynsvalue</somename>
        <somename xmlns="http://example.com/zeta">manynsvalue</somename>
        <somename xmlns="http://example.com/eta">manynsvalue</somename>
        <somename xmlns="http://example.com/theta">manynsvalue</somename>
        <somename xmlns="http://example.com/iota">manynsvalue</somename>
        <somename xmlns="http://example.com/kappa">manynsvalue</somename>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

using proppatch.xml:

<?xml version="1.0" encoding="utf-8" ?>

<D:propertyupdate xmlns:D="DAV:"><D:set><D:prop><somename xmlns="http://example.com/alpha">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/beta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/gamma">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/delta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/epsilon">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/zeta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/eta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/theta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/iota">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/kappa">manynsvalue</somename></D:prop></D:set>
</D:propertyupdate>

and retrieving the values:

curl -u einstein:relativity -X PROPFIND -H "Depth: 0" -H "Content-Type: text/xml" --data-binary "@propfind.xml" "http://localhost:9140/remote.php/webdav/litmus" | xmllint --format -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1504  100   944  100   560  59000  35000 --:--:-- --:--:-- --:--:-- 94000
<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/webdav/litmus/</d:href>
    <d:propstat>
      <d:prop>
        <somename xmlns="http://example.com/alpha">manynsvalue</somename>
        <somename xmlns="http://example.com/beta">manynsvalue</somename>
        <somename xmlns="http://example.com/gamma">manynsvalue</somename>
        <somename xmlns="http://example.com/delta">manynsvalue</somename>
        <somename xmlns="http://example.com/epsilon">manynsvalue</somename>
        <somename xmlns="http://example.com/zeta">manynsvalue</somename>
        <somename xmlns="http://example.com/eta">manynsvalue</somename>
        <somename xmlns="http://example.com/theta">manynsvalue</somename>
        <somename xmlns="http://example.com/iota">manynsvalue</somename>
        <somename xmlns="http://example.com/kappa">manynsvalue</somename>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

using propfind.xml:

<?xml version="1.0" encoding="utf-8" ?>

<D:propfind xmlns:D="DAV:">
        <D:prop>
        <somename xmlns="http://example.com/alpha"/>
        <somename xmlns="http://example.com/beta"/>
        <somename xmlns="http://example.com/gamma"/>
        <somename xmlns="http://example.com/delta"/>
        <somename xmlns="http://example.com/epsilon"/>
        <somename xmlns="http://example.com/zeta"/>
        <somename xmlns="http://example.com/eta"/>
        <somename xmlns="http://example.com/theta"/>
        <somename xmlns="http://example.com/iota"/>
        <somename xmlns="http://example.com/kappa"/>
</D:prop>
</D:propfind>

@butonic

@PVince81 PVince81 changed the title WIP returning custom properties Returning custom properties May 6, 2020
@PVince81 PVince81 changed the title Returning custom properties Returning custom Webdav properties May 6, 2020
@PVince81 PVince81 marked this pull request as ready for review May 6, 2020 15:35
@PVince81 PVince81 requested a review from labkode as a code owner May 6, 2020 15:35
@PVince81
Copy link
Contributor Author

PVince81 commented May 6, 2020

with a bit of luck this might also fix the checksum retrieval cases

@PVince81
Copy link
Contributor Author

PVince81 commented May 7, 2020

license check failed due to timeout :-S

@labkode labkode merged commit c853e65 into cs3org:master May 7, 2020
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.

2 participants