Skip to content

Commit

Permalink
Revert _id change
Browse files Browse the repository at this point in the history
  • Loading branch information
feelepxyz committed May 31, 2022
1 parent 37caf35 commit c75f001
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,21 @@ class RegistryFetcher extends Fetcher {
if (dist.signatures) {
if (this.opts.verifySignatures) {
// validate and throw on error, then set _signatures
const _id = `${mani.name}@${mani.version}`
const message = `${_id}:${mani._integrity}`
const message = `${mani._id}:${mani._integrity}`
for (const signature of dist.signatures) {
const publicKey = this.registryKeys &&
this.registryKeys.filter(key => (key.keyid === signature.keyid))[0]
if (!publicKey) {
throw Object.assign(new Error(
`${_id} has a registry signature with keyid: ${signature.keyid} ` +
`${mani._id} has a registry signature with keyid: ${signature.keyid} ` +
`but no corresponding public key can be found`
), { code: 'EMISSINGSIGNATUREKEY' })
}
const validPublicKey =
!publicKey.expires || (Date.parse(publicKey.expires) > Date.now())
if (!validPublicKey) {
throw Object.assign(new Error(
`${_id} has a registry signature with keyid: ${signature.keyid} ` +
`${mani._id} has a registry signature with keyid: ${signature.keyid} ` +
`but the corresponding public key ` +
`has expired ${publicKey.expires}`
), { code: 'EEXPIREDSIGNATUREKEY' })
Expand All @@ -196,7 +195,7 @@ class RegistryFetcher extends Fetcher {
)
if (!valid) {
throw Object.assign(new Error(
`${_id} has an invalid registry signature with ` +
`${mani._id} has an invalid registry signature with ` +
`keyid: ${publicKey.keyid} and signature: ${signature.sig}`
), {
code: 'EINTEGRITYSIGNATURE',
Expand Down

0 comments on commit c75f001

Please sign in to comment.