mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/types/registry: add TODO/note about empty authConfigs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -52,6 +52,11 @@ type AuthConfig struct {
|
||||
//
|
||||
// [RFC4648, section 5]: https://tools.ietf.org/html/rfc4648#section-5
|
||||
func EncodeAuthConfig(authConfig AuthConfig) (string, error) {
|
||||
// Older daemons (or registries) may not handle an empty string,
|
||||
// which resulted in an "io.EOF" when unmarshaling or decoding.
|
||||
//
|
||||
// FIXME(thaJeztah): find exactly what code-paths are impacted by this.
|
||||
// if authConfig == (AuthConfig{}) { return "", nil }
|
||||
buf, err := json.Marshal(authConfig)
|
||||
if err != nil {
|
||||
return "", errInvalidParameter{err}
|
||||
|
||||
@@ -109,6 +109,10 @@ func TestEncodeAuthConfig(t *testing.T) {
|
||||
outPlain string
|
||||
}{
|
||||
{
|
||||
// Older daemons (or registries) may not handle an empty string,
|
||||
// which resulted in an "io.EOF" when unmarshaling or decoding.
|
||||
//
|
||||
// FIXME(thaJeztah): find exactly what code-paths are impacted by this.
|
||||
doc: "empty",
|
||||
input: AuthConfig{},
|
||||
outBase64: `e30=`,
|
||||
|
||||
Reference in New Issue
Block a user