From 66835476b59b8be7593d4cfa03a51c4f265d7e26 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 12 Apr 2017 20:32:48 +0200 Subject: Add support for ratelimiting via annotations This allows adding rate limiting via annotations to controllers, as one example: ``` @UserRateThrottle(limit=5, period=100) @AnonRateThrottle(limit=1, period=100) ``` Would mean that logged-in users can access the page 5 times within 100 seconds, and anonymous users 1 time within 100 seconds. If only an AnonRateThrottle is specified that one will also be applied to logged-in users. Signed-off-by: Lukas Reschke --- .drone.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '.drone.yml') diff --git a/.drone.yml b/.drone.yml index 24e06dd1b25..61d778fc0da 100644 --- a/.drone.yml +++ b/.drone.yml @@ -277,6 +277,17 @@ pipeline: when: matrix: TESTS: integration-maintenance-mode + integration-ratelimiting: + image: nextcloudci/integration-php7.0:integration-php7.0-3 + commands: + - ./occ maintenance:install --admin-pass=admin + - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.local + - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.distributed + - cd build/integration + - ./run.sh features/ratelimiting.feature + when: + matrix: + TESTS: integration-ratelimiting integration-carddav: image: nextcloudci/integration-php7.0:integration-php7.0-3 commands: @@ -516,6 +527,7 @@ matrix: - TESTS: integration-capabilities_features - TESTS: integration-federation_features - TESTS: integration-maintenance-mode + - TESTS: integration-ratelimiting - TESTS: integration-auth - TESTS: integration-carddav - TESTS: integration-dav-v2 -- cgit v1.2.3