feat(security): migrate content scanning and bounce detection to Rust security bridge; add scanContent IPC command and Rust content scanner with tests; update TS RustSecurityBridge and callers, and adjust CI package references

This commit is contained in:
2026-02-10 21:19:13 +00:00
parent b82468ab1e
commit 15a45089aa
21 changed files with 844 additions and 1530 deletions

View File

@@ -1,6 +1,13 @@
import { tap, expect } from '@git.zone/tstest/tapbundle';
import { ContentScanner, ThreatCategory } from '../ts/security/classes.contentscanner.js';
import { Email } from '../ts/mail/core/classes.email.js';
import { RustSecurityBridge } from '../ts/security/classes.rustsecuritybridge.js';
tap.test('setup - start Rust security bridge', async () => {
const bridge = RustSecurityBridge.getInstance();
const ok = await bridge.start();
expect(ok).toEqual(true);
});
// Test instantiation
tap.test('ContentScanner - should be instantiable', async () => {
@@ -258,6 +265,10 @@ tap.test('ContentScanner - should classify threat levels correctly', async () =>
expect(ContentScanner.getThreatLevel(80)).toEqual('high');
});
tap.test('cleanup - stop Rust security bridge', async () => {
await RustSecurityBridge.getInstance().stop();
});
tap.test('stop', async () => {
await tap.stopForcefully();
});