Reject oversized account filters#863
Conversation
xiefuzheng713-alt
left a comment
There was a problem hiding this comment.
Approved current head 8a3d39b as non-author.
Scope checked:
app/accounts.py: addedACCOUNT_MAX_LENGTH=128,normalized_account()now returns 400 "account is too long" for generic account inputs before lowercasing.tests/test_account_validation.py: added oversized-account assertions across/api/v1/accounts,/accounts, and MCPget_balance.tests/test_activity.py: added/api/v1/activityoversizedaccountrejection assertion.
Local checks on this head:
uv run --extra dev pytest tests/test_activity.py tests/test_account_validation.py -q-> 51 passed, 1 existing Starlette/httpx warning.uv run --extra dev ruff check app/accounts.py tests/test_activity.py tests/test_account_validation.py-> passed.uv run --extra dev ruff format --check app/accounts.py tests/test_activity.py tests/test_account_validation.py-> 3 files already formatted.uv run --extra dev mypy app/accounts.py app/activity.py-> success.
No actionable issues found.
/claim #799
|
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)
📝 WalkthroughWalkthroughAdds ACCOUNT_MAX_LENGTH = 128 and an early trimmed-length check in normalized_account to raise HTTP 400 ("account is too long") for >128-character inputs; tests added/updated to verify rejection across API, page, MCP, and activity query paths. ChangesAccount 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 452081d2-296a-4794-b92a-ee5f5e32157a
📒 Files selected for processing (3)
app/accounts.pytests/test_account_validation.pytests/test_activity.py
xiefuzheng713-alt
left a comment
There was a problem hiding this comment.
I reviewed the current head for the oversized account validation fix.
Checked changed paths:
- app/accounts.py
- tests/test_account_validation.py
- tests/test_activity.py
Focus review:
- Generic oversized accounts now return 400 �ccount is too long in
ormalized_account(). - Prefix-specific validators (github:, mrwk1,
eserve:bounty:, reasury:) keep their existing stricter errors because they are matched before the generic length gate. - Regression coverage added for API, page, MCP surfaces and activity query boundary.
I did not see regressions in the touched behavior. mergeStateStatus is currently UNSTABLE because CI/quality checks are still in progress.
/claim #799
This looks aligned with issue #798 report #4621709113 and the current bounty scope.
tudorian95
left a comment
There was a problem hiding this comment.
Reviewed current head 778bf3306cf51d2e4f505ac232060575dda6cbfc for Bounty #838.
What I checked:
- Inspected the focused diff in
app/accounts.py,tests/test_account_validation.py, andtests/test_activity.py. - Confirmed the live production before-state is still reproducible with harmless GETs: a 129-character generic account returns HTTP 200 from both
GET /api/v1/accounts/{account}andGET /api/v1/activity?account={account}. - In Docker/uv on a fresh checkout of this PR head:
uv run --extra dev pytest tests/test_activity.py::test_activity_query_rejects_control_characters tests/test_account_validation.py::test_account_views_reject_oversized_generic_accounts -q-> 2 passed, 1 existing Starlette/httpx warning.uv run --extra dev pytest tests/test_activity.py tests/test_account_validation.py -q-> 56 passed, 1 existing warning.uv run --extra dev ruff check app/accounts.py tests/test_activity.py tests/test_account_validation.py-> passed.uv run --extra dev ruff format --check app/accounts.py tests/test_activity.py tests/test_account_validation.py-> passed.uv run --extra dev mypy app/accounts.py app/activity.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 HEADsucceeded with tree48adf907a11e796e11f6b09911016cb7f4461f9a.- GitHub reports the current head as
MERGEABLE.
The change adds a generic account length cap while intentionally preserving the more specific prefixed account validators for GitHub, MRWK wallet, reserve, and treasury forms. I did not find blockers.
Summary
github:,mrwk1,reserve:bounty:, andtreasury:mrwkaccount forms./api/v1/activity, account API/page routes, and MCP balance calls.Bounty #799
Source report: #798 (comment)
Validation
uv run --extra dev pytest tests/test_activity.py::test_activity_query_rejects_control_characters tests/test_account_validation.py::test_account_views_reject_oversized_generic_accounts -q-> 2 passed, 1 existing Starlette/httpx warning.uv run --extra dev pytest tests/test_activity.py tests/test_account_validation.py -q-> 52 passed, 1 existing Starlette/httpx warning.uv run --extra dev ruff check app/accounts.py tests/test_activity.py tests/test_account_validation.py-> passed.uv run --extra dev ruff format --check app/accounts.py tests/test_activity.py tests/test_account_validation.py-> 3 files already formatted.uv run --extra dev mypy app/accounts.py app/activity.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
Public account normalization and public activity/account inspection only. No payout execution, treasury mutation, wallet mutation, transfer signing, ledger mutation, admin-token behavior, private data, secrets, bridge/exchange/cash-out behavior, or MRWK price behavior is changed.
Summary by CodeRabbit
Bug Fixes
Tests