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

Feature: checksum downloaded artifacts #945

Open
1 task done
hgeraldino opened this issue Jul 27, 2021 · 1 comment
Open
1 task done

Feature: checksum downloaded artifacts #945

hgeraldino opened this issue Jul 27, 2021 · 1 comment

Comments

@hgeraldino
Copy link
Contributor

Feature request
Following up on the discussion we had a week ago on the #slack channel, I'd like to suggest the addition of checksum routine(s) as part of the installation process, so downloaded artifacts can be verified before they're extracted/relocated.

This feature will require changes at least in the underlying mongodb (so we can store the different SHA hashes (SHA1, SHA256, SHA512, etc), sdkman-cli (to execute the actual verification), the vendor APIs (so SHAs are published alongside the rest of the metadata), broker and maybe other components.

In terms of performing the checksum itself, I'd suggest using shasum - the perl utility that is shipped with pretty much all major *nix distributions and macOS. In addition to that, we can have the checksum routine be executed only if this tool is found on the $PATH, logging a WARN message if checksums are available for the candidate but shasum is not found on the system.

I'm happy to contribute to this feature if it's deemed reasonable.

@stewSquared
Copy link

stewSquared commented Nov 3, 2021

I second this. It took me a while to figure out to debug "Download has failed, aborting!" that came from a post installation hook. At the very least, as a stop-gap, it might be worth having the install hooks say "consider deleting ~/.sdkman/tmp*.bin"

edit: I'm not completely sure about my workaround. I later had to empty the candidates cache rm ~/.sdkman/candidates/java*. Not sure what else I might be breaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants