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:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user