You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: remove process-global auth cache store #2305
#2288 fixed the token mixing by keying shared auth caches by credential identity, but the cache store is still a package-level global. It keeps state across invocations in the same process, makes tests order-dependent (they must reset the global), and lets cached tokens outlive a command.
I would like to follow up by scoping the auth cache store to the command invocation (owned by option.Common) while keeping the credential-identity key, so clients with the same credentials within one invocation still share a cache.
Proposed changes:
Replace the package-global store with an invocation-scoped store.
Bind the from and to remotes to the same store through option.Common.
Keep the per-credential keying.
Add a regression test where cp authenticates to the destination with its own credentials (httptest returning 403 for the wrong Basic user).
Update the existing cache tests to use explicit stores instead of the global reset.
Activity
vmvarela commentedon Nov 1, 2026
I want to work on this. I have a change with unit tests and a 403 httptest for
cpready to open as a PR.fix: preserve optional in-process auth cache reuse
refactor: scope auth cache to command invocation
fix: preserve optional in-process auth cache reuse