Open platy opened 7 years ago
I guess we can print a warning on the server side and print an error on the client side saying that it might be a problem with the authentication.
@ripcurld0 I would love to contribute to this project and shall I take this ? and if you give me some leads I would complete it with ease :+1:
@Jeyanthinath yes sure, feel free to send a pull request.
I guess you will have to do these steps:
json.NewDecoder(authJSON).Decode(authConfig)
returns err != nil
saying that daemon failed decoding X-Registry-Auth
X-Registry-Auth
Feel free to IM me at docker-community slack (register here) my handlename is bshust
If the base64url or json decoding of the X-Registry-Auth header fails, the error is swallowed and the credentials are taken as empty. https://github.com/moby/moby/blob/4bf8714fac11e95e835cf78eb15ba5a518c67c4b/api/server/router/image/image_routes.go#L98-L107
The code comments states:
But this situation is not that no auth was given, but that it was badly encoded. If there is a backward compatibility issue, there should be a better way to tackle it than ignoring the header entirely on error.