BREAKING CHANGE(rust-bridge): make Rust the primary security backend, remove all TS fallbacks
Some checks failed
CI / Build Test (Current Platform) (push) Failing after 4s
CI / Type Check & Lint (push) Failing after 6s
CI / Build All Platforms (push) Failing after 4s

Phase 3 of the Rust migration: the Rust security bridge is now mandatory
and all TypeScript security fallback implementations have been removed.

- UnifiedEmailServer.start() throws if Rust bridge fails to start
- SpfVerifier gutted to thin wrapper (parseSpfRecord stays in TS)
- DKIMVerifier gutted to thin wrapper delegating to bridge.verifyDkim()
- IPReputationChecker delegates to bridge.checkIpReputation(), keeps LRU cache
- DmarcVerifier keeps alignment logic (works with pre-computed results)
- DKIM signing via bridge.signDkim() in all 4 locations
- Removed mailauth and ip packages from plugins.ts (~1,200 lines deleted)
This commit is contained in:
2026-02-10 20:30:43 +00:00
parent ffe294643c
commit b82468ab1e
24 changed files with 457 additions and 2695 deletions

View File

@@ -11,36 +11,19 @@ export interface IDkimVerificationResult {
signatureFields?: Record<string, string>;
}
/**
* Enhanced DKIM verifier using smartmail capabilities
* DKIM verifier — delegates to the Rust security bridge.
*/
export declare class DKIMVerifier {
private verificationCache;
private cacheTtl;
constructor();
/**
* Verify DKIM signature for an email
* @param emailData The raw email data
* @param options Verification options
* @returns Verification result
* Verify DKIM signature for an email via Rust bridge
*/
verify(emailData: string, options?: {
useCache?: boolean;
returnDetails?: boolean;
}): Promise<IDkimVerificationResult>;
/**
* Fetch DKIM public key from DNS
* @param domain The domain
* @param selector The DKIM selector
* @returns The DKIM public key or null if not found
*/
private fetchDkimKey;
/**
* Clear the verification cache
*/
/** No-op — Rust bridge handles its own caching */
clearCache(): void;
/**
* Get the size of the verification cache
* @returns Number of cached items
*/
/** Always 0 — cache is managed by the Rust side */
getCacheSize(): number;
}