Problem
The Boost endpoint (/boost-endpoint/info/ and /boost-endpoint/add-or-update/) had no scoped rate limits, so authenticated clients could hammer expensive routes without throttling aligned with Weblate’s REST framework patterns. Production defaults and CI overrides were also undefined for those scopes.
Acceptance Criteria
Implementation Notes
- Scoped throttle classes subclass
ScopedRateThrottle and delegate through @patch_throttle_request so Weblate’s throttle keying matches upstream API views.
settings_override.merge_boost_endpoint_throttle_rates() merges Boost rates into existing REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] without clobbering upstream user / anon entries.
- Endpoint throttle unit tests use
_isolated_throttle_rates fixtures to reload DRF throttle rates and clear the cache per test.
References
src/boost_weblate/endpoint/views.py
src/boost_weblate/settings_override.py
tests/endpoint/test_views.py
tests/test_settings_override.py
tests/django_qbk_format_settings.py
Problem
The Boost endpoint (
/boost-endpoint/info/and/boost-endpoint/add-or-update/) had no scoped rate limits, so authenticated clients could hammer expensive routes without throttling aligned with Weblate’s REST framework patterns. Production defaults and CI overrides were also undefined for those scopes.Acceptance Criteria
BoostEndpointInfoandAddOrUpdateViewapplyUserRateThrottleplus scoped throttles (info,add-or-update) using Weblate’spatch_throttle_request.60/minuteforinfoand10/hourforadd-or-update, overridable viaBOOST_ENDPOINT_THROTTLE_INFOandBOOST_ENDPOINT_THROTTLE_ADD_OR_UPDATE.Retry-Afterheader;add-or-updatedoes not enqueue Celery work once throttled.tests/endpoint/test_views.pycover scoped and user throttling without leaking throttle state between tests.Implementation Notes
ScopedRateThrottleand delegate through@patch_throttle_requestso Weblate’s throttle keying matches upstream API views.settings_override.merge_boost_endpoint_throttle_rates()merges Boost rates into existingREST_FRAMEWORK["DEFAULT_THROTTLE_RATES"]without clobbering upstreamuser/anonentries._isolated_throttle_ratesfixtures to reload DRF throttle rates and clear the cache per test.References
src/boost_weblate/endpoint/views.pysrc/boost_weblate/settings_override.pytests/endpoint/test_views.pytests/test_settings_override.pytests/django_qbk_format_settings.py