Limit wallet search query length#859
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)
📝 WalkthroughWalkthroughA new 500-character length limit is added to wallet search queries on the ChangesWallet search query length validation
Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
alan747271363-art
left a comment
There was a problem hiding this comment.
Reviewed current head fd522b22642019d7c78b26360cb1e85f14ad52e7 as a non-author.
The change is focused on the public /wallets HTML search path: app/public_routes.py now rejects q values longer than 500 characters before building the wallet address/label/GitHub-login LIKE filters, while the existing control-character and repeated-query guards remain unchanged. The regression coverage in tests/test_wallet_api.py checks both sides of the boundary: 500 characters still returns 200 and 501 characters returns the bounded 400 response.
Validation I ran on this exact head:
python -m pytest tests/test_wallet_api.py -q-> 45 passed, 1 existing Starlette/httpx warning.python -m pytest tests/test_wallet_api.py::test_wallet_pages_reject_control_character_filters -q-> 1 passed, 1 existing warning.python -m ruff check app/public_routes.py tests/test_wallet_api.py-> passed.python -m ruff format --check app/public_routes.py tests/test_wallet_api.py-> 2 files already formatted.python -m mypy app/public_routes.py-> success.python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean tree20811048e51cb8ba4b2a0a464f33f3bd348b2f8d.
GitHub state checked before review: hosted Quality, readiness, docs, and image checks is successful; mergeable=MERGEABLE; mergeStateStatus=UNSTABLE only because CodeRabbit is still pending. I did not find a code blocker. Maintainers may still want to wait for CodeRabbit before merging.
Scope is limited to public wallet search input validation. No wallet registration, signatures, balances, transfer signing, ledger mutation, bounty lifecycle, payout execution, treasury mutation, private data, secrets, bridge/exchange/cash-out behavior, or MRWK price behavior is changed.
xiefuzheng713-alt
left a comment
There was a problem hiding this comment.
Reviewed current head as non-author. /claim #799
Summary
/wallets?q=search strings at 500 characters before building walletLIKEfiltersBounty #799
Source report: #798 (comment)
Production evidence before fix
GET https://mrwk.online/wallets?q=<500 a characters>-> HTTP 200, 3890 bytes.GET https://mrwk.online/wallets?q=<501 a characters>-> HTTP 200, 3892 bytes.GET https://mrwk.online/wallets?q=<10000 a characters>-> HTTP 200, 25016 bytes.Current production therefore accepts oversized public wallet search strings instead of failing fast before building SQL
LIKEfilters.Duplicate/current check
wallets+q+length/500found no PR covering this scope.qlength, not wallet search.Validation
uv run --extra dev pytest tests/test_wallet_api.py::test_wallet_pages_reject_control_character_filters -q-> 1 passed, 1 existing Starlette/httpx warning.uv run --extra dev pytest tests/test_wallet_api.py -q-> 45 passed, 1 existing Starlette/httpx warning.uv run --extra dev ruff check app/public_routes.py tests/test_wallet_api.py-> passed.uv run --extra dev ruff format --check app/public_routes.py tests/test_wallet_api.py-> 2 files already formatted.uv run --extra dev mypy app/public_routes.py-> success.uv run --extra dev python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean treeabda6f4c7b8cc6d19c1ef4bc0fd2711b121cfce1.Scope
This PR is limited to the public wallet search page input boundary. It does not change wallet registration, wallet signatures, balances, account normalization, ledger mutation, bounty lifecycle, payout execution, treasury mutation, private data, secrets, bridge/exchange/cash-out behavior, or MRWK price behavior.
Summary by CodeRabbit