Skip to content

fix: rename MT5_API_KEY to MT5API_SECRET_KEY#16

Merged
dceoy merged 5 commits intomainfrom
bugfix/update-skill
Mar 15, 2026
Merged

fix: rename MT5_API_KEY to MT5API_SECRET_KEY#16
dceoy merged 5 commits intomainfrom
bugfix/update-skill

Conversation

@dceoy
Copy link
Copy Markdown
Owner

@dceoy dceoy commented Mar 15, 2026

Summary

  • rename the server auth environment variable from MT5_API_KEY to MT5API_SECRET_KEY
  • preserve MT5_API_KEY as a backward-compatible fallback during the rename so upgrades do not disable auth unexpectedly
  • switch API key verification to hmac.compare_digest() and fix the remaining quickstart references to the old env var name

Testing

  • /Users/dceoy/util/mt5api/.agents/skills/local-qa/scripts/qa.sh
  • pre-push hook QA during git push -u origin bugfix/update-skill

@dceoy dceoy added bug Something isn't working documentation Improvements or additions to documentation codex labels Mar 15, 2026
@dceoy dceoy changed the title fix: clarify mt5api skill curl usage fix: rename MT5_API_KEY to MT5API_SECRET_KEY Mar 15, 2026
@dceoy dceoy marked this pull request as ready for review March 15, 2026 18:47
@dceoy dceoy self-assigned this Mar 15, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59a7a43c4e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mt5api/config.py
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Clean rename — the env var, constant, config function, auth module, tests, and all user-facing docs are consistent. Two small items worth addressing:

1. Stale API_KEY references in specs/041-mt5-rest-api/quickstart.md

Two references to the old bare API_KEY name were missed (these lines are outside the diff):

  • Line 558: "Ensure API_KEY environment variable is set" → should be MT5API_SECRET_KEY
  • Line 591: nssm set MT5-API AppEnvironmentExtra API_KEY=your-key-here → should be MT5API_SECRET_KEY=your-key-here

2. Pre-existing: timing-attack vulnerable key comparison in auth.py

Not introduced by this PR, but since auth.py is being touched: line 64 uses != for API key comparison, which is susceptible to timing side-channel attacks (CWE-208). Consider switching to hmac.compare_digest() for constant-time comparison — it's a one-line fix:

import hmac

if not hmac.compare_digest(api_key_header_value, expected_key):

This could be a follow-up PR to keep this one focused on the rename.

@dceoy
Copy link
Copy Markdown
Owner Author

dceoy commented Mar 15, 2026

Addressed the review feedback in 9cc23bf.

  • preserved MT5_API_KEY as a backward-compatible fallback during the rename to MT5API_SECRET_KEY
  • switched API key verification to hmac.compare_digest()
  • fixed the remaining quickstart references that still used the old env var name
  • reran /Users/dceoy/util/mt5api/.agents/skills/local-qa/scripts/qa.sh and the pre-push QA hook

@dceoy dceoy merged commit b2c6b89 into main Mar 15, 2026
5 checks passed
@dceoy dceoy deleted the bugfix/update-skill branch March 15, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working codex documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant