When constructing the header value for X-Registry-Auth when talking to the Docker Engine API, org.springframework.boot.buildpack.platform.docker.configuration.JsonEncodedDockerRegistryAuthentication#getAuthHeader is called. This getter is backed by the field authHeader, which is filled from org.springframework.boot.buildpack.platform.docker.configuration.JsonEncodedDockerRegistryAuthentication#createAuthHeader.
This uses SharedObjectMapper.get().writeValueAsBytes(this). However, the JSON from that serialization not only includes the necessary fields like username and password, but also the field authHeader, which is only used for caching the constructed header.
We should annotate the authHeader field with @JsonIgnore and verify in the tests (DockerRegistryUserAuthenticationTests and DockerRegistryTokenAuthenticationTests) that the header doesn't contain the authHeader field in the JSON.
What it looks like:
{
"authHeader" : null,
"username" : "user",
"password" : "secret",
"email" : "docker@example.com",
"serveraddress" : "https://docker.example.com"
}
What it should look like (note the removed authHeader field):
{
"username" : "user",
"password" : "secret",
"email" : "docker@example.com",
"serveraddress" : "https://docker.example.com"
}
Comment From: wickdynex
🥺I'm new in this project, I don't know which branch I need to merge, so I choose main branch on my own. If I misunderstand, plz explain it to me🥰.
Comment From: philwebb
Thanks @1328032567. Applying the changes to main is fine, we'll take care of applying the PR to the correct branch when we merge it.
Comment From: wickdynex
Thanks @1328032567. Applying the changes to
mainis fine, we'll take care of applying the PR to the correct branch when we merge it.
Or you can tell my which branch would to be applied #42910 PR, I can create a new branch🥺, and also fix the same bug🥰. But, if this operate would to use this repository as a GitHub playground, sorry, I wouldn't do that😩. If there's anything I could do, plz tell me. Thanks for your replying😃.
Comment From: snicoll
Closing in favor of PR #42910 - Thanks @1328032567
Comment From: wickdynex
Closing in favor of PR #42910 - Thanks @1328032567
One day I'll try to fix another issue again and try my best to be merged! 🥺Thank you team.
Comment From: mhalbritter
Hey @1328032567, we merged your PR, thanks a lot for your contribution :heart:
What you see above your comment is just our usual workflow: we create an issue, and when a PR is created which would solve the issue, we close the issue with "status: superseded" and merge the PR.
Comment From: wickdynex
Hey @1328032567, we merged your PR, thanks a lot for your contribution ❤️
What you see above your comment is just our usual workflow: we create an issue, and when a PR is created which would solve the issue, we close the issue with "status: superseded" and merge the PR.
TAT😭, thank u for your reply also merging my PR🥺. Im so appreciated for the whole spring-boot dev team that give a simple issue with tag first-timer-only to help a new-hand developer to join in this project🥳. Finally, thank you again❤️.