Skip to content

Commit 1116ef2

Browse files
committed
Fix regex patterns and remove missing benchmark reference
1 parent ee62825 commit 1116ef2

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,3 @@ path = "examples/audit_trail.rs"
4848
name = "encrypted_logging"
4949
path = "examples/encrypted_logging.rs"
5050

51-
[[bench]]
52-
name = "logging_benchmark"
53-
harness = false

src/redaction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ impl CompiledPatterns {
7575
phone: Regex::new(r"\b(\+?1?[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b").unwrap(),
7676
ip_address: Regex::new(r"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b").unwrap(),
7777
bank_account: Regex::new(r"\b\d{8,17}\b").unwrap(),
78-
api_key: Regex::new(r"(?i)(api[_-]?key|token|secret|bearer)\s*[:=]\s*['\"]?[\w-]{20,}['\"]?").unwrap(),
79-
password: Regex::new(r"(?i)(password|passwd|pwd)\s*[:=]\s*['\"]?[^\s'\"]+['\"]?").unwrap(),
78+
api_key: Regex::new(r"(?i)(api[_-]?key|token|secret|bearer)\s*[:=]\s*['\x22]?[A-Za-z0-9_-]{20,}['\x22]?").unwrap(),
79+
password: Regex::new(r"(?i)(password|passwd|pwd)\s*[:=]\s*['\x22]?[^\s'\x22]+['\x22]?").unwrap(),
8080
}
8181
}
8282
}

0 commit comments

Comments
 (0)