discourse/spec/multisite
Alan Guo Xiang Tan 859d61003e
DEV: API to register custom request rate limiting conditions (#30239)
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? },
)
```
2024-12-23 09:57:18 +08:00
..
distributed_cache_spec.rb DEV: Apply syntax_tree formatting to `spec/*` 2023-01-09 11:49:28 +00:00
flags_spec.rb DEV: Call Discourse.redis.flushdb after the end of each test (#29117) 2024-10-09 07:19:31 +08:00
hashtag_autocomplete_service_spec.rb DEV: Change HashtagAutocompleteService to use DiscoursePluginRegistry (#19491) 2022-12-19 13:46:17 +10:00
jobs_spec.rb FEATURE: allow admins to enable announced experimental features (#29244) 2024-10-22 10:56:58 +11:00
pausable_multisite_spec.rb DEV: Apply syntax_tree formatting to `spec/*` 2023-01-09 11:49:28 +00:00
post_spec.rb DEV: Apply syntax_tree formatting to `spec/*` 2023-01-09 11:49:28 +00:00
request_tracker_spec.rb DEV: API to register custom request rate limiting conditions (#30239) 2024-12-23 09:57:18 +08:00
s3_store_spec.rb DEV: Add S3 upload system specs using minio (#22975) 2023-08-23 11:18:33 +10:00
site_settings_spec.rb DEV: Add plugin hook for transforming site setting defaults (#20941) 2023-04-05 12:28:16 +01:00