Repository navigation
cli/command: look up registry credentials through internal/registryauth - #7572
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
docker-agent
reviewed
Dec 4, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
docker-agent
reviewed
Dec 4, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
thaJeztah
reviewed
Dec 4, 2026
Benehiko
force-pushed
the
registryauth-encoded-auth
branch
4 times, most recently
from
December 4, 2026 13:28
e5940f0 to
d7b3ab8
Compare
docker-agent
reviewed
Dec 4, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
thaJeztah
reviewed
Dec 4, 2026
Benehiko
force-pushed
the
registryauth-encoded-auth
branch
from
December 4, 2026 14:41
d7b3ab8 to
91e08a0
Compare
Move the lookup of the encoded registry credentials for an image into the new internal/registryauth package, and use it where commands send credentials to the daemon: docker pull, push, run, create, plugin install, upgrade and push, service create and update, and stack deploy. command.RetrieveAuthTokenFromImage is kept for compatibility, as a wrapper around registryauth.Encoded, and its tests move to the new package. registryauth.Encoded takes the context of the command, so that a lookup that needs to wait, such as one that asks another process for credentials, can be canceled with the command. It takes any AuthConfigProvider instead of a configfile.ConfigFile. The credentials do not change: they come from DOCKER_AUTH_CONFIG, the credential store, credential helpers, and the configuration file. Document how the daemon uses the Password, Auth, IdentityToken, and RegistryToken fields of types.AuthConfig, which answers the TODO that asked whether the encoded credentials should include them. Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
Benehiko
force-pushed
the
registryauth-encoded-auth
branch
from
December 4, 2026 14:47
91e08a0 to
0dcf19d
Compare
docker-agent
reviewed
Dec 4, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
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.
Note
This PR was created with alki, an AI coding agent, running Claude Opus 5.5: the code, the tests, and this description.
Summary
Move the lookup of the encoded registry credentials (the X-Registry-Auth header) for an image into a new internal/registryauth package, and use it everywhere commands send credentials to the daemon: docker pull, push, run, create, plugin install, upgrade and push, service create and update, and stack deploy.
registryauth.Encoded(ctx, cfg, image)takes anyAuthConfigProvider(anything withGetAuthConfig(registryHostname), such as*configfile.ConfigFile), and carries over the GoDoc ofcommand.RetrieveAuthTokenFromImage.command.RetrieveAuthTokenFromImageis kept, since other projects import it, and is now a wrapper aroundregistryauth.Encoded. Its tests moved tointernal/registryauthunchanged.Encodedtakes the context of the command. It is not used yet: WIP: use the secrets engine session for Docker Hub and dhi.io credentials #7431 uses it so that a credential lookup that waits on another process (the secrets engine authorization prompt) is canceled with the command.DOCKER_AUTH_CONFIG, the credential store, credential helpers, and the configuration file.Release notes (optional)