aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-07-25 13:14:50 +0200
committerprovokateurin <kate@provokateurin.de>2024-07-27 22:40:56 +0200
commit1cc7a620b54c32616dcfb06ece9e85f673145258 (patch)
treed9f93ecf71947ca2a0f8b2c88f6ce906cc37540b /apps
parent212a621697cd32b65ea78fa90015cec9d9d1dfe3 (diff)
downloadnextcloud-server-1cc7a620b54c32616dcfb06ece9e85f673145258.tar.gz
nextcloud-server-1cc7a620b54c32616dcfb06ece9e85f673145258.zip
refactor(testing): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/testing/lib/Controller/RateLimitTestController.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/testing/lib/Controller/RateLimitTestController.php b/apps/testing/lib/Controller/RateLimitTestController.php
index 06e48cfd73d..b1df0d1d7b5 100644
--- a/apps/testing/lib/Controller/RateLimitTestController.php
+++ b/apps/testing/lib/Controller/RateLimitTestController.php
@@ -6,30 +6,30 @@
namespace OCA\Testing\Controller;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\AnonRateLimit;
+use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
+use OCP\AppFramework\Http\Attribute\PublicPage;
+use OCP\AppFramework\Http\Attribute\UserRateLimit;
use OCP\AppFramework\Http\JSONResponse;
class RateLimitTestController extends Controller {
/**
- * @PublicPage
- * @NoCSRFRequired
- *
- * @UserRateThrottle(limit=5, period=100)
- * @AnonRateThrottle(limit=1, period=100)
- *
* @return JSONResponse
*/
+ #[PublicPage]
+ #[NoCSRFRequired]
+ #[UserRateLimit(limit: 5, period: 100)]
+ #[AnonRateLimit(limit: 1, period: 100)]
public function userAndAnonProtected() {
return new JSONResponse();
}
/**
- * @PublicPage
- * @NoCSRFRequired
- *
- * @AnonRateThrottle(limit=1, period=10)
- *
* @return JSONResponse
*/
+ #[PublicPage]
+ #[NoCSRFRequired]
+ #[AnonRateLimit(limit: 1, period: 10)]
public function onlyAnonProtected() {
return new JSONResponse();
}