[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Merkle trees in svn [was: Quick question about the sha1-checksum for directories in svn.]

From: Paul Hammant <paul_at_hammant.org>
Date: Thu, 5 Oct 2017 10:36:32 -0400

> "Obeying read permissions" means that the directory hashes would have to
> be computed dynamically for each user.

Yes I know.

I've a frankenstein project over here -
https://github.com/paul-hammant/merkle-rust - There's a solid Rust merkle
tree that watches for changes at nodes then re-calcs the SHA1 of the parent
dir (and the parent of that, and all the way back to root).

Because I can't actually write Rust yet, I've made a Python webserver, and
Python test that shows what nodes should report on the wire (plain text in
this demo). Here's is the GET result for node A/AK/A/Alaska/ ( a list of
resources and their SHA1s) ->

96b55f350ccb1911d7f9d7e7645d6d11178ad753
2013.json 1674790a70b984c9041ab86c370f942861ead004
2016.json 194f6519cd60b773a82857cf1aeba8dad4a223ed
2020.json 20e3ff1ade2385c593f73fd44fd157391d2424e7
2050.json 19b2da433a273840deddb7a46b16891acab16e3f
2060.json 45418423999c155abc434e175d42ccf6534bee6d
2068.json 69576d3632c7ce8b0b2a42d87e9e75049bdaff9d
2070.json 2d50d3100744fb7c4c5ead72a2896909fbe2ba6a
2090.json 434e72590bdaa03176ebabc18e52dc0a24918da9
2100.json a884cf405af5a20276b3b1cc72885833905ffa97
2105.json f7bfd6be756c919e4ea69cb466f31ae0b2fd213d
2110.json c88ed14784907db94b11941b760892742bd043f3
2122.json e5247216a7a1f32851807d4b4b9cd1cf152cd57d
2130.json 375fc259d26710afe31e1367a59de3d5dea729b1
2150.json b5c17ce941a9647fbc179cb1b769348cfdaebb98
2164.json ab2f71a47910463bdde92a77313f7e5edba00063
2170.json c1d0842e2c77d53bee5c684e0e8ad580a2fff05f
2180.json 9759646b5a2811efc6bfaee84a2b813f85cb1e1a
2185.json e2beddc3f245ca79908d9a1590aa177151e66e4d
2188.json 5881cdc3a15eac0cba15a3e07ad54176cabeeedf
2195.json b7085173d8685deecf70c6efb63d92ec6db2cf21
2198.json 78a399df3eeb4f696812d6d46882e4029190cf67
2220.json 594a20ec3d550eae2ad848fa8c0e08d50bd4e7fa
2230.json ec4c2c8dfc3cf4c1e6719de0544aaeba7731fc9c
2240.json 798b13c1c4aa7ee2e5744f8b8a2b553c1447229b
2261.json 0cd460d99cc7a871230cbe0f6f2ab703339e1630
2270.json 4e77074d4adc2ac7bb486408b00bda26f98820ea
2275.json 91ce27fc8b643540dda88afdc5b5b62d97a026fa
2282.json 3bec0f1f9e3ae818dd096303f796ce28e2fe6d08
2290.json fd4014808dd77351b939060f1283d395deb0cea5

Here's the GET result for the SHA1 of that A/AK/A/Alaska/.sha1 ->

96b55f350ccb1911d7f9d7e7645d6d11178ad753

You know already, Brane, but others might not: I take the first text (the
list) run it through 'sha1sum' to make the second text (the single SHA1).
That the relatively dynamic SHA1s that would obey read permissions for the
user in question, only need to SHA1 a small amount of data, not whole files
again. Of course that is recursive so it would need to be maintained once
per user group, or user where there's different permissions.

- Paul
Received on 2017-10-05 16:36:43 CEST

This is an archived mail posted to the Subversion Dev mailing list.