aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-05-11 15:25:31 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2021-05-12 09:34:45 +0200
commit701294520aad315aeae06b03160830a375e98599 (patch)
tree7db676f6d6f0ebe0a229e815de42bc3b1d09ff7b /apps/files_sharing/tests
parentbf86050c77c9a77ab9471750281002e7cade2379 (diff)
downloadnextcloud-server-701294520aad315aeae06b03160830a375e98599.tar.gz
nextcloud-server-701294520aad315aeae06b03160830a375e98599.zip
Add bruteforce protection to the shareinfo endpoint
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/Controller/ShareInfoControllerTest.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_sharing/tests/Controller/ShareInfoControllerTest.php b/apps/files_sharing/tests/Controller/ShareInfoControllerTest.php
index 9ea93b9900a..5de04d8444b 100644
--- a/apps/files_sharing/tests/Controller/ShareInfoControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareInfoControllerTest.php
@@ -66,6 +66,7 @@ class ShareInfoControllerTest extends TestCase {
->willThrowException(new ShareNotFound());
$expected = new JSONResponse([], Http::STATUS_NOT_FOUND);
+ $expected->throttle(['token' => 'token']);
$this->assertEquals($expected, $this->controller->info('token'));
}
@@ -82,6 +83,7 @@ class ShareInfoControllerTest extends TestCase {
->willReturn(false);
$expected = new JSONResponse([], Http::STATUS_FORBIDDEN);
+ $expected->throttle(['token' => 'token']);
$this->assertEquals($expected, $this->controller->info('token', 'pass'));
}
@@ -100,6 +102,7 @@ class ShareInfoControllerTest extends TestCase {
->willReturn(true);
$expected = new JSONResponse([], Http::STATUS_FORBIDDEN);
+ $expected->throttle(['token' => 'token']);
$this->assertEquals($expected, $this->controller->info('token', 'pass'));
}