th: no more throttles for auth'd users

This commit is contained in:
Kouhai 2024-01-13 14:05:33 -08:00
parent bcc0a24acd
commit f50dc0b28f

View file

@ -66,12 +66,14 @@ class Rack::Attack
IpBlock.blocked?(req.remote_ip) IpBlock.blocked?(req.remote_ip)
end end
throttle('throttle_authenticated_api', limit: 1_500, period: 5.minutes) do |req| if !!ENV['TH_DEACTIVATE_AUTHED_API_THROTTLES']
req.authenticated_user_id if req.api_request? throttle('throttle_authenticated_api', limit: 1_500, period: 5.minutes) do |req|
end req.authenticated_user_id if req.api_request?
end
throttle('throttle_per_token_api', limit: 300, period: 5.minutes) do |req| throttle('throttle_per_token_api', limit: 300, period: 5.minutes) do |req|
req.authenticated_token_id if req.api_request? req.authenticated_token_id if req.api_request?
end
end end
throttle('throttle_unauthenticated_api', limit: 300, period: 5.minutes) do |req| throttle('throttle_unauthenticated_api', limit: 300, period: 5.minutes) do |req|