mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
![]() # Avoid cache invalidation on credentials renewal Addresses - https://github.com/astral-sh/uv/issues/3009#issue-2239221126 ## Summary Some private package registries (e.g. AWS CodeArtifact) use short-lived credentials. Since they are short-lived, the exact URL that is assigned to `UV_INDEX_URL` changes frequently and with that the cache key / hashes of these URLs. This causes the cache to be missed on token renewal. This PR attempts to fix this by hashing URLs for cache keys without their user credentials. ## Test Plan I added a test that validates that: 1. Changing user credentials returns the same hash 2. Setting no user credentials yields the same as some user credentials ## Question I'm not sure if we should also change the `hash` implementation of `CanonicalUrl` / `RepositoryUrl`. They also run `.hash` within. PS. this is the first time I'm writing `rust` so if I'm wasting your precious time, let me know and I'll try to up my skills before I ask again. Anyway, I figured it's good to get this issue on your radar :) |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |