csm-adapt / sagittariidae

Data and file management interface.
0 stars 1 forks source link

require an artefact checksum from clients #15

Open sinistral opened 8 years ago

sinistral commented 8 years ago

When adding artefact, we must get a checksum from the client in order to ensure that we're received and reconstructed the file correctly. Given that the whole point of this exercise is file integrity, I'm adding this as a bug that must be addressed before internal release. The absence of a checksum in a request must result in a 400 response code with no changes made to the DB or filesystem.

sinistral commented 8 years ago

A relevant and worthwhile read: https://github.com/23/resumable.js/issues/135

sinistral commented 8 years ago

Given the cost of generating a checksum for the entire file on the client-side, I propose sending a checksum for each chunk (which is a good idea anyway) and then sending a checksum of checksums with the complete request.

bkappes commented 8 years ago

Absolutely. That's what I had in mind, since the part checksums can be calculated in parallel (theoretically). You're right -- it was a relevant and worthwhile read.