aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-07-27 22:34:29 +0200
committerprovokateurin <kate@provokateurin.de>2024-07-27 22:36:18 +0200
commitbc5c0262af3cd375620d6534353a3842149ad6ab (patch)
treecd0cc061a4ec60d8b13b55e07e7fe674de6889d3 /core/Controller
parenta94249d1d52472630c5a5884350fdfc5dcfbe0e6 (diff)
downloadnextcloud-server-bc5c0262af3cd375620d6534353a3842149ad6ab.tar.gz
nextcloud-server-bc5c0262af3cd375620d6534353a3842149ad6ab.zip
refactor(core): Make all attribute arguments named
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/AppPasswordController.php2
-rw-r--r--core/Controller/LoginController.php4
-rw-r--r--core/Controller/LostController.php12
-rw-r--r--core/Controller/OCSController.php2
-rw-r--r--core/Controller/ProfileApiController.php2
-rw-r--r--core/Controller/TranslationApiController.php4
-rw-r--r--core/Controller/WipeController.php4
7 files changed, 15 insertions, 15 deletions
diff --git a/core/Controller/AppPasswordController.php b/core/Controller/AppPasswordController.php
index c72d3524419..7cab4c5380b 100644
--- a/core/Controller/AppPasswordController.php
+++ b/core/Controller/AppPasswordController.php
@@ -168,7 +168,7 @@ class AppPasswordController extends \OCP\AppFramework\OCSController {
* 403: Password confirmation failed
*/
#[NoAdminRequired]
- #[BruteForceProtection('sudo')]
+ #[BruteForceProtection(action: 'sudo')]
#[UseSession]
#[ApiRoute(verb: 'PUT', url: '/apppassword/confirm', root: '/core')]
public function confirmUserPassword(string $password): DataResponse {
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index a84f28a52d5..a433c3073b4 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -274,7 +274,7 @@ class LoginController extends Controller {
*/
#[NoCSRFRequired]
#[PublicPage]
- #[BruteForceProtection('login')]
+ #[BruteForceProtection(action: 'login')]
#[UseSession]
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
#[FrontpageRoute(verb: 'POST', url: '/login')]
@@ -387,7 +387,7 @@ class LoginController extends Controller {
* 403: Password confirmation failed
*/
#[NoAdminRequired]
- #[BruteForceProtection('sudo')]
+ #[BruteForceProtection(action: 'sudo')]
#[UseSession]
#[NoCSRFRequired]
#[FrontpageRoute(verb: 'POST', url: '/login/confirm')]
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index a40624e814a..2a5e5503952 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -81,8 +81,8 @@ class LostController extends Controller {
*/
#[PublicPage]
#[NoCSRFRequired]
- #[BruteForceProtection('passwordResetEmail')]
- #[AnonRateLimit(10, 300)]
+ #[BruteForceProtection(action: 'passwordResetEmail')]
+ #[AnonRateLimit(limit: 10, period: 300)]
#[FrontpageRoute(verb: 'GET', url: '/lostpassword/reset/form/{token}/{userId}')]
public function resetform(string $token, string $userId): TemplateResponse {
try {
@@ -144,8 +144,8 @@ class LostController extends Controller {
}
#[PublicPage]
- #[BruteForceProtection('passwordResetEmail')]
- #[AnonRateLimit(10, 300)]
+ #[BruteForceProtection(action: 'passwordResetEmail')]
+ #[AnonRateLimit(limit: 10, period: 300)]
#[FrontpageRoute(verb: 'POST', url: '/lostpassword/email')]
public function email(string $user): JSONResponse {
if ($this->config->getSystemValue('lost_password_link', '') !== '') {
@@ -180,8 +180,8 @@ class LostController extends Controller {
}
#[PublicPage]
- #[BruteForceProtection('passwordResetEmail')]
- #[AnonRateLimit(10, 300)]
+ #[BruteForceProtection(action: 'passwordResetEmail')]
+ #[AnonRateLimit(limit: 10, period: 300)]
#[FrontpageRoute(verb: 'POST', url: '/lostpassword/set/{token}/{userId}')]
public function setPassword(string $token, string $userId, string $password, bool $proceed): JSONResponse {
if ($this->encryptionManager->isEnabled() && !$proceed) {
diff --git a/core/Controller/OCSController.php b/core/Controller/OCSController.php
index 450b8205fd3..743a71622da 100644
--- a/core/Controller/OCSController.php
+++ b/core/Controller/OCSController.php
@@ -77,7 +77,7 @@ class OCSController extends \OCP\AppFramework\OCSController {
}
#[PublicPage]
- #[BruteForceProtection('login')]
+ #[BruteForceProtection(action: 'login')]
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
#[ApiRoute(verb: 'POST', url: '/check', root: '/person')]
public function personCheck(string $login = '', string $password = ''): DataResponse {
diff --git a/core/Controller/ProfileApiController.php b/core/Controller/ProfileApiController.php
index cc36a486afc..bbfb9cc4153 100644
--- a/core/Controller/ProfileApiController.php
+++ b/core/Controller/ProfileApiController.php
@@ -53,7 +53,7 @@ class ProfileApiController extends OCSController {
*/
#[NoAdminRequired]
#[PasswordConfirmationRequired]
- #[UserRateLimit(40, 600)]
+ #[UserRateLimit(limit: 40, period: 600)]
#[ApiRoute(verb: 'PUT', url: '/{targetUserId}', root: '/profile')]
public function setVisibility(string $targetUserId, string $paramId, string $visibility): DataResponse {
$requestingUser = $this->userSession->getUser();
diff --git a/core/Controller/TranslationApiController.php b/core/Controller/TranslationApiController.php
index 3a919e1f79a..81ed190277b 100644
--- a/core/Controller/TranslationApiController.php
+++ b/core/Controller/TranslationApiController.php
@@ -62,8 +62,8 @@ class TranslationApiController extends \OCP\AppFramework\OCSController {
* 412: Translating is not possible
*/
#[PublicPage]
- #[UserRateLimit(25, 120)]
- #[AnonRateLimit(10, 120)]
+ #[UserRateLimit(limit: 25, period: 120)]
+ #[AnonRateLimit(limit: 10, period: 120)]
#[ApiRoute(verb: 'POST', url: '/translate', root: '/translation')]
public function translate(string $text, ?string $fromLanguage, string $toLanguage): DataResponse {
try {
diff --git a/core/Controller/WipeController.php b/core/Controller/WipeController.php
index 089e9792a7e..fe9ee79f3b4 100644
--- a/core/Controller/WipeController.php
+++ b/core/Controller/WipeController.php
@@ -40,7 +40,7 @@ class WipeController extends Controller {
*/
#[PublicPage]
#[NoCSRFRequired]
- #[AnonRateLimit(10, 300)]
+ #[AnonRateLimit(limit: 10, period: 300)]
#[FrontpageRoute(verb: 'POST', url: '/core/wipe/check')]
public function checkWipe(string $token): JSONResponse {
try {
@@ -69,7 +69,7 @@ class WipeController extends Controller {
*/
#[PublicPage]
#[NoCSRFRequired]
- #[AnonRateLimit(10, 300)]
+ #[AnonRateLimit(limit: 10, period: 300)]
#[FrontpageRoute(verb: 'POST', url: '/core/wipe/success')]
public function wipeDone(string $token): JSONResponse {
try {