Comment 3 for bug 1206976

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/41089
Committed: http://github.com/openstack/cinder/commit/2acb6f329bb404e224e525b946c0aa6cdc74040c
Submitter: Jenkins
Branch: master

commit 2acb6f329bb404e224e525b946c0aa6cdc74040c
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
    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)

    Fixes bug: 1206976

    Change-Id: I4adbe3dbe3a0bd607d6e675f230b0442b08ec791