feat: cache upstream bearer tokens #92
Reference in New Issue
Block a user
Delete Branch "benvin/cache-bearer-tokens"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #77
Why
Each upstream 401 re-ran the full token-endpoint request, even though a single Docker pull triggers many blob/manifest requests sharing one scope.
Changes
GetToken/SetToken.fetchBearerTokennow also parsesexpires_inand returns a TTL.Engine.cachedBearerTokenreuses a cached token keyed by remote + challenge (hashed), caching forexpires_inminus a safety margin (default 60s when absent).Validation
make e2epasses.