Skip to content

Mask MT5 passwords and fix stale docs#97

Merged
dceoy merged 3 commits into
mainfrom
bugfix/issue-93-95-password-docs
Jul 3, 2026
Merged

Mask MT5 passwords and fix stale docs#97
dceoy merged 3 commits into
mainfrom
bugfix/issue-93-95-password-docs

Conversation

@dceoy

@dceoy dceoy commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Closes #93
Closes #95

Summary

  • normalize Mt5Config.password to pydantic.SecretStr so repr(), str(), and model dumps mask MT5 passwords
  • unwrap the real password only at the MT5 initialize/login boundary so runtime behavior is unchanged
  • fix the stale initialize_and_login_mt5 docstring
  • update README error-handling guidance for the current Mt5RuntimeError API
  • update the README coverage statement to the enforced 100% threshold
  • remove stale trading.py / dry-run contributor guidance from AGENTS.md and CLAUDE.md

Validation

  • uv run pytest --no-cov tests/test_dataframe.py -k 'Mt5Config or masks_nested_password or unwraps_secret_password_override or context_manager_uses_config_and_retries or initialize_and_login'
  • .agents/skills/local-qa/scripts/qa.sh

Notes

  • CLAUDE.md is a symlink to AGENTS.md, so the contributor-guide update applies to both.

@dceoy dceoy self-assigned this Jul 3, 2026

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

Copy link
Copy Markdown

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: 81ab51670c

ℹ️ 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 pdmt5/dataframe.py
dceoy and others added 2 commits July 3, 2026 23:13
- Refactor initialize() tests: combine test_initialize_with_parameters,
  test_initialize_with_credentials_without_path, and
  test_initialize_unwraps_secret_password into parametrized
  test_initialize_with_password_types covering both path variations and
  password types (str and SecretStr). All cases verify MT5 receives
  unwrapped plain password strings.

- Refactor login() tests: combine test_login_success,
  test_login_unwraps_secret_password, and test_login_without_timeout into
  parametrized test_login_with_password_types covering timeout variations
  and password types (str and SecretStr). All cases verify MT5 receives
  unwrapped plain password strings. Keep test_login_failure as separate
  test for failure path.

- Parametrize Mt5Config password coercion: combine test_custom_config and
  test_config_accepts_secretstr_input into parametrized
  test_config_password_coercion covering both str and SecretStr inputs.
  Keep test_config_masks_password_in_string_representations and
  test_config_immutable as separate tests for clarity.

- Maintain 100% branch coverage and explicit assertions that MT5 boundary
  calls receive unwrapped plain password strings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@dceoy dceoy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reviewed the password masking and documentation updates.

No blocking issues found. Mt5Config.password is normalized to SecretStr, printable/model dump paths are covered, and both Mt5DataClient.initialize_and_login_mt5 and direct Mt5Client.initialize/login boundaries unwrap the real password before calling MetaTrader5. The stale README/AGENTS guidance is also aligned with the current API and structure.

CI is green on the latest head commit.

@dceoy dceoy merged commit e5454e1 into main Jul 3, 2026
8 checks passed
@dceoy dceoy deleted the bugfix/issue-93-95-password-docs branch July 3, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant