Skip to content

Commit 34bb825

Browse files
committed
fix(provisioning_api): Correct limit for editUser
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent c4cc3f2 commit 34bb825

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

apps/settings/lib/Controller/UsersController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ protected function canAdminChangeUserPasswords(): bool {
304304
* @NoAdminRequired
305305
* @NoSubAdminRequired
306306
* @PasswordConfirmationRequired
307+
* @UserRateThrottle(limit=50, period=600)
307308
*
308309
* @param string|null $avatarScope
309310
* @param string|null $displayname

build/integration/features/bootstrap/BasicStructure.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ public function sendingTo($verb, $url) {
147147
* @return string
148148
*/
149149
public function getOCSResponse($response) {
150-
return simplexml_load_string($response->getBody())->meta[0]->statuscode;
150+
$body = simplexml_load_string((string)$response->getBody());
151+
if ($body === false) {
152+
throw new \RuntimeException('Could not parse OCS response, body is not valid XML');
153+
}
154+
return $body->meta[0]->statuscode;
151155
}
152156

153157
/**

build/integration/features/bootstrap/FeatureContext.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,16 @@
3232
* Features context.
3333
*/
3434
class FeatureContext implements Context, SnippetAcceptingContext {
35+
use AppConfiguration;
3536
use ContactsMenu;
3637
use ExternalStorage;
3738
use Search;
3839
use WebDav;
3940
use Trashbin;
41+
42+
protected function resetAppConfigs(): void {
43+
$this->deleteServerConfig('bruteForce', 'whitelist_0');
44+
$this->deleteServerConfig('bruteForce', 'whitelist_1');
45+
$this->deleteServerConfig('bruteforcesettings', 'apply_allowlist_to_ratelimit');
46+
}
4047
}

build/integration/features/provisioning-v1.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Feature: provisioning
22
Background:
33
Given using api version "1"
4+
Given parameter "whitelist_0" of app "bruteForce" is set to "127.0.0.1"
5+
Given parameter "whitelist_1" of app "bruteForce" is set to "::1"
6+
Given parameter "apply_allowlist_to_ratelimit" of app "bruteforcesettings" is set to "true"
47

58
Scenario: Getting an not existing user
69
Given As an "admin"
@@ -597,13 +600,15 @@ Feature: provisioning
597600
| settings |
598601
| sharebymail |
599602
| systemtags |
603+
| testing |
600604
| theming |
601605
| twofactor_backupcodes |
602606
| updatenotification |
603607
| user_ldap |
604608
| user_status |
605609
| viewer |
606610
| workflowengine |
611+
| webhook_listeners |
607612
| weather_status |
608613
| files_external |
609614
| oauth2 |
@@ -621,6 +626,7 @@ Feature: provisioning
621626
And the HTTP status code should be "200"
622627

623628
Scenario: enable an app
629+
Given invoking occ with "app:disable testing"
624630
Given As an "admin"
625631
And app "testing" is disabled
626632
When sending "POST" to "/cloud/apps/testing"
@@ -635,12 +641,14 @@ Feature: provisioning
635641
And the HTTP status code should be "200"
636642

637643
Scenario: disable an app
644+
Given invoking occ with "app:enable testing"
638645
Given As an "admin"
639646
And app "testing" is enabled
640647
When sending "DELETE" to "/cloud/apps/testing"
641648
Then the OCS status code should be "100"
642649
And the HTTP status code should be "200"
643650
And app "testing" is disabled
651+
Given invoking occ with "app:enable testing"
644652

645653
Scenario: disable an user
646654
Given As an "admin"

0 commit comments

Comments
 (0)