Skip to content

Commit 3021f84

Browse files
committed
add authentication to remote descriptor retrieval in fetchAttestationsForReference
Signed-off-by: rafi <refaei.shikho@hotmail.com>
1 parent 1e72d52 commit 3021f84

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cmd/devguard-scanner/scanner/discover.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"encoding/json"
2222
"fmt"
2323

24+
"github.com/google/go-containerregistry/pkg/authn"
2425
"github.com/google/go-containerregistry/pkg/name"
2526
"github.com/google/go-containerregistry/pkg/v1/remote"
2627
"github.com/pkg/errors"
@@ -34,7 +35,7 @@ type AttestationFileLine struct {
3435
}
3536

3637
func fetchAttestationsForReference(ctx context.Context, ref name.Reference) ([]oci.Signature, error) {
37-
desc, err := remote.Get(ref, remote.WithContext(ctx))
38+
desc, err := remote.Get(ref, remote.WithContext(ctx), remote.WithAuthFromKeychain(authn.DefaultKeychain))
3839
if err != nil {
3940
return nil, errors.Wrap(err, "failed to get remote descriptor")
4041
}

0 commit comments

Comments
 (0)