{{ message }}
Repository navigation
cli/command: explicitly map AuthConfig fields instead of a direct cast - #6516
Merged
Merged
Conversation
thaJeztah
force-pushed
the
authconfig_no_direct_cast
branch
3 times, most recently
from
September 29, 2025 10:32
1049a08 to
32dae45
Compare
1 task done
Commit [cli@27b2797] forked the AuthConfig type from the API, and changed existing code to do a direct cast / convert of the forked type to the API type. This can cause issues if the API types diverges, such as the removal of the Email field. This patch explicitly maps each field to the corresponding API type, but adds some TODOs, because various code-paths only included a subset of the fields, which may be intentional for fields that were meant to be handled on the daemon / registry-client only. We should evaluate these conversions to make sure these fields should be sent from the client or not (and possibly even removed from the API type). [cli@27b2797]: docker@27b2797 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
force-pushed
the
authconfig_no_direct_cast
branch
from
September 29, 2025 10:58
32dae45 to
9f02d96
Compare
thaJeztah
commented
Sep 29, 2025
Comment on lines
-72
to
-74
| authCfg.ServerAddress = serverAddress | ||
| authCfg.IdentityToken = "" | ||
| return registrytypes.AuthConfig(authCfg), nil |
Member
Author
There was a problem hiding this comment.
Here, we're resetting this field, but other places we either copy everything as-is, and in yet other places, we only include Username, Password, and ServerAddress - this needs some digging into. I suspect the AuthConfig struct as defined in the API contains fields that were meant to be used by the registry client, and some fields not intended to be accepted through the X-Registry-Auth header.
thaJeztah
commented
Sep 29, 2025
Comment on lines
+85
to
+90
Member
Author
There was a problem hiding this comment.
More so, because the Auth field .. I think is the base64 encoded representation of Username:Password, so either the structured fields OR only the Username:Password should likely be sent.
thaJeztah
marked this pull request as ready for review
September 29, 2025 11:27
This was referenced Sep 29, 2025
austinvazquez
approved these changes
Sep 29, 2025
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.

relates to:
Commit cli@27b2797 forked the AuthConfig type from the API, and changed existing code to do a direct cast / convert of the forked type to the API type. This can cause issues if the API types diverges, such as the removal of the Email field.
This patch explicitly maps each field to the corresponding API type, but adds some TODOs, because various code-paths only included a subset of the fields, which may be intentional for fields that were meant to be handled on the daemon / registry-client only.
We should evaluate these conversions to make sure these fields should be sent from the client or not (and possibly even removed from the API type).
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)