Skip to content

DockerRegistryConfigAuthentication uses the wrong serverUrl as a fallback for the Credentials helper #45345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nosan
Copy link
Contributor

@nosan nosan commented May 1, 2025

Before this commit, the credential helper used the serverUrl from the Map.Entry<String,Auth> as a fallback. However, the helper only uses the email from the auths.

https://github.com/docker/cli/blob/b24e7f85a488da13dc2d5be87acdaab2652634bb/cli/config/credentials/native_store.go#L42-L56

func (c *nativeStore) Get(serverAddress string) (types.AuthConfig, error) {
	// load user email if it exist or an empty auth config.
	auth, _ := c.fileStore.Get(serverAddress)
	creds, err := c.getCredentialsFromStore(serverAddress)
	if err != nil {
		return auth, err
	}
	auth.Username = creds.Username
	auth.IdentityToken = creds.IdentityToken
	auth.Password = creds.Password
	auth.ServerAddress = creds.ServerAddress
	return auth, nil
}

Before this commit, the credential helper used the serverUrl from
the Map.Entry<String,Auth> as a fallback. However, the helper only uses
the email from the auths.

Signed-off-by: Dmytro Nosan <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 1, 2025
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels May 1, 2025
@philwebb philwebb added this to the 3.5.x milestone May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants