Repository navigation
refactor: scope auth cache to command invocation - #2306
Merged
TerryHowe merged 2 commits intoNov 2, 2026
Merged
Conversation
vmvarela
requested review from
TerryHowe,
Wwwsylvia,
sabre1041,
sajayantony and
shizhMSFT
as code owners
November 1, 2026 09:30
TerryHowe
reviewed
Nov 1, 2026
vmvarela
added a commit
to vmvarela/oras
that referenced
this pull request
Nov 1, 2026
Address review feedback on oras-project#2306 by rebinding remotes on repeated command execution and allowing embedders to opt into cache reuse through a shared context. Refs oras-project#2305
Contributor
Author
TerryHowe
previously requested changes
Nov 1, 2026
TerryHowe
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR! The code looks good; the only blocker is the DCO check, because this commit is missing a Signed-off-by trailer:
- 668b989 fix: preserve optional in-process auth cache reuse
To fix it, sign off the commits and force-push the branch:
git checkout issue-2305/remove-global-auth-cache
git rebase --signoff HEAD~2
git push --force-with-lease origin issue-2305/remove-global-auth-cacheFor future commits, use git commit -s.
Replace the process-global auth cache map with a per-invocation store owned by option.Common. Clients with the same credentials still share a cache within one invocation, while different credentials and different invocations stay isolated. This is a follow-up to oras-project#2288, which stopped clients with different credentials from sharing tokens but kept the cache store global. Refs oras-project#2305 Signed-off-by: Victor M Varela <[email protected]>
Address review feedback on oras-project#2306 by rebinding remotes on repeated command execution and allowing embedders to opt into cache reuse through a shared context. Refs oras-project#2305 Signed-off-by: Victor M Varela <[email protected]>
vmvarela
force-pushed
the
issue-2305/remove-global-auth-cache
branch
from
November 2, 2026 07:51
668b989 to
4ca7d72
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2306 +/- ##
==========================================
+ Coverage 61.90% 70.59% +8.69%
==========================================
Files 140 154 +14
Lines 6100 6342 +242
==========================================
+ Hits 3776 4477 +701
+ Misses 2101 1601 -500
- Partials 223 264 +41 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4 tasks done
2 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
Replace the process-global auth cache map with a per-invocation store owned by
option.Common. Clients with the same credentials still share a cache within one invocation, while different credentials and different invocations stay isolated.This is a follow-up to #2288, which stopped clients with different credentials from sharing tokens but kept the cache store global. Removing the global also removes the test order dependence (resetting the shared store) and stops cached tokens from outliving a command in the same process.
Which issue(s) this PR fixes:
Fixes #2305
Please check the following list: