Current master does now respect ratelimiting, since parsing of the
api-paste.ini was faulty. api-paste.ini limited user limiting by
setting a line as follows:
user:<user-id>:(GET, *, ".*", 4, minute) which was passed to the
Limiter as kwargs with "user" as a key. Thus multiple user limiting
was not possible as well as extracting the id of the user was bound
to fail, since we checked on the key with startswith("user:")
An example config in the api-paste.ini has to look as follows:
limits = (POST, "*", .*, 10, MINUTE)
limits.<user-id1>:(GET, "*", .*, 4, minute)
limits.<user-id2>:(GET, "*", .*, 2, minute)
Reviewed: https:/ /review. openstack. org/41089 github. com/openstack/ cinder/ commit/ 2acb6f329bb404e 224e525b946c0aa 6cdc74040c
Committed: http://
Submitter: Jenkins
Branch: master
commit 2acb6f329bb404e 224e525b946c0aa 6cdc74040c
Author: Seif Lotfy <email address hidden>
Date: Fri Aug 9 13:37:38 2013 +0000
Fix ratelimiting
Current master does now respect ratelimiting, since parsing of the <user-id> :(GET, *, ".*", 4, minute) which was passed to the
api-paste.ini was faulty. api-paste.ini limited user limiting by
setting a line as follows:
user:
Limiter as kwargs with "user" as a key. Thus multiple user limiting
was not possible as well as extracting the id of the user was bound
to fail, since we checked on the key with startswith("user:")
An example config in the api-paste.ini has to look as follows: <user-id1> :(GET, "*", .*, 4, minute) <user-id2> :(GET, "*", .*, 2, minute)
limits = (POST, "*", .*, 10, MINUTE)
limits.
limits.
Fixes bug: 1206976
Change-Id: I4adbe3dbe3a0bd 607d6e675f230b0 442b08ec791