Skip to content

Make checksum propfind future proof - #22199

Merged
DeepDiver1975 merged 1 commit into
masterfrom
multiple_checksums
Feb 9, 2016
Merged

DeepDiver1975 merged 1 commit into
masterfrom
multiple_checksums

Conversation

@rullzer

@rullzer rullzer commented Feb 8, 2016

Copy link
Copy Markdown
Contributor

The checksum PR from #21997 returns a propfind like:

<oc:checksum>TYPE:CHECKSUM</oc:checksum>

Which if we will ever support multiple cheksums results in:

<oc:checksum>TYPE1:CHECKSUM1,TYPE2:CHECKSUM2</oc:checksum>

Which is not very webdavvy.

This PR moves that to:

<oc:checksums>
  <oc:checksum>TYPE1:CHECKSUM1</oc:checksum>
  <oc:checksum>TYPE2:CHECKSUM2</oc:checksum>
</oc:checksum>

Which is a bit more future proof.

Testing is basically the same as: #21997 (comment) with the exception that your propfind file should contain:

<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
<a:prop xmlns:oc="http://owncloud.org/ns">
    <oc:checksums/>
</a:prop>
</a:propfind>

CC: @PVince81 @dragotin @MorrisJobke @nickvergessen

Instead of returning

<oc:checksum>TYPE:CHECKSUM</oc:checksum>

Return

<oc:checksums>
  <oc:checksum>TYPE:CHECKSUM</oc:checksum>
</oc:checksums>

This will allow us to expand in the future to multiple checksums.
Without doing just string concatenation.

And even for a single checksum it is now correct.
@rullzer rullzer added this to the 9.0-current milestone Feb 8, 2016
@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @PVince81, @DeepDiver1975 and @LukasReschke to be potential reviewers

@MorrisJobke

Copy link
Copy Markdown
Contributor
(multiple_checksums) $ curl -u mjob:mjob -X PROPFIND http://localhost/master/remote.php/webdav/foobar --upload-file prop
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
 <d:response>
  <d:href>/master/remote.php/webdav/foobar</d:href>
  <d:propstat>
   <d:prop>
    <oc:checksum/>
   </d:prop>
   <d:status>HTTP/1.1 404 Not Found</d:status>
  </d:propstat>
 </d:response>
</d:multistatus>
(multiple_checksums) $ git checkout master                                                                                       
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
(master) $ curl -u mjob:mjob -X PROPFIND http://localhost/master/remote.php/webdav/foobar --upload-file prop
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
 <d:response>
  <d:href>/master/remote.php/webdav/foobar</d:href>
  <d:propstat>
   <d:prop>
    <oc:checksum>MD5:12i34769781236496913,sha1:asdoöiadshfölha</oc:checksum>
   </d:prop>
   <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
 </d:response>
</d:multistatus>

@MorrisJobke

Copy link
Copy Markdown
Contributor

@rullzer Seem to be broken. :(

@MorrisJobke

Copy link
Copy Markdown
Contributor

Tested with the updated file prop and it works now 👍

@karlitschek

Copy link
Copy Markdown
Contributor

I'm O.K.with that. But please discuss architecture question like that with @DeepDiver1975 and me in the future.
👍

DeepDiver1975 added a commit that referenced this pull request Feb 9, 2016
Make checksum propfind future proof
@DeepDiver1975
DeepDiver1975 merged commit 98497aa into master Feb 9, 2016
@DeepDiver1975
DeepDiver1975 deleted the multiple_checksums branch February 9, 2016 08:10
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants