fair-research / bdbag

Big Data Bag Utilities
https://fair-research.org
Apache License 2.0
49 stars 23 forks source link

added sha1 support for create-rfm-from-url-list #46

Closed ccacciari closed 2 years ago

ccacciari commented 2 years ago

I wanted to use the utitlity create-rfm-from-url-list to generate a BagIt package using a OwnCloud webdav url. However, as explained here: https://central.owncloud.org/t/reading-hashes-md5-or-sha1-via-webdav/14348, OwnCloud uses sha1, so I added the support for sha1. I also added some logic to remove the sha1 prefix and to process the checksum when it is not base64 encoded.

coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 96.355% when pulling d2c02ff13ec2e8ade40b677213f21251fe237e68 on ccacciari:master into 9b2b72842b6d5efd375e03b52fef82f66857b951 on fair-research:master.

mikedarcy commented 2 years ago

This PR looks fine to me. I'll include it in the upcoming 1.6.2 release. I'll probably fiddle with head_for_headers a little and allow a config to be passed to it rather than just having it always default to DEFAULT_CONFIG. I also need to add some notes about bdbag_utils.py and that it is essentially "experimental" since none of this code has unit tests. Thanks for the contribution.