Skip to content

Conversation

@Smartoneinok
Copy link
Collaborator

I updated the polygon client to be the massive client and updated it to the most recent version.
I also changed the list_benzinga_news to use the new v2 method in the client. I tested this with the inspector. Added in a test class for this as well as .env testing capability.

return

print("Testing list_benzinga_news v2 API integration")
print(f"API Key: {api_key[:10]}...{api_key[-4:] if len(api_key) > 14 else '****'}")

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High test

This expression logs sensitive data (password) as clear text.

Copilot Autofix

AI 2 months ago

To fix the problem, remove the print statement that exposes any portion of the sensitive API key. Instead of outputting the actual value or any substring thereof, print a message indicating that the API key is set without revealing any part of it. This maintains the logic flow (still confirming that the API key is loaded), but avoids logging even a partial secret.

Details:

  • Only replace line 145 and its string output.
  • You may print something generic (e.g., "API Key found in environment.") or similar.
  • No changes to logic, imports, or additional functions are necessary, as only the output format is altered.
  • Ensure that the replacement line gives no hint of the API key’s contents or length.

Suggested changeset 1
tests/test_benzinga_news.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tests/test_benzinga_news.py b/tests/test_benzinga_news.py
--- a/tests/test_benzinga_news.py
+++ b/tests/test_benzinga_news.py
@@ -142,7 +142,7 @@
         return
     
     print("Testing list_benzinga_news v2 API integration")
-    print(f"API Key: {api_key[:10]}...{api_key[-4:] if len(api_key) > 14 else '****'}")
+    print("API Key: [REDACTED] (loaded from environment)")
     print()
     
     tests = [
EOF
@@ -142,7 +142,7 @@
return

print("Testing list_benzinga_news v2 API integration")
print(f"API Key: {api_key[:10]}...{api_key[-4:] if len(api_key) > 14 else '****'}")
print("API Key: [REDACTED] (loaded from environment)")
print()

tests = [
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to do

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear-text logging of sensitive information

This expression logs sensitive data (password) as clear text.

Show more details

pyproject.toml Outdated
"mcp[cli]>=1.15.0",
"polygon-api-client>=1.15.4",
"massive>=2.0.1",
"python-dotenv>=1.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the latest version of python-dotenv is 1.2.1. Can we set this to "python-dotenv>=1.2.0" to stay close to current?

Copy link

@ghost ghost Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to find solution

Copy link
Collaborator

@joedursun joedursun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor comment but overall LGTM. Thanks, @Smartoneinok!

@Smartoneinok Smartoneinok merged commit 519b666 into master Nov 18, 2025
4 checks passed
@Smartoneinok Smartoneinok deleted the news-update branch November 18, 2025 17:51
@ghost
Copy link

ghost commented Jan 19, 2026

@nsknithish13-cmd

@ghost
Copy link

ghost commented Jan 19, 2026

@nsknithish13-cmd

@ghost
Copy link

ghost commented Jan 20, 2026

I updated the polygon client to be the massive client and updated it to the most recent version.
I also changed the list_benzinga_news to use the new v2 method in the client. I tested this with the inspector. Added in a test class for this as well as .env testing capability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants