From 5a72bb35c069f1c7143bfe6f1132062cdcec79bc Mon Sep 17 00:00:00 2001 From: iamtoruk Date: Fri, 28 Aug 2026 00:16:11 -0700 Subject: [PATCH] test(plugins): pin deny-by-default rejection of unsigned plugins without CODEBURN_PLUGIN_DEV --- tests/plugin-socket.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/plugin-socket.test.ts b/tests/plugin-socket.test.ts index 5dcab944..5f6f5302 100644 --- a/tests/plugin-socket.test.ts +++ b/tests/plugin-socket.test.ts @@ -128,6 +128,20 @@ describe('loader: rejection reasons', () => { } }) + it('rejects a valid but unsigned manifest when CODEBURN_PLUGIN_DEV is absent (deny-by-default)', async () => { + const pluginDir = join(tmpDir, 'unsigned') + await mkdir(pluginDir, { recursive: true }) + await writeFile(join(pluginDir, 'codeburn-plugin.json'), JSON.stringify(validManifest('unsigned'))) + const env = { ...process.env } + delete env.CODEBURN_PLUGIN_DEV + const loads = await loadPlugins(tmpDir, '0.9.22', env) + expect(loads).toHaveLength(1) + expect(loads[0]!.status).toBe('rejected') + if (loads[0]!.status === 'rejected') { + expect(loads[0]!.reason).toMatch(/unsigned/) + } + }) + it('loads a valid manifest with status:"loaded" and parsed shape', async () => { const pluginDir = join(tmpDir, 'good') await mkdir(pluginDir, { recursive: true })