From 5764cf1eaa05d7de345c7b51b5c38d7904b8beb7 Mon Sep 17 00:00:00 2001 From: Factory Agent Date: Fri, 16 Oct 2026 15:06:12 +0700 Subject: [PATCH] Gate live browser cookie test behind opt-in --- rust/src/browser/cookies.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/rust/src/browser/cookies.rs b/rust/src/browser/cookies.rs index 3233d702a50..855ab479bab 100755 --- a/rust/src/browser/cookies.rs +++ b/rust/src/browser/cookies.rs @@ -839,18 +839,22 @@ mod tests { assert!(!domain_matches("chatgpt.com.evil.test", "chatgpt.com")); } + /// Manual live check against this machine's installed browsers. It reads + /// and decrypts real `claude.ai` cookies, so it is ignored by default and + /// also requires `CODEXBAR_LIVE_COOKIE_TEST=1`. Prints counts and cookie + /// names only, never values. #[test] + #[ignore = "reads real browser cookie stores; opt in with --ignored and CODEXBAR_LIVE_COOKIE_TEST=1"] fn test_cookie_extraction() { - // This test will only work on a machine with Chrome installed + if std::env::var("CODEXBAR_LIVE_COOKIE_TEST").as_deref() != Ok("1") { + eprintln!("skipping: set CODEXBAR_LIVE_COOKIE_TEST=1 to run the live cookie check"); + return; + } match get_cookies_for_domain("claude.ai") { Ok(cookies) => { println!("Found {} cookies for claude.ai", cookies.len()); for cookie in &cookies { - println!( - " {}={}", - cookie.name, - &cookie.value[..20.min(cookie.value.len())] - ); + println!(" {}", cookie.name); } } Err(e) => {