Skip to content

Throttle anonymous client registration at 5/hour - #576

Open
jrhoads wants to merge 1 commit into
devfrom
quickwin/register-throttle
Open

jrhoads wants to merge 1 commit into
devfrom
quickwin/register-throttle

Conversation

@jrhoads

@jrhoads jrhoads commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add ClientRegistrationThrottle, an AnonRateThrottle subclass with class-level rate = "5/hour", and set it as throttle_classes on ClientRegistrationView.
  • Leave settings.py untouched (no DEFAULT_THROTTLE_RATES / DEFAULT_THROTTLE_CLASSES changes).
  • Add a unit test that asserts the wiring and that the sixth anonymous request is throttled, using check_throttles so no email is sent.

Test plan

  • python manage.py test rorapi.tests.tests_unit.tests_register_throttle
  • CI tests_unit on this PR
Open in Web Open in Cursor 

Add a ClientRegistrationThrottle (AnonRateThrottle subclass with a
class-level rate) on ClientRegistrationView so settings.py stays
unchanged. Cover the wiring and 429-after-five-requests path with a
unit test that never sends email.

Co-authored-by: Joseph Rhoads <jrhoads@users.noreply.github.com>
@jrhoads jrhoads added the quickwin:wave-2 label Sep 25, 2026 — with Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants