diff --git a/public/app/features/plugins/sandbox/sandbox_plugin_loader_registry.test.ts b/public/app/features/plugins/sandbox/sandbox_plugin_loader_registry.test.ts index 9ff282baef8..a0c0121ee0f 100644 --- a/public/app/features/plugins/sandbox/sandbox_plugin_loader_registry.test.ts +++ b/public/app/features/plugins/sandbox/sandbox_plugin_loader_registry.test.ts @@ -7,6 +7,7 @@ import { shouldLoadPluginInFrontendSandbox, setSandboxEnabledCheck, isPluginFrontendSandboxEnabled, + isPluginFrontendSandboxEligible, } from './sandbox_plugin_loader_registry'; jest.mock('@grafana/runtime', () => ({ @@ -89,4 +90,11 @@ describe('Sandbox eligibility checks', () => { expect(customCheck).toHaveBeenCalledWith({ pluginId: 'test-plugin' }); expect(result).toBe(false); }); + + test('isPluginFrontendSandboxEligible returns false for plugins with internal signature', async () => { + //@ts-expect-error We don't publicly export the internal signature + getPluginSettingsMock.mockResolvedValue({ ...fakePlugin, signature: 'internal' }); + const result = await isPluginFrontendSandboxEligible({ pluginId: 'test-plugin' }); + expect(result).toBe(false); + }); }); diff --git a/public/app/features/plugins/sandbox/sandbox_plugin_loader_registry.ts b/public/app/features/plugins/sandbox/sandbox_plugin_loader_registry.ts index 42848ce7863..9d94a3556e0 100644 --- a/public/app/features/plugins/sandbox/sandbox_plugin_loader_registry.ts +++ b/public/app/features/plugins/sandbox/sandbox_plugin_loader_registry.ts @@ -64,7 +64,7 @@ export async function isPluginFrontendSandboxEligible({ try { // don't run grafana-signed plugins in sandbox const pluginMeta = await getPluginSettings(pluginId, { showErrorAlert: false }); - if (pluginMeta.signatureType === PluginSignatureType.grafana) { + if (pluginMeta.signatureType === PluginSignatureType.grafana || pluginMeta.signature === 'internal') { return false; } } catch (e) {