Skip to content

Commit 5eed49b

Browse files
refactor(notation): use auth acesstoken when setting up notation authenticator
Signed-off-by: Jason <[email protected]>
1 parent b6a5ec2 commit 5eed49b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/oci/notation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@ func (v *NotaryVerifier) Verify(ctx context.Context, ref name.Reference) (bool,
162162
}
163163

164164
credentialProvider = func(ctx context.Context, registry string) (oauth.Credential, error) {
165-
if authConfig.Username != "" || authConfig.Password != "" || authConfig.IdentityToken != "" {
165+
if authConfig.Username != "" || authConfig.Password != "" || authConfig.IdentityToken != "" || authConfig.RegistryToken != "" {
166166
return oauth.Credential{
167167
Username: authConfig.Username,
168168
Password: authConfig.Password,
169169
RefreshToken: authConfig.IdentityToken,
170+
AccessToken: authConfig.RegistryToken,
170171
}, nil
171172
}
172173
return oauth.EmptyCredential, nil

0 commit comments

Comments
 (0)