diff options
author | provokateurin <kate@provokateurin.de> | 2024-07-25 13:14:46 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-07-27 22:44:01 +0200 |
commit | 3fde60db853454fda3b2c82258ae87b6f29f4726 (patch) | |
tree | 9e0be1b7e1c0e37e0599b8df8efc3b3a72487f16 /apps/files/lib/Controller/OpenLocalEditorController.php | |
parent | 212a621697cd32b65ea78fa90015cec9d9d1dfe3 (diff) | |
download | nextcloud-server-3fde60db853454fda3b2c82258ae87b6f29f4726.tar.gz nextcloud-server-3fde60db853454fda3b2c82258ae87b6f29f4726.zip |
refactor(files): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/files/lib/Controller/OpenLocalEditorController.php')
-rw-r--r-- | apps/files/lib/Controller/OpenLocalEditorController.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/files/lib/Controller/OpenLocalEditorController.php b/apps/files/lib/Controller/OpenLocalEditorController.php index 00085a4984b..0c13af2a6d2 100644 --- a/apps/files/lib/Controller/OpenLocalEditorController.php +++ b/apps/files/lib/Controller/OpenLocalEditorController.php @@ -13,6 +13,9 @@ use OCA\Files\Db\OpenLocalEditor; use OCA\Files\Db\OpenLocalEditorMapper; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\BruteForceProtection; +use OCP\AppFramework\Http\Attribute\NoAdminRequired; +use OCP\AppFramework\Http\Attribute\UserRateLimit; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCSController; use OCP\AppFramework\Utility\ITimeFactory; @@ -51,9 +54,6 @@ class OpenLocalEditorController extends OCSController { } /** - * @NoAdminRequired - * @UserRateThrottle(limit=10, period=120) - * * Create a local editor * * @param string $path Path of the file @@ -62,6 +62,8 @@ class OpenLocalEditorController extends OCSController { * * 200: Local editor returned */ + #[NoAdminRequired] + #[UserRateLimit(limit: 10, period: 120)] public function create(string $path): DataResponse { $pathHash = sha1($path); @@ -96,9 +98,6 @@ class OpenLocalEditorController extends OCSController { } /** - * @NoAdminRequired - * @BruteForceProtection(action=openLocalEditor) - * * Validate a local editor * * @param string $path Path of the file @@ -109,6 +108,8 @@ class OpenLocalEditorController extends OCSController { * 200: Local editor validated successfully * 404: Local editor not found */ + #[NoAdminRequired] + #[BruteForceProtection(action: 'openLocalEditor')] public function validate(string $path, string $token): DataResponse { $pathHash = sha1($path); |