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

Fix arbitrary namespace in PROPFIND #720

Merged
merged 1 commit into from
May 6, 2020
Merged

Fix arbitrary namespace in PROPFIND #720

merged 1 commit into from
May 6, 2020

Conversation

PVince81
Copy link
Contributor

@PVince81 PVince81 commented May 6, 2020

Arbitrary namespaces can usually be URLs, so we have to properly
pass them into the formatter instead of concatenating it as an alias.

Also fixed PROPFIND response to not contain empty status blocks.

Discovered while debugging PROPPATCH here: owncloud/ocis-reva#57 (comment)

Steps to reproduce: use the steps from owncloud/core#32660 against a resource on the API backend (port 9140)

Before this fix, broken namespaces:

<?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></d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
   </d:propstat>
   <d:propstat>
      <d:prop>
         <http://example.com/alpha:somename></http://example.com/alpha:somename>
         <http://example.com/beta:somename></http://example.com/beta:somename>
         <http://example.com/gamma:somename></http://example.com/gamma:somename>
         <http://example.com/delta:somename></http://example.com/delta:somename>
         <http://example.com/epsilon:somename></http://example.com/epsilon:somename>
         <http://example.com/zeta:somename></http://example.com/zeta:somename>
         <http://example.com/eta:somename></http://example.com/eta:somename>
         <http://example.com/theta:somename></http://example.com/theta:somename>
         <http://example.com/iota:somename></http://example.com/iota:somename>
         <http://example.com/kappa:somename></http://example.com/kappa:somename>
   </d:prop>
   <d:status>HTTP/1.1 404 Not Found</d:status>
   </d:propstat>
</d:response>
</d:multistatus>

After this fix:

<?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"/>
        <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:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

Note: I don't think this will fix litmus tests as it expects custom properties to be settable while here they are returned as 404. Still, it's a step forward to at least make the response properly parse-able.

@butonic

Arbitrary namespaces can usually be URLs, so we have to properly
pass them into the formatter instead of concatenating it as an alias.

Also fixed PROPFIND response to not contain empty status blocks.
@labkode
Copy link
Member

labkode commented May 6, 2020

Thanks @PVince81, the CS3APIs allow for arbitrary metadata, should be possible to map PATCH to SetArbitraryMetadata calls.

@labkode labkode merged commit 7b699ef into cs3org:master May 6, 2020
@PVince81
Copy link
Contributor Author

PVince81 commented May 6, 2020

the CS3APIs allow for arbitrary metadata, should be possible to map PATCH to SetArbitraryMetadata calls.

I think the trick is to define a proper format/convention for the key string in arbitrary metadata, to not conflict with the built-in ones.

@PVince81 PVince81 deleted the fix-propfind-namespace branch May 6, 2020 09: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.

None yet

2 participants