Detect sensitive data in text
(&self, text: &str)
| 188 | |
| 189 | /// Detect sensitive data in text |
| 190 | fn detect_sensitive(&self, text: &str) -> Vec<(String, String)> { |
| 191 | let mut matches = Vec::new(); |
| 192 | |
| 193 | for pattern in &self.patterns { |
| 194 | for capture in pattern.regex.find_iter(text) { |
| 195 | matches.push((pattern.name.clone(), capture.as_str().to_string())); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | matches |
| 200 | } |
| 201 | |
| 202 | /// Check for injection patterns |
| 203 | pub fn detect_injection(&self, text: &str) -> Vec<String> { |