From 4f9cb29775f98b17386e5f6c1aef365f51074176 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Thu, 19 Nov 2015 19:29:07 +0100 Subject: [PATCH] also add a throttle --- lib/travis/api/attack.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/travis/api/attack.rb b/lib/travis/api/attack.rb index 66679446..dc0a247d 100644 --- a/lib/travis/api/attack.rb +++ b/lib/travis/api/attack.rb @@ -59,6 +59,14 @@ class Rack::Attack end end + + ### + # Throttle: unauthenticated requests to /auth/github - 1 per minute + # Scoped by: IP address + throttle('req/ip/1min', limit: 1, period: 1.minute) do |request| + request.ip unless request.authenticated? and request.path == '/auth/github' + end + ### # Throttle: unauthenticated requests - 500 per minute # Scoped by: IP address