mirror of
https://github.com/discourse/discourse.git
synced 2025-01-06 15:44:10 +08:00
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? }, ) ``` |
||
---|---|---|
.. | ||
001-redis.rb | ||
002-freedom_patches.rb | ||
002-rails_failover.rb | ||
004-message_bus.rb | ||
005-site_settings.rb | ||
006-ensure_login_hint.rb | ||
006-mini_profiler.rb | ||
008-rack-cors.rb | ||
009-omniauth.rb | ||
012-web_hook_events.rb | ||
013-excon_defaults.rb | ||
014-track-setting-changes.rb | ||
099-anon-cache.rb | ||
099-drain_pool.rb | ||
100-active-support-type-extensions.rb | ||
100-flags.rb | ||
100-i18n.rb | ||
100-logster.rb | ||
100-oj.rb | ||
100-onebox_options.rb | ||
100-push-notifications.rb | ||
100-quiet_logger.rb | ||
100-regex-timeout.rb | ||
100-secret_token.rb | ||
100-session_store.rb | ||
100-sidekiq.rb | ||
100-silence_logger.rb | ||
100-strong_parameters.rb | ||
100-verify_config.rb | ||
100-wrap_parameters.rb | ||
101-lograge.rb | ||
102-truncate-logs.rb | ||
200-first_middlewares.rb | ||
300-perf.rb | ||
400-deprecations.rb | ||
000-development_reload_warnings.rb | ||
000-mini_sql.rb | ||
000-post_migration.rb | ||
000-trace_pg_connections.rb | ||
000-zeitwerk.rb | ||
assets.rb | ||
filter_parameter_logging.rb |