MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_detect_api_key

Function test_detect_api_key

core/src/security/default.rs:313–319  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

311
312 #[test]
313 fn test_detect_api_key() {
314 let provider = DefaultSecurityProvider::new();
315 let text = "API key: sk-1234567890abcdefghij";
316 let matches = provider.detect_sensitive(text);
317 assert_eq!(matches.len(), 1);
318 assert_eq!(matches[0].0, "api_key");
319 }
320
321 #[test]
322 fn test_sanitize_output() {

Callers

nothing calls this directly

Calls 1

detect_sensitiveMethod · 0.80

Tested by

no test coverage detected