Skip to content

[codex] Enforce shared relay admission limits (BUZZ-SEC-019)#1917

Open
jmecom wants to merge 2 commits into
mainfrom
codex/fix-buzz-sec-019
Open

[codex] Enforce shared relay admission limits (BUZZ-SEC-019)#1917
jmecom wants to merge 2 commits into
mainfrom
codex/fix-buzz-sec-019

Conversation

@jmecom

@jmecom jmecom commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What changed

The relay now applies its shared Redis-backed admission limits to authenticated WebSocket EVENT, REQ, and COUNT messages and to the NIP-98 /events, /query, and /count endpoints. WebSocket traffic receives a rate-limit notice, HTTP traffic receives 429, and both paths reject work when the shared limiter is unavailable.

The limits distinguish ordinary request volume from event publication, retain the existing human-versus-agent message budgets, and emit rejection metrics by transport and reason.

Why

Buzz already defined tenant- and principal-scoped limits, but the general Redis limiter was never connected to relay admission. A member could therefore consume shared database and relay capacity without hitting those configured budgets.

Impact

Normal authenticated relay work is now bounded consistently across HTTP and WebSocket transports. Redis availability becomes part of this admission boundary: failure to evaluate a shared limit fails closed instead of silently bypassing it.

Testing

  • cargo test -p buzz-relay admission::tests --lib

Addresses BUZZ-SEC-019.

@jmecom jmecom marked this pull request as ready for review July 15, 2026 18:17
@jmecom jmecom requested a review from a team as a code owner July 15, 2026 18:17
@jmecom jmecom force-pushed the codex/fix-buzz-sec-019 branch 3 times, most recently from d709150 to e0ea0d3 Compare July 16, 2026 19:44
@jmecom jmecom force-pushed the codex/fix-buzz-sec-019 branch from e0ea0d3 to 1210ec2 Compare July 16, 2026 20:33
@jmecom jmecom force-pushed the codex/fix-buzz-sec-019 branch from 1210ec2 to 0fd928b Compare July 16, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants