859d61003e
This commit adds the `add_request_rate_limiter` plugin API which allows plugins to add custom rate limiters on top of the default rate limiters which requests by a user's id or the request's IP address. Example to add a rate limiter that rate limits all requests from Googlebot under the same rate limit bucket: ``` add_request_rate_limiter( identifier: :country, key: ->(request) { "country/#{DiscourseIpInfo.get(request.ip)[:country]}" }, activate_when: ->(request) { DiscourseIpInfo.get(request.ip)[:country].present? }, ) ``` |
||
---|---|---|
.. | ||
distributed_cache_spec.rb | ||
flags_spec.rb | ||
hashtag_autocomplete_service_spec.rb | ||
jobs_spec.rb | ||
pausable_multisite_spec.rb | ||
post_spec.rb | ||
request_tracker_spec.rb | ||
s3_store_spec.rb | ||
site_settings_spec.rb |