discourse/spec/requests/api
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
..
schemas DEV: Update create user w/ custom fields api docs (#30133) 2024-12-05 12:28:48 -07:00
shared
backups_spec.rb
badges_spec.rb
categories_spec.rb
groups_spec.rb
invites_spec.rb
multiple_invites_spec.rb
notifications_spec.rb
posts_spec.rb
private_messages_spec.rb
rate_limits_spec.rb DEV: API to register custom request rate limiting conditions (#30239) 2024-12-23 09:57:18 +08:00
search_spec.rb
site_spec.rb
tags_spec.rb
topics_spec.rb FEATURE: Add skip notification option to group invite to topic (#29741) 2024-11-14 13:00:15 -03:00
uploads_spec.rb
user_badges_spec.rb
users_spec.rb DEV: Change hide_email_address_taken default to true (#30293) 2024-12-17 10:46:04 +08:00