Conversation
Co-authored-by: jonesbusy <825750+jonesbusy@users.noreply.github.com>
|
I want also that you complete test with only namespace "my-registry.local/namespace/user/image": {
"auth": "...."
},Can you also try to rely on existing method of ContainerRef like When changing code you need to make sure to apply spotless (mvn spotless:apply). This fail the build, but at least it doesn't cause any regression on other test The Cannot we take
This look better that return a list of key to check |
…etFullRepository Co-authored-by: jonesbusy <825750+jonesbusy@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #588 +/- ##
============================================
+ Coverage 88.44% 88.69% +0.25%
+ Complexity 815 812 -3
============================================
Files 42 42
Lines 2405 2414 +9
Branches 295 297 +2
============================================
+ Hits 2127 2141 +14
+ Misses 168 161 -7
- Partials 110 112 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot This is better. The while(true) is risky. I would prefer adding a condition (like no / anymore, then we can fall back to the registry only) Also we only need to check on credentialStore. Never on credentialHelperStore that only use registry Can you update the PR |
…dentialStore hierarchically Co-authored-by: jonesbusy <825750+jonesbusy@users.noreply.github.com>
Done in ec3c13c:
|
Description
Implements hierarchical credential lookup in
AuthStorefollowing containers-auth.json(5) semantics (podman/buildah behavior). Previously only exact registry matches were supported; now credentials are resolved from most-specific to least-specific path.For
my-registry.local/namespace/user/image:latest, lookup order is:AuthStore.Config.getCredential()— replaced the singlecredentialStore.get(registry)call with an iterative hierarchical lookup:registry + "/" + containerRef.getFullRepository()while (!key.equals(registry)), checkingcredentialStoreat each level and stripping one path segment per iterationcredentialStorecredentialHelperStore) are only performed at the registry level — never during the hierarchical path traversalTesting done
New unit tests in
AuthStoreTestusing a config with multi-level credential keys:testHierarchicalCredentialLookupMostSpecifictestHierarchicalCredentialLookupNamespaceOnlymy-registry.local/namespace)testHierarchicalCredentialLookupFallsBackToRegistrytestHierarchicalCredentialLookupRegistryOnlytestHierarchicalCredentialLookupNoMatchnullSubmitter checklist
mvn license:update-file-header,mvn spotless:apply,pre-commit run -a,mvn clean installbefore opening the PROriginal prompt
AuthStore#587🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.