Skip to content

api/types/registry: EncodeAuthConfig: use empty string for zero value#50426

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:no_empty_auth
Jul 17, 2025
Merged

api/types/registry: EncodeAuthConfig: use empty string for zero value#50426
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:no_empty_auth

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jul 16, 2025

relates to;

Currently, EncodeAuthConfig always returns a base64url-encoded JSON doc, even if an empty auth-config passed. As a result, it's more complicated to detect if authentication was present.

This patch changes the behavior to return an empty string for these cases so that teh client can skip setting the X-Registry-Auth header, and the daemon can detect whether authentication is sent or not.

- Human readable description for the release notes

Go SDK: `api/types/registry`: `EncodeAuthConfig`: use empty string for zero value

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added status/2-code-review impact/changelog area/go-sdk impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Jul 16, 2025
@thaJeztah thaJeztah added this to the 29.0.0 milestone Jul 16, 2025
Currently, EncodeAuthConfig always returns a base64url-encoded JSON
doc, even if an empty auth-config passed. As a result, it's more
complicated to detect if authentication was present.

This patch changes the behavior to return an empty string for these
cases so that teh client can skip setting the `X-Registry-Auth` header,
and the daemon can detect whether authentication is sent or not.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah marked this pull request as ready for review July 16, 2025 20:26
@thaJeztah thaJeztah merged commit 4c6f586 into moby:master Jul 17, 2025
165 checks passed
@thaJeztah thaJeztah deleted the no_empty_auth branch July 17, 2025 06:33
@dmcgowan dmcgowan added the area/api API label Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants