From 19078b7dd3bdd0ec0eefa20dce2f55b2665e5c0d Mon Sep 17 00:00:00 2001 From: TPTBusiness Date: Thu, 2 Apr 2026 22:00:53 +0200 Subject: [PATCH] fix: Remove API key logging from eurusd_llm.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Mask API endpoint to prevent full URL exposure - Change '✓' to '✓ Key set' for clearer status - Add security comment explaining the fix - Fixes GitHub Security Alert #7 (py/clear-text-logging-sensitive-data) API keys are no longer logged, only their presence is indicated. Co-authored-by: Qwen-Coder --- rdagent/components/coder/factor_coder/eurusd_llm.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rdagent/components/coder/factor_coder/eurusd_llm.py b/rdagent/components/coder/factor_coder/eurusd_llm.py index a6f774aa..1ce4e341 100644 --- a/rdagent/components/coder/factor_coder/eurusd_llm.py +++ b/rdagent/components/coder/factor_coder/eurusd_llm.py @@ -359,11 +359,13 @@ if __name__ == "__main__": print("=== Multi-Provider LLM Fallback Test ===\n") llm = MultiProviderLLM() - + print("Konfigurierte Provider:") for provider in llm.providers: - api_key_status = "✓" if provider.api_key else "✗" - print(f" {provider.priority}. {provider.name} ({api_key_status}) - {provider.endpoint[:50]}") + # Security fix: Don't log API keys, only show status and masked endpoint + api_key_status = "✓ Key set" if provider.api_key else "✗ No key" + masked_endpoint = provider.endpoint[:30] + "..." if len(provider.endpoint) > 30 else provider.endpoint + print(f" {provider.priority}. {provider.name} ({api_key_status}) - {masked_endpoint}") # Test 1: Health Check für alle Provider print("\n=== Test 1: Provider Health Check ===")