Skip to content

Commit 0d2a1d4

Browse files
committed
deps: bump sigstore from 2.0.0 to 2.2.0
Signed-off-by: Brian DeHamer <[email protected]>
1 parent 6fd23ad commit 0d2a1d4

File tree

3 files changed

+2
-61
lines changed

3 files changed

+2
-61
lines changed

lib/registry.js

+1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ class RegistryFetcher extends Fetcher {
321321
// specify a public key from the keys endpoint: `registry-host.tld/-/npm/v1/keys`
322322
const options = {
323323
tufCachePath: this.tufCache,
324+
tufForceCache: true,
324325
keySelector: publicKey ? () => publicKey.pemkey : undefined,
325326
}
326327
await sigstore.verify(bundle, options)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"promise-retry": "^2.0.1",
6060
"read-package-json": "^7.0.0",
6161
"read-package-json-fast": "^3.0.0",
62-
"sigstore": "^2.0.0",
62+
"sigstore": "^2.2.0",
6363
"ssri": "^10.0.0",
6464
"tar": "^6.1.11"
6565
},

test/registry.js

-60
Original file line numberDiff line numberDiff line change
@@ -552,66 +552,6 @@ t.test('verifyAttestations invalid signature', async t => {
552552
)
553553
})
554554

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-
/sigstore@0.4.0 failed to verify attestation: error refreshing TUF metadata/,
609-
{
610-
code: 'EATTESTATIONVERIFY',
611-
}
612-
)
613-
})
614-
615555
t.test('verifyAttestations publish attestation for unknown public key', async t => {
616556
tnock(t, 'https://registry.npmjs.org')
617557
.get('/sigstore')

0 commit comments

Comments
 (0)