MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_fallback_pattern_detection

Function test_fallback_pattern_detection

src/security/sql_injection_detector.rs:577–589  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

575
576 #[test]
577 fn test_fallback_pattern_detection() {
578 let detector = SqlInjectionDetector::new();
579
580 let malicious_queries = [
581 "SELECT * FROM users'; DROP TABLE users; --",
582 "SELECT * FROM users WHERE name = 'test' OR 'a'='a'",
583 ];
584
585 for query in &malicious_queries {
586 let result = detector.analyze_query(query);
587 assert!(result.is_err(), "Should reject malicious query: {}", query);
588 }
589 }
590
591 #[test]
592 fn test_dangerous_functions() {

Callers

nothing calls this directly

Calls 1

analyze_queryMethod · 0.45

Tested by

no test coverage detected