Skip to content

Partial Collection Signature

Rémy HUBSCHER edited this page Nov 8, 2016 · 1 revision

Summary

Kinto Signer is great because as soon as some data have been promoted for production users it sign their content to make sure that the collection haven't been altered between Mozilla and the user.

However what happen when you want to sync a part of the full collection?

Proposal

You can think of multiple strategies (Merkle tree, signing the response, etc) but every time you miss the fact to validate that the collection is complete and nothing is missing.

What does partial collection means?

Partial collection means that you want to synchronize only the records that are useful for your client, they can be seen as tags that you will filter your collection on.

If I have a list of system add-ons and I want to update only the ones that are for Firefox 52 and the one that are for Firefox in French I will only have a little part of all the available system add-ons (for all version of Firefox and all languages).

  • Why should I download the full index while I can be happy with the partial one?
  • How can I validate that all add-ons that the CDN returned me were edited by Mozilla and that all of them are present?
  • How can I make that happen without having an infinity of signatures for each combination of tags?

If I query: /buckets/system-addons/collections/addons/records?tag=fx52,french, I will get a list of all the add-ons that for French using Firefox 52.

I can then ask for the tree of hashes: /buckets/system-addons/collections/fx52-hashes/records and /buckets/system-addons/collections/french-hashes/records

  • I will get all the hashes for all the fx52 addons and all the hashes for all the french addons.
  • I can validate that the intersection of the two addons hashes sets is the list of addons I've got locally with my query on the addons collection that all the record I have got locally are present in this intersection and not one more.

I can also validate the signature of both the fx52-hashes and french-hashes.

As soon as size of the hash is lower than the size of the record it can make sense.