Management of bearer tokens for tag listing

Signed-off-by: Andrew Block <andy.block@gmail.com>
(cherry picked from commit c8a2559236)
pull/10808/head
Andrew Block 4 years ago committed by Martin Hickey
parent 97b477c086
commit 46f0ec4609

@ -112,6 +112,13 @@ func NewClient(options ...ClientOption) (*Client, error) {
return registryauth.EmptyCredential, errors.New("unable to retrieve credentials")
}
// A blank returned username and password value is a bearer token
if username == "" && password != "" {
return registryauth.Credential{
RefreshToken: password,
}, nil
}
return registryauth.Credential{
Username: username,
Password: password,

Loading…
Cancel
Save