Build the production Hub public key in (1.42.1)
PRODUCTION_PUBLIC_KEY is the key the production Hub serves at /api/public-key, normalised to PEM, so installs no longer need HUB_PUBLIC_KEY. Test covers the built-in key with the env var unset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -124,6 +124,18 @@ describe('pasting the Hub public key', () => {
|
||||
expect(normalisePem('')).toBeNull();
|
||||
expect(normalisePem(undefined)).toBeNull();
|
||||
});
|
||||
|
||||
test('without HUB_PUBLIC_KEY the built-in production key is used', () => {
|
||||
const { hubPublicKey, PRODUCTION_PUBLIC_KEY } = require('../src/hub/publicKey');
|
||||
const saved = process.env.HUB_PUBLIC_KEY;
|
||||
delete process.env.HUB_PUBLIC_KEY;
|
||||
try {
|
||||
expect(PRODUCTION_PUBLIC_KEY).toBeTruthy();
|
||||
expect(crypto.createPublicKey(hubPublicKey()).asymmetricKeyType).toBe('ed25519');
|
||||
} finally {
|
||||
if (saved !== undefined) process.env.HUB_PUBLIC_KEY = saved;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('version comparison for "update available"', () => {
|
||||
|
||||
Reference in New Issue
Block a user