Roundup Tracker - Issues

Message6422

Author rouilj
Recipients rouilj, schlatterbeck
Date 2019-03-24.01:54:29
Message-id <1553392470.59.0.200591739015.issue2551036@roundup.psfhosted.org>
In-reply-to
At some point we should add a mechanism to limit REST and xmlrpc api
use. This has no impact on the API returned from the call. The
additional headers will simply be ignored by the client.

Suggest implementing the following headers:

    X-Rate-Limit-Limit: number of allowed requests in the current
         period (integer)

    X-Rate-Limit-Remaining: number of remaining requests in the
        current period (integer)

    X-Rate-Limit-Reset: number of seconds left in the current period
        (integer)

See: https://developer.twitter.com/en/docs/basics/rate-limiting.html
for examples. If more than X-Rate-Limit-Limit requests are done in the
period, return HTTP 429 “Too Many Requests” and a json/xml error
document like:

  {
    "error": {
        "msg": "Rate limit exceeded. More than X requests in Y seconds.",
        "status": 429
    }
}

The data elements associated with this function are:

  period: say 10 minutes
  request limit: 100 requests
  current-request count: must be less than request limit 
  period start: now() - this value > period, reset current-request count

These should be associated with a user in roundup.

Initial thought, period and request limit are values added to the user
object/schema.  The user should not be able to edit them.

current-request count and period start could be associated with the
session database (I think it has timeouts on session which would be
ideal for this). Or it could be stored in fields in the user object.
History
Date User Action Args
2019-03-24 01:54:30rouiljsetrecipients: + rouilj, schlatterbeck
2019-03-24 01:54:30rouiljsetmessageid: <1553392470.59.0.200591739015.issue2551036@roundup.psfhosted.org>
2019-03-24 01:54:30rouiljlinkissue2551036 messages
2019-03-24 01:54:29rouiljcreate