summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-05-11 15:25:31 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-05-12 08:09:14 +0000
commit6bc2d6d68e19212ed83a2f3ce51ddbfcefa248ae (patch)
treee525c172a6a519a69d3c7bb2ac698269927dc4ac /apps/files_sharing/tests
parentdd014059d7d1ddd769c80ed1d290e36b1d8c02b2 (diff)
downloadnextcloud-server-6bc2d6d68e19212ed83a2f3ce51ddbfcefa248ae.tar.gz
nextcloud-server-6bc2d6d68e19212ed83a2f3ce51ddbfcefa248ae.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'));
}