@@ -552,66 +552,6 @@ t.test('verifyAttestations invalid signature', async t => {
552
552
)
553
553
} )
554
554
555
- t . test ( 'verifyAttestations errors when tuf update fails' , async t => {
556
- tnock ( t , 'https://registry.npmjs.org' )
557
- . get ( '/sigstore' )
558
- . reply ( 200 , {
559
- _id : 'sigstore' ,
560
- _rev : 'deadbeef' ,
561
- name : 'sigstore' ,
562
- 'dist-tags' : { latest : '0.4.0' } ,
563
- versions : {
564
- '0.4.0' : {
565
- name : 'sigstore' ,
566
- version : '0.4.0' ,
567
- dist : {
568
- // eslint-disable-next-line max-len
569
- integrity : 'sha512-KCwMX6k20mQyFkNYG2XT3lwK9u1P36wS9YURFd85zCXPrwrSLZCEh7/vMBFNYcJXRiBtGDS+T4/RZZF493zABA==' ,
570
- // eslint-disable-next-line max-len
571
- attestations :
{ url :
'https://registry.npmjs.org/-/npm/v1/attestations/[email protected] ' , provenance :
{ predicateType :
'https://slsa.dev/provenance/v0.2' } } ,
572
- } ,
573
- } ,
574
- } ,
575
- } )
576
-
577
- const fixture = fs . readFileSync (
578
- path . join ( __dirname , 'fixtures' , 'sigstore/valid-attestations.json' ) ,
579
- 'utf8'
580
- )
581
-
582
- tnock ( t , 'https://tuf-repo-cdn.sigstore.dev' )
583
- . get ( / ./ ) // match any path
584
- . reply ( 404 )
585
-
586
- tnock ( t , 'https://registry.npmjs.org' )
587
- . get ( '/-/npm/v1/attestations/[email protected] ' )
588
- . reply ( 200 , JSON . parse ( fixture ) )
589
-
590
- const f = new RegistryFetcher ( '[email protected] ' , {
591
- registry : 'https://registry.npmjs.org' ,
592
- cache,
593
- verifyAttestations : true ,
594
- [ `//registry.npmjs.org/:_keys` ] : [ {
595
- expires : null ,
596
- keyid : 'SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA' ,
597
- keytype : 'ecdsa-sha2-nistp256' ,
598
- scheme : 'ecdsa-sha2-nistp256' ,
599
- // eslint-disable-next-line max-len
600
- key : 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg==' ,
601
- // eslint-disable-next-line max-len
602
- pemkey : '-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg==\n-----END PUBLIC KEY-----' ,
603
- } ] ,
604
- } )
605
-
606
- return t . rejects (
607
- f . manifest ( ) ,
608
- / s i g s t o r e @ 0 .4 .0 f a i l e d t o v e r i f y a t t e s t a t i o n : e r r o r r e f r e s h i n g T U F m e t a d a t a / ,
609
- {
610
- code : 'EATTESTATIONVERIFY' ,
611
- }
612
- )
613
- } )
614
-
615
555
t . test ( 'verifyAttestations publish attestation for unknown public key' , async t => {
616
556
tnock ( t , 'https://registry.npmjs.org' )
617
557
. get ( '/sigstore' )
0 commit comments