Skip to content

Leave volatile qualifiers out of asset store digest #61

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

top-oai
Copy link

@top-oai top-oai commented Jul 1, 2025

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 only http_header_url:*:Authorization instead of http_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.

@EdSchouten
Copy link
Member

Hey Andrew, could you please format your source files to keep CI happy? Thanks!

@top-oai
Copy link
Author

top-oai commented Jul 2, 2025

Hey Andrew, could you please format your source files to keep CI happy? Thanks!

Aha, yes done!

@EdSchouten
Copy link
Member

@mortenmj @tomcoldrick-ct PTAL!

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.

Assets rarely cache hit when client credentials are propagated
2 participants