-
Type: Improvement
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 1.0.0
-
Fix Version/s: 2.0.0
-
Component/s: None
For a given blob, the server calculate a checksum (maybe MD5 or SHA-1).
On Drive, when downloading a blob, we can check for an optional checksum (https://github.com/nuxeo/nuxeo-drive/blob/595581e4711dca0d9aa2ec735f6c2e9bd9929e9c/nuxeo-drive-client/nxdrive/client/base_automation_client.py#L814).
We can backport that feature to the Python client to ease future integration into Drive.
If checksums are not equal, raises a CorruptedFile exception, also backported from Drive.
Implementation details:
- No need to check if the desired algo is available in the haslib module, it is a task for the user to used something existant.
- We just need a digest=None argument, we will guess the algo from that value.
- Calculate checksums for files only.