pub struct InjectionVerifier;Expand description
Defense 1: Injection verification via re-parsing.
After generating code, re-parse it to ensure:
- Syntax is valid
- No injection artifacts remain
- All invariants are properly placed
Implementations§
Source§impl InjectionVerifier
impl InjectionVerifier
Sourcepub fn verify_coverage(
generated_code: &str,
expected_checks: &[String],
) -> ThreatResult<()>
pub fn verify_coverage( generated_code: &str, expected_checks: &[String], ) -> ThreatResult<()>
Verify that generated code contains all expected invariant checks.
§Security Property
Ensures 100% coverage of mutating functions with invariant checks.
Sourcepub fn verify_scope_containment(generated_code: &str) -> ThreatResult<()>
pub fn verify_scope_containment(generated_code: &str) -> ThreatResult<()>
Verify no injected code escapes the intended scope.
§Security Property
Prevents code injection by ensuring all injected statements stay within invariant check blocks.
Auto Trait Implementations§
impl Freeze for InjectionVerifier
impl RefUnwindSafe for InjectionVerifier
impl Send for InjectionVerifier
impl Sync for InjectionVerifier
impl Unpin for InjectionVerifier
impl UnsafeUnpin for InjectionVerifier
impl UnwindSafe for InjectionVerifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more