aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Middleware/Security
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-05-11 09:17:30 +0200
committerJoas Schilling <coding@schilljs.com>2023-05-15 16:20:19 +0200
commit3a6bc7aba2625dd4144e25033fabe8b8f42afb42 (patch)
tree65a23b8f04da38d0c1e83e9c238e951c2131261d /tests/lib/AppFramework/Middleware/Security
parentb9026acf3ffbf8f7ea060761b09bb8ec8b10e62f (diff)
downloadnextcloud-server-3a6bc7aba2625dd4144e25033fabe8b8f42afb42.tar.gz
nextcloud-server-3a6bc7aba2625dd4144e25033fabe8b8f42afb42.zip
fix(middleware): Also abort the request when reaching max delay in afterController
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/AppFramework/Middleware/Security')
-rw-r--r--tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php
index 388b2fbf534..faf2d24d172 100644
--- a/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php
@@ -157,7 +157,7 @@ class BruteForceMiddlewareTest extends TestCase {
->willReturn('127.0.0.1');
$this->throttler
->expects($this->once())
- ->method('sleepDelay')
+ ->method('sleepDelayOrThrowOnMax')
->with('127.0.0.1', 'login');
$this->throttler
->expects($this->once())
@@ -181,7 +181,7 @@ class BruteForceMiddlewareTest extends TestCase {
->method('getRemoteAddress');
$this->throttler
->expects($this->never())
- ->method('sleepDelay');
+ ->method('sleepDelayOrThrowOnMax');
$this->throttler
->expects($this->never())
->method('registerAttempt');
@@ -209,7 +209,7 @@ class BruteForceMiddlewareTest extends TestCase {
->willReturn('::1');
$this->throttler
->expects($this->once())
- ->method('sleepDelay')
+ ->method('sleepDelayOrThrowOnMax')
->with('::1', 'single');
$this->throttler
->expects($this->once())
@@ -239,7 +239,7 @@ class BruteForceMiddlewareTest extends TestCase {
->willReturn('::1');
$this->throttler
->expects($this->exactly(2))
- ->method('sleepDelay')
+ ->method('sleepDelayOrThrowOnMax')
->withConsecutive(
['::1', 'first'],
['::1', 'second'],
@@ -275,7 +275,7 @@ class BruteForceMiddlewareTest extends TestCase {
->willReturn('::1');
$this->throttler
->expects($this->once())
- ->method('sleepDelay')
+ ->method('sleepDelayOrThrowOnMax')
->with('::1', 'second');
$this->throttler
->expects($this->once())
@@ -293,7 +293,7 @@ class BruteForceMiddlewareTest extends TestCase {
->method('getRemoteAddress');
$this->throttler
->expects($this->never())
- ->method('sleepDelay');
+ ->method('sleepDelayOrThrowOnMax');
$controller = new TestController('test', $this->request);
$this->reflector->reflect($controller, 'testMethodWithoutAnnotation');
@@ -308,7 +308,7 @@ class BruteForceMiddlewareTest extends TestCase {
->method('getRemoteAddress');
$this->throttler
->expects($this->never())
- ->method('sleepDelay');
+ ->method('sleepDelayOrThrowOnMax');
$controller = new TestController('test', $this->request);
$this->reflector->reflect($controller, 'testMethodWithoutAnnotation');