Reject ambiguous admin webhook event query params#835
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)
📝 WalkthroughWalkthroughThe PR adds query parameter validation to the ChangesQuery Parameter Validation
Possibly related issues
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 |
jakerated-r
left a comment
There was a problem hiding this comment.
Thanks for the focused admin-webhook-events hardening. I reviewed current head 28eaba193f101e720556f89a3c9707e2fd996474 against current origin/main 53d73feef2ad8a4e44571863c73375d7193c9019.
I do not think this should merge as-is because the PR is currently dirty against main:
git merge-tree --write-tree origin/main origin/pr/835
Auto-merging app/bounty_api.py
CONFLICT (content): Merge conflict in app/bounty_api.py
The conflict is in app/bounty_api.py around /api/v1/admin/webhook-events. Current main already has request: Request and reject_repeated_query_param(request, "status") on that route, while this PR was branched from an older base and adds the adjacent limit checks. The useful remaining delta appears to be the limit duplicate/noncanonical validation and its regression test, but the head needs to be rebased or otherwise reconciled before maintainers can safely evaluate the final merged route.
One more bounty-lifecycle note: the PR body references #656, but #656 is now closed/paid with 0 effective awards remaining. That does not block the code review itself, but it should not be treated as a live #656 payout claim after rebase.
Validation evidence I captured:
gh pr view 835reportsmergeStateStatus=DIRTY, hosted Quality success, and CodeRabbit success/no actionable comments on the current head.git diff --stat origin/main...origin/pr/835shows a narrow 2-file delta:app/bounty_api.pyandtests/test_bounty_api.py.git merge-tree --write-tree origin/main origin/pr/835reproduces the merge conflict inapp/bounty_api.py.- I did not use local
pytest/Ruff as a pass/fail signal because the detached review worktree on this machine does not have the project dependencies installed (fastapimissing, Ruff unavailable there).
gshaowei6
left a comment
There was a problem hiding this comment.
Reviewed current head 28eaba193f101e720556f89a3c9707e2fd996474 as a non-author against current origin/main 53d73feef2ad8a4e44571863c73375d7193c9019.
The patch itself is focused: app/bounty_api.py adds the limit duplicate/non-canonical guards on /api/v1/admin/webhook-events, and tests/test_bounty_api.py covers repeated status, repeated limit, limit=01, and the canonical happy path.
Branch-local validation passed:
pytest tests/test_bounty_api.py -q->19 passed, 1 warningruff check app/bounty_api.py tests/test_bounty_api.py-> passedruff format --check app/bounty_api.py tests/test_bounty_api.py->2 files already formattedpython scripts/docs_smoke.py->docs smoke okgit diff --check origin/main...HEAD-> clean
The current integration blocker is mergeability against latest main: git merge-tree --write-tree origin/main HEAD fails with a content conflict in app/bounty_api.py. Current main already updated api_admin_webhook_events() to accept Request and reject repeated status, while this PR adds the limit duplicate/non-canonical checks in the same block. Please rebase/merge current main and preserve both the existing status guard and the new limit guards/tests, then rerun the focused bounty API tests and formatting checks.
28eaba1 to
7a6b512
Compare
keilogic
left a comment
There was a problem hiding this comment.
Thanks for rebasing this. I reviewed current head 7a6b51213c5f75e215749b92e65f552a0ded4908 against current origin/main 53d73feef2ad8a4e44571863c73375d7193c9019.
The earlier mergeability blocker is resolved: current main already has the Request argument and repeated-status guard, and this head preserves that while adding the repeated/non-canonical limit guards. The final diff is narrow: app/bounty_api.py adds the limit validation calls, and tests/test_bounty_api.py covers repeated status, repeated limit, limit=01, and the canonical happy path.
Validation I ran:
pytest tests/test_bounty_api.py -q->19 passed, 1 warningruff check app/bounty_api.py tests/test_bounty_api.py-> passedruff format --check app/bounty_api.py tests/test_bounty_api.py->2 files already formattedpython scripts/docs_smoke.py->docs smoke okmypy app/bounty_api.py-> successgit diff --check origin/main...HEAD-> cleangit merge-tree --write-tree origin/main HEAD-> clean treed271eb21fed62e9a6594d25479218cd572ca17be
Hosted Quality and CodeRabbit are successful on this head, and GitHub reports mergeStateStatus=CLEAN.
No remaining code blocker found. One bounty-lifecycle note remains: #656 is closed/paid with no effective awards left, so this should not be treated as a live #656 payout claim.
|
Follow-up on my earlier changes-requested review at head The prior mergeability blocker is resolved now. Evidence from the fresh check:
I am not posting this as a separate bounty claim; this is just a follow-up receipt on the blocker I raised earlier so maintainer accounting can see the prior issue is no longer present. |
aunysillyme
left a comment
There was a problem hiding this comment.
Verified the changes on branch xtakenotesx16:fix/admin-webhook-events-query-validation (head: 7a6b512) locally.
- Checked route
/api/v1/admin/webhook-eventsparameter validation. It successfully appliesreject_repeated_query_paramandreject_noncanonical_int_query_paramtolimitas intended. - Ran the unit test suite (
pytest tests/test_bounty_api.py), and all 19 tests pass successfully. - Code is formatted cleanly and passes
ruffcheck with zero errors.
|
Maintainer update: holding this as superseded by merged #823. The useful Bounty note: #656 is closed/exhausted, so there is no live #656 payable path. I did not route this to #799 because this PR did not target that live bounty or link an exact #799 source under its submission rules. No |
Summary
Tightens
/api/v1/admin/webhook-eventsquery parsing so it fails closed for the same ambiguous scalar inputs already rejected by nearby API routes.Fixes the verified report for #656.
Changes
statusquery parameters.limitquery parameters.limit, such as01.Validation
Bounty
This is a fix for the report submitted under
MRWK bounty: 75 MRWK - live verification and bug reports, round 1.Reference: #656
Summary by CodeRabbit