Skip to content

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

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 1 commit into 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 <dimanosan@gmail.com>
@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
@snicoll snicoll self-assigned this May 2, 2025
snicoll pushed a commit that referenced this pull request May 2, 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.

See gh-45345

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
@snicoll snicoll closed this in 3a51197 May 2, 2025
@snicoll snicoll modified the milestones: 3.5.x, 3.5.0 May 2, 2025
lourw pushed a commit to xiongemi/spring-boot that referenced this pull request May 13, 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.

See spring-projectsgh-45345

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants