Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test(security): replace Google-shaped key fixture (#6885)

LearningCircuit60d34d1cca20
diff --git a/tests/security/test_log_sanitizer.py b/tests/security/test_log_sanitizer.py
index 22385a8dc7..dc3951a4c2 100644
--- a/tests/security/test_log_sanitizer.py
+++ b/tests/security/test_log_sanitizer.py
@@ -662,17 +662,20 @@ class TestScrubErrorUrlQueryRedaction:
# here Google PSE's real order: key, cx, q — reached the log while
# the URL looked scrubbed:
# ...customsearch/v1?<redacted>]&cx=0123456789&q=does+my+employer+know
+ # The "key=" parameter triggers redaction, so use an obvious
+ # placeholder that will not be mistaken for a real Google API key.
+ api_key = "not-a-secret"
probe = "does+my+employer+know+i+have+multiple+sclerosis"
msg = (
"403 Client Error: Forbidden for url: "
"https://www.googleapis.com/customsearch/v1"
- f"?key=AIzaSyA1234567890abcdefghijklmnopqrstuv&cx=0123456789&q={probe}&num=10"
+ f"?key={api_key}&cx=0123456789&q={probe}&num=10"
)
result = scrub_error(Exception(msg))
assert probe not in result
assert "cx=" not in result
assert "num=10" not in result
- assert "AIzaSyA" not in result
+ assert api_key not in result
assert "https://www.googleapis.com/customsearch/v1?<redacted>" in result
# And nothing of the marker's closing bracket leaks through either.
assert "]" not in result