Rate limit C2S outbox posts and emoji reactions #8042
No reviewers
Labels
No labels
AP C2S
AdminAPI
Breaking API
Breaks existing config
Check if still valid
Data Protection
Do not merge
Document in the changelog
Doing
Feature Request / Enhancement
MastoAPI
NL2
NL4
OStatus
OTP Releases
Refactor
Security
To Do
TwitterAPI
bug
complicated
confirmed
deps
discussion
documentation
easy
feature: to be merged in stable
fix: to be merged in stable
incident
needs to be backported to maint
needs-changes
needs-info
needs-review
performance
regression
unclear
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
pleroma/pleroma!8042
Loading…
Reference in a new issue
No description provided.
Delete branch "lambadalambda/pleroma:fix/c2s-rate-limit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
POST /users/:nickname/outbox(AP C2S) now uses thestatuses_actionslimiter. RateLimiter keys buckets by limiter name and user, so the outbox shares one counter with the Mastodon API status actions./api/v1/pleroma/statuses/:id/reactions/:emoji) now usestatuses_actionsplus a per-statusstatus_id_action:emoji_reactbucket, like favourite and reblog.Not covered: media uploads (AP
upload_media, Mastodon media endpoints).The emoji reaction create and delete endpoints had no rate limiter. Apply :statuses_actions like the other status actions, plus a per-status :status_id_action bucket ("status_id_action:emoji_react") in the same way favourite and reblog do./oc review
opencode-agent:job=145:generation=1
Merge readiness: 3/5 (capped by one P1 below)
P1 — Rebase onto current develop before merge, or favourite/reblog per-status limiting regresses to per-user
Base develop already contains #8043 (
53b79781d), which fixed StatusController to use params: ["id"] because that controller keeps string param keys (CastAndValidate, replace_params: false), so params: [:id] never matches and status_id_action collapses to a single bucket per user. This branch forked before that fix, so the base-to-head diff shows ["id"] -> [:id] on both plugs (status_id_action:reblog_unreblog, status_id_action:fav_unfav) and drops the per-status test block. Merging as-is reintroduces the bug: after a few favourites/reblogs within the status_id_action window across distinct statuses, legitimate users get 429 Throttled, because the limit is keyed per user instead of per user+status.Triggering condition: any user favouriting/reblogging more distinct statuses than the status_id_action limit within one window.
Smallest correction: rebase onto current develop, keep params: ["id"] in lib/pleroma/web/mastodon_api/controllers/status_controller.ex (both plugs), and retain the status_id_action rate limit test block.
Checked, no findings
No other concrete defects in this diff.
cdc741f3ce924df2a063/oc review
opencode-agent:job=146:generation=1
Merge readiness: 5/5 — production-ready, no findings
Prior REQUEST_CHANGES (job=145) P1 is addressed in this head: the branch no longer touches lib/pleroma/web/mastodon_api/controllers/status_controller.ex, and the base already contains #8043 (
53b79781d) with params: ["id"]. No per-status regression remains.Checked, no findings:
No concrete actionable defects introduced by this pull request.