Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: customizable checksum algorithms for fixity #187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mirekys
Copy link

@mirekys mirekys commented Feb 8, 2019

Adds the the possibility to customize the checksums that are computed on files by
using the following config options:

FILES_REST_SUPPORTED_CHECKSUM_ALGORITHMS = {
    'md5': hashlib.md5
}
"""Algorithms that can be used for file checksum compute and verify"""

FILES_REST_CHECKSUM_ALGORITHM = 'md5'
"""Checksum algorithm to be used on all newly uploaded files

.. note::
   Value of this variable must be a corresponding
   key in the ``FILES_REST_SUPPORTED_CHECKSUM_ALGORITHMS`` variable.
"""

When the current checksum algorithm changes, newly created files will have the new checksum. Fixity checking of old files having a checksum generated by a previous algorithm is still maintained (as long as the algorithm remains in the FILES_REST_SUPPORTED_CHECKSUM_ALGORITHMS option).

@lnielsen lnielsen self-assigned this Feb 14, 2019
@lnielsen
Copy link
Member

Thanks for the PR @mirekys.

I'm having a look at it now and will update it. There's a couple of things I'd like to fix like ensuring the FileStorage class is independent of the application state (i.e. current_files_rest) and having a look at what the base interface should look like because there's already Invenio-XRootD and Invenio-S3 which implement the interface.

@lnielsen lnielsen force-pushed the master branch 3 times, most recently from abd43b6 to d1fb4d2 Compare October 20, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants