aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-05-16 06:35:15 +0200
committerGitHub <noreply@github.com>2023-05-16 06:35:15 +0200
commitb56445b9ad8f391a69553c6b450e78978b9a0cbb (patch)
tree6f90bee6a43063150a7c10b51fb83f01e72e6cf4 /tests/Core
parent816c33c3917167d503e99994472f5ad7c8a380c2 (diff)
parent33385d7ecb892a6674caf18647e5f2a6394d70b9 (diff)
downloadnextcloud-server-b56445b9ad8f391a69553c6b450e78978b9a0cbb.tar.gz
nextcloud-server-b56445b9ad8f391a69553c6b450e78978b9a0cbb.zip
Merge pull request #38267 from nextcloud/bugfix/noid/fix-missing-bruteforce-protection
fix(lostpassword): Also rate limit the setPassword endpoint
Diffstat (limited to 'tests/Core')
-rw-r--r--tests/Core/Controller/LostControllerTest.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php
index 1481a1e46d4..84ec450943e 100644
--- a/tests/Core/Controller/LostControllerTest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -449,7 +449,7 @@ class LostControllerTest extends TestCase {
$response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
$expectedResponse = ['status' => 'error', 'msg' => ''];
- $this->assertSame($expectedResponse, $response);
+ $this->assertSame($expectedResponse, $response->getData());
}
public function testSetPasswordSuccessful() {
@@ -477,7 +477,7 @@ class LostControllerTest extends TestCase {
$response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
$expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
- $this->assertSame($expectedResponse, $response);
+ $this->assertSame($expectedResponse, $response->getData());
}
public function testSetPasswordExpiredToken() {
@@ -496,7 +496,7 @@ class LostControllerTest extends TestCase {
'status' => 'error',
'msg' => 'Could not reset password because the token is expired',
];
- $this->assertSame($expectedResponse, $response);
+ $this->assertSame($expectedResponse, $response->getData());
}
public function testSetPasswordInvalidDataInDb() {
@@ -516,7 +516,7 @@ class LostControllerTest extends TestCase {
'status' => 'error',
'msg' => 'Could not reset password because the token is invalid',
];
- $this->assertSame($expectedResponse, $response);
+ $this->assertSame($expectedResponse, $response->getData());
}
public function testIsSetPasswordWithoutTokenFailing() {
@@ -535,7 +535,7 @@ class LostControllerTest extends TestCase {
'status' => 'error',
'msg' => 'Could not reset password because the token is invalid'
];
- $this->assertSame($expectedResponse, $response);
+ $this->assertSame($expectedResponse, $response->getData());
}
public function testSetPasswordForDisabledUser() {
@@ -565,7 +565,7 @@ class LostControllerTest extends TestCase {
'status' => 'error',
'msg' => 'Could not reset password because the token is invalid'
];
- $this->assertSame($expectedResponse, $response);
+ $this->assertSame($expectedResponse, $response->getData());
}
public function testSendEmailNoEmail() {
@@ -601,7 +601,7 @@ class LostControllerTest extends TestCase {
}]]);
$response = $this->lostController->setPassword('myToken', 'user', 'newpass', false);
$expectedResponse = ['status' => 'error', 'msg' => '', 'encryption' => true];
- $this->assertSame($expectedResponse, $response);
+ $this->assertSame($expectedResponse, $response->getData());
}
public function testSetPasswordDontProceedMasterKey() {
@@ -629,7 +629,7 @@ class LostControllerTest extends TestCase {
$response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', false);
$expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
- $this->assertSame($expectedResponse, $response);
+ $this->assertSame($expectedResponse, $response->getData());
}
public function testTwoUsersWithSameEmail() {