Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COREPACK_INTEGRITY_KEYS being ignored when corepack is spawned by other tools #468

Open
lsrocha opened this issue Apr 24, 2024 · 2 comments · May be fixed by #470
Open

COREPACK_INTEGRITY_KEYS being ignored when corepack is spawned by other tools #468

lsrocha opened this issue Apr 24, 2024 · 2 comments · May be fixed by #470

Comments

@lsrocha
Copy link

lsrocha commented Apr 24, 2024

After updating to version 0.27, I'm required to set COREPACK_INTEGRITY_KEYS="" to overcome the lack of signature keys in the payload returned by a JFrog private registry.

The environment variable is properly recognized when calling corepack directly, but it ends up ignored when corepack is spawned by other tools, such as Renovate and Jenkins. Those filter out empty environment variables, leading to an unexpected error:

/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:22685
const key = keys.find(({ keyid }) => signatures.some((s) => s.keyid === keyid));
                                                  ^

TypeError: Cannot read properties of undefined (reading 'some')
    at /usr/lib/node_modules/corepack/dist/lib/corepack.cjs:22685:51
    at Array.find (<anonymous>)
    at verifySignature (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:22685:20)
    at installVersion (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:23037:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Engine.ensurePackageManager (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:23449:32)
    at async Engine.executePackageManagerRequest (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:23545:25)
    at async Object.runMain (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:24232:5)

For better support reasons, I suggest that COREPACK_INTEGRITY_KEYS also support 0 and/or false as possible values for disabling the signature validation.

@aduh95
Copy link
Contributor

aduh95 commented Apr 24, 2024

That makes sense, do you want to send a PR?

@lsrocha
Copy link
Author

lsrocha commented Apr 24, 2024

@aduh95 Nice. I will prepare it.

lsrocha added a commit to lsrocha/corepack that referenced this issue Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants