Management of bearer tokens for tag listing

Signed-off-by: Andrew Block <andy.block@gmail.com>
pull/10558/head
Andrew Block 4 years ago
parent c137bfb68b
commit c8a2559236
No known key found for this signature in database
GPG Key ID: 02DFE631AEF35EBC

@ -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