WICG / webpackage

Web packaging format
Other
1.22k stars 114 forks source link

Environment Variable for Sign Password (JS) not working #876

Closed Snugug closed 11 months ago

Snugug commented 11 months ago

I'm trying to pass my signing key into the wbn-sign JS package using WEB_BUNDLE_SIGNING_PASSPHRASE and it's not working. I can see the code path in the source (https://github.com/WICG/webpackage/blob/4300f08d176046a1f22b94a9fcf62f63342c00b5/js/sign/src/cli.ts#L38-L46) for this, but inspecting the compiled cli.js file from v0.1.0, this is the code signature:

async function parseMaybeEncryptedKey(privateKeyFile) {
    try {
        return parsePemKey(privateKeyFile);
    }
    catch (e) {
        console.warn("This might be an encrypted private key, let's try again.");
    }
    return parsePemKey(privateKeyFile, await readPassphrase());
}

It appears to be missing the entire try/catch block for the environment variable. I'm not sure if TS is shaking it out or 0.1.0 was released before this was added, but it'd be great if we could get a new spin of the module that includes it.

Thanks!

sonkkeli commented 11 months ago

I had not yet released that. Now 0.1.1 is out and it should work for you :)