Rate limit requests per logged-in user or logged-out IP

Description

Add Rack::Attack for rate limiting. The gem allows the common use case of IP-based throttling, but it can also work with Devise users.

The "limit" and "period" options should be configurable through ArchiveConfig.

How to test: Use a tool like siege and hammer the staging site. Expect some speed bumps.

Activity

Show:
Sarken
September 14, 2019, 4:44 PM

I’m going to very presumptuously assign this to Elz because she has a branch:

Sarken
October 11, 2019, 4:17 PM
Sarken
October 11, 2019, 6:06 PM

I made 350 requests to the /works page using cURL and toward the end it started giving me 429 instead of 200 responses, so this looks good!

james_
October 20, 2019, 9:03 AM

I need to have two goes to get hit however all is good.

 

HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests

 

james_
October 29, 2019, 4:39 AM

To be clear I was happy with this. I think that is two of us.

DeployedToBeta

Assignee

Elz J

Reporter

redsummernight

Roadmap

Misc
Visitors

Priority

Medium

Affects versions

Fix versions

Components

BackEnd

Difficulty

Medium

Milestone

Internal 0.9