Management of bearer tokens for tag listing

Signed-off-by: Andrew Block <andy.block@gmail.com>
This commit is contained in:
Andrew Block
2022-01-14 19:51:09 -06:00
parent c137bfb68b
commit c8a2559236

View File

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