Leave volatile qualifiers out of asset store digest #61
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.
Fixes #60
When the remote asset API is used with Bazel as a client, and
--experimental_remote_downloader_propagate_credentials
is provided, the bearer tokens are included as qualifiers, however since these change regularly and frequently, resources requiring auth not only rarely get cache hits, but also they result in identical copies of their resources populating the asset store cache.Fix by filtering out auth and http header qualifiers before sending the asset ref down to the asset store.
Note that I'm looking at this PR from my own personal narrow perspective and might be overlooking a subtle detail/requirement... Other solutions I can think of would be to make the digest based entirely on
checksum.sri
if that qualifier is provided, being more specific to include onlyhttp_header_url:*:Authorization
instead ofhttp_header_url:*
qualifiers, or making this a configuration parameter.I've verified that this fixes my cache churn issues in my deployment.
Also apologies if I missed it but I couldn't find contribution instructions so feel free to point me to them if things need to be fixed up.