Skip to content

Commit

Permalink
Management of bearer tokens for tag listing
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Block <andy.block@gmail.com>
(cherry picked from commit c8a2559)
  • Loading branch information
sabre1041 authored and hickeyma committed Feb 23, 2022
1 parent 97b477c commit 46f0ec4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/registry/client.go
Expand Up @@ -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,
Expand Down

0 comments on commit 46f0ec4

Please sign in to comment.