Merge pull request #10558 from sabre1041/bearer-token-oci

Management of bearer tokens for tag listing
This commit is contained in:
Josh Dolitsky
2022-01-26 10:06:50 -06:00
committed by GitHub

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,