adicu/data.adicu.com — pull request #90 by natebrennand (2014-03-09 05:35:52+00:00)
Title: basic rate limiting

When a user creates their account they're given a `rate_limit` attribute. This is used to determine their allocation per hour. Currently those accesses are split within the hour by the constant, [split_factor](https://github.com/natebrennand/data.adicu.com/blob/a495316788535c323f72d3168f0706d1d9dd1175/data/auth/user.py#L20). It will be straightforward to change this scheme if we think there's a better way.

Upon making a request, we look for a key in redis, `rate:`. If it's found, we make sure they still have requests let before decrementing it. If not, we find their allocated rate from postgres and create an expiring key (life: 60 minutes / `split_factor`) with a value = `limit`/`split_factor` before decrementing it and allowing the request.

I wrote a [mocked test](https://github.com/natebrennand/data.adicu.com/blob/a495316788535c323f72d3168f0706d1d9dd1175/data/tests/test_user.py#L110-L132) as well as an [integration test](https://github.com/natebrennand/data.adicu.com/blob/a495316788535c323f72d3168f0706d1d9dd1175/data/tests/test_user.py#L141-L149).

closes #13.
This necessitated adding a `rate_limit` column to the `users_t` table in Postgres