Reject unsupported wallet list filters - #1195
LarryHu0217 wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughThis change introduces a ChangesWallet List Filter Rejection
Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 38cb82ef-8e62-4184-be25-6766dfde42b2
📒 Files selected for processing (2)
app/public_routes.pytests/test_wallet_api.py
qingfeng312
left a comment
There was a problem hiding this comment.
Refs #1009. Reviewed current head f13087225ded3b6fb326b3eb175ff6c64c57803c for PR #1195.
Verdict: approve. The change keeps /wallets scoped to its supported q parameter by adding WALLET_LIST_UNSUPPORTED_FILTERS and calling reject_unsupported_query_params(..., context="wallet list") before rendering the wallet list. The helper already returns deterministic 400 responses for present-but-unsupported query names, and the PR adds regression coverage for representative wallet/account/transfer/list filters plus a positive /wallets?q=mrwk1abc case.
Evidence inspected: app/public_routes.py, app/query_validation.py, tests/test_wallet_api.py, current PR diff, PR body validation notes, and visible check Quality, readiness, docs, and image checks = success. I did not rerun the full test suite locally because this is a narrow route/query-validation change and the PR already reports the focused wallet tests, broader wallet/public/account tests, ruff, mypy, docs smoke, diff-check, and merge-tree validation. No wallet signing, nonce/replay, ledger mutation, transfer execution, custody, bridge, exchange, payout, or secret-handling path is touched.
piaigmt
left a comment
There was a problem hiding this comment.
APPROVE — verified the unsupported wallet-list filter guard on current head f13087225ded3b6fb326b3eb175ff6c64c57803c.
Evidence run locally with a Python 3.12 venv:
python -m pytest tests/test_wallet_api.py::test_wallet_list_rejects_unsupported_filters tests/test_wallet_api.py::test_wallet_list_allows_supported_q_filter -q→9 passed, 1 warning in 1.91spython -m pytest tests/test_wallet_api.py tests/test_public_routes.py tests/test_account_routes.py -q→70 passed, 1 warning in 6.74sruff check app/public_routes.py tests/test_wallet_api.py→All checks passed!ruff format --check app/public_routes.py tests/test_wallet_api.py→2 files already formattedpython -m mypy app/public_routes.py→Success: no issues found in 1 source file
Manual review notes:
- The new
WALLET_LIST_UNSUPPORTED_FILTERSlist covers adjacent filter names that would otherwise be silently ignored on/wallets. - Supported
qsearch stays allowed and is still protected by the existing control-character and repeated-param guards. - The change is limited to public route query validation plus focused wallet API coverage; I did not see ledger mutation, wallet signing, custody, admin-token, or payout/off-ramp behavior changes.
This looks ready to merge.
|
Review for Bounty #1009 at head Verdict: no blocker from diff review. Evidence checked:
Non-blocking suggestion: |
yanyishuai
left a comment
There was a problem hiding this comment.
Review packet (Bounty #933)
- Reviewed PR: #1195
- Head commit:
f13087225ded3b6fb326b3eb175ff6c64c57803c - Files inspected: app/public_routes.py, tests/test_wallet_api.py
- Verdict: Mirrors the activity-filter pattern for wallet list pages: unsupported filters rejected early with context=
wallet list. Scoped change; CI green. - Validation: Inspected
WALLET_LIST_UNSUPPORTED_FILTERSinapp/public_routes.pyand new rejection tests intests/test_wallet_api.py. Confirmed mergeable=clean and quality checks success on current head.
Bounty #933
|
Hi maintainers, this PR is ready for review and the current checks are passing. Please let me know if any changes or additional validation would help. Thank you. |
|
This PR remains ready for review, and the current quality check is passing. Please let me know if any changes or additional validation would help. Thank you. |
Related issue #1011
Summary
/walletsscoped to its supportedqsearch parameter.type,tx_type,from_address,to_address,account,status,limit, andsortwith clear 400 responses instead of silently ignoring them.Duplicate Check
Existing #1011 submissions I found cover transfer prefill,
/meaccount shortcuts, account/wallet navigation, wallet search notice rendering, and wallet action links. I did not find an open PR covering unsupported query-filter rejection on the/walletslist route.Validation
./.venv/bin/python -m pytest tests/test_wallet_api.py::test_wallet_pages_reject_control_character_filters tests/test_wallet_api.py::test_wallet_list_rejects_unsupported_filters -q-> 9 passed, 1 existing Starlette/httpx warning../.venv/bin/python -m pytest tests/test_wallet_api.py tests/test_public_routes.py tests/test_account_routes.py -q-> 69 passed, 1 existing Starlette/httpx warning../.venv/bin/ruff check app/public_routes.py tests/test_wallet_api.py-> passed../.venv/bin/ruff format --check app/public_routes.py tests/test_wallet_api.py-> 2 files already formatted../.venv/bin/python -m mypy app/public_routes.py-> success../.venv/bin/python scripts/docs_smoke.py-> docs smoke ok.git diff --check-> clean.git merge-tree --write-tree origin/main HEAD-> clean tree7762447113c0e738c8786f302ccb0b9ba7e09cef.Scope Boundary
This is limited to public wallet-list query validation and route tests. It does not change wallet signing payloads, nonce/replay checks, transfer execution, ledger mutation, balance accounting, wallet custody, treasury/admin-token behavior, bridge and exchange behavior, MRWK price behavior, private data, or secrets.
Summary by CodeRabbit