mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-11-29 10:43:47 +00:00
test(plugins): pin deny-by-default rejection of unsigned plugins without CODEBURN_PLUGIN_DEV
This commit is contained in:
parent
52bde7c4dd
commit
5a72bb35c0
1 changed files with 14 additions and 0 deletions
|
|
@ -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 })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue