Closed njgheorghita closed 5 years ago
@njgheorghita don't remember who, but I think we can ditch the fragment based content hash in favor of the blob hash natively present in this form of github uri.
https://developer.github.com/v3/git/blobs/
Do some verification, but I think the hash in that URI corresponds to the hash of the file content.
Yup, that hash in the blob uri is sha1
hash of the base64
encoding of the contents found at the uri
What was wrong?
A util function would be useful that accepts a valid github uri pointing to a manifest json file, and returns the uri as defined here.
How can it be fixed?
The utility function should be written in https://github.com/ethpm/py-ethpm/blob/master/ethpm/utils/uri.py. It should validate that the given uri leads to a json file hosted on github, validate the json file against the manifest json schema, and return a uri with the specified encoding here. Tests should be written here