Skip to content

Commit 3ae73f2

Browse files
committedMay 4, 2022
feat: add _signatures to manifest
1 parent cb08d28 commit 3ae73f2

File tree

3 files changed

+16
-67
lines changed

3 files changed

+16
-67
lines changed
 

‎lib/registry.js

+3
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ class RegistryFetcher extends Fetcher {
165165
}
166166
if (this.integrity) {
167167
mani._integrity = String(this.integrity)
168+
if (dist.signatures) {
169+
mani._signatures = dist.signatures
170+
}
168171
}
169172
this.package = rpj.normalize(mani)
170173
return this.package

‎test/fixtures/abbrev-manifest-full.json

-61
This file was deleted.

‎test/registry.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,26 @@ t.test('provide different type of integrity, concats', async t => {
128128
))
129129
})
130130

131-
t.test('provide matching integrity, totes ok', async t => {
131+
t.test('provide matching integrity, totes ok, includes signature', async t => {
132132
const f = new RegistryFetcher('@isaacs/namespace-test', {
133133
registry,
134134
cache,
135135
// eslint-disable-next-line max-len
136136
integrity: 'sha512-5ZYe1LgwHIaag0p9loMwsf5N/wJ4XAuHVNhSO+qulQOXWnyJVuco6IZjo+5u4ZLF/GimdHJcX+QK892ONfOCqQ==',
137137
})
138-
return f.manifest().then(mani =>
139-
t.equal(
140-
mani._integrity,
138+
return f.manifest().then(mani => {
139+
t.match(mani, {
141140
// eslint-disable-next-line max-len
142-
'sha512-5ZYe1LgwHIaag0p9loMwsf5N/wJ4XAuHVNhSO+qulQOXWnyJVuco6IZjo+5u4ZLF/GimdHJcX+QK892ONfOCqQ=='
143-
))
141+
_integrity: 'sha512-5ZYe1LgwHIaag0p9loMwsf5N/wJ4XAuHVNhSO+qulQOXWnyJVuco6IZjo+5u4ZLF/GimdHJcX+QK892ONfOCqQ==',
142+
_signatures: [
143+
{
144+
keyid: 'SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA',
145+
// eslint-disable-next-line max-len
146+
sig: 'MEQCIHXwKYe70+xcDOvFhM1etZQFUKEwz9VarppUbp5/Ie1+AiAM7aZcT1a2JR0oF/XwjNb13YEHwiagnDapLgYbklRvtA==',
147+
},
148+
],
149+
})
150+
})
144151
})
145152

146153
t.test('404 fails with E404', t => {

0 commit comments

Comments
 (0)
Please sign in to comment.