Support DigestFunction in the Remote Asset API #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Remote Asset API now includes parameters for the digest function used everywhere, which allows us to correct a lot of our usage. This PR handles all of that correction. I've made some API changes to the Asset store, so that we can pass
digest.Function
around instead ofdigest.InstanceName
, which simplifies computing digests everywhere. As part of that, I've also removed a load of cruft we had using the REAPI objects directly instead of the nice digest/buffer APIs from bb-storage.The HTTP fetcher required an additional bit of work to extricate our handling of the
checksum.sri
validator. Before the API allowed specifying an digest function, we used this to work out which digest function to use. This is now incorrect, and will try to do unexpected things, especially in the case you're using an Action Cache Asset Store. The behaviour is now corrected to only usechecksum.sri
to validate. In future we should handle the checksum generically on the returnedDigest
, rather than only in the HTTP fetcher.Fixes #54
Depends on #56