diff --git a/CHANGELOG.md b/CHANGELOG.md index 4750646..f105bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ (thanks to @gminog). * Fix initial ownership of /opt/data dir in Dockerfile. * Hide repositories with 0 tags count. +* Compatibility fix with docker_auth v1.5.0. ### 0.8.2 (2019-07-30) diff --git a/registry/client.go b/registry/client.go index 5a26028..eba7049 100644 --- a/registry/client.go +++ b/registry/client.go @@ -106,8 +106,14 @@ func (c *Client) getToken(scope string) string { return "" } - c.tokens[scope] = gjson.Get(data, "token").String() - c.logger.Info("Received new token for scope ", scope) + token := gjson.Get(data, "token").String() + // Fix for docker_auth v1.5.0 only + if token == "" { + token = gjson.Get(data, "access_token").String() + } + + c.tokens[scope] = token + c.logger.Debugf("Received new token for scope %s", scope) return c.tokens[scope] }