Bounty #427: Clear transfer private key after submit#508
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds private key field cleanup to the transfer submission handler. The ChangesPrivate Key Cleanup
Possibly related PRs
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
GHX5T-SOL
left a comment
There was a problem hiding this comment.
Reviewed PR #508 at current head 600bf8eaeb2fbbc562072baf3e4a8533f22c614e as non-author GHX5T-SOL.
No blocker found.
Evidence checked:
- Diff is limited to
app/static/wallet.jsandtests/test_wallet_api.py. - Verified
setupTransfer()now clears the private-key input in afinallyblock after both success and failure paths. - Cross-checked the behavior against the existing GitHub wallet action cleanup pattern already covered by
test_github_wallet_actions_clear_private_key_after_submit_attempt(). - Verified the new regression anchors the transfer submit handler, success result path, error result path,
finally, andclearPrivateKeyField(form)call. - GitHub CI passed on the current head. CodeRabbit was still processing at readback, so no CodeRabbit blocker was available to evaluate.
Validation run locally:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_wallet_api.py::test_transfer_action_clears_private_key_after_submit_attempt tests/test_wallet_api.py::test_github_wallet_actions_clear_private_key_after_submit_attempt -q-> 2 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_wallet_api.py tests/test_wallets.py -q-> 44 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q-> 415 passeduv run --extra dev ruff check .-> passeduv run --extra dev ruff format --check .-> 79 files already formattedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m mypy app-> successPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py-> docs smoke okgit diff --check origin/main...HEAD-> cleangit diff --no-ext-diff origin/main...HEAD | gitleaks stdin --no-banner --redact --exit-code 1-> no leaks found
Assessment: focused #427 wallet hygiene fix; it removes retained private-key material from the transfer form after submit attempts without changing signing, transfer, nonce, payout, auth, or layout behavior.
weilixiong
left a comment
There was a problem hiding this comment.
QUALITY_GATE: LOW risk ✅
2 files, +15/-0: adds finally { clearPrivateKeyField(form) } to setupTransfer() in wallet.js, ensuring private key is cleared even on submit error. New test verifies the finally/clear block exists in transfer function.
Verification: Both test_github_wallet_actions_clear_private_key_after_submit_attempt and test_transfer_action_clears_private_key_after_submit_attempt pass (1.17s, 1.22s).
Security-relevant fix (clearing sensitive key material on error path) — correct and minimal.
Summary:
Evidence:
Validation:
Summary by CodeRabbit
Bug Fixes
Tests