Skip to content

Commit 1cc7a62

Browse files
committed
refactor(testing): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent 212a621 commit 1cc7a62

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

apps/testing/lib/Controller/RateLimitTestController.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66
namespace OCA\Testing\Controller;
77

88
use OCP\AppFramework\Controller;
9+
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
10+
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
11+
use OCP\AppFramework\Http\Attribute\PublicPage;
12+
use OCP\AppFramework\Http\Attribute\UserRateLimit;
913
use OCP\AppFramework\Http\JSONResponse;
1014

1115
class RateLimitTestController extends Controller {
1216
/**
13-
* @PublicPage
14-
* @NoCSRFRequired
15-
*
16-
* @UserRateThrottle(limit=5, period=100)
17-
* @AnonRateThrottle(limit=1, period=100)
18-
*
1917
* @return JSONResponse
2018
*/
19+
#[PublicPage]
20+
#[NoCSRFRequired]
21+
#[UserRateLimit(limit: 5, period: 100)]
22+
#[AnonRateLimit(limit: 1, period: 100)]
2123
public function userAndAnonProtected() {
2224
return new JSONResponse();
2325
}
2426

2527
/**
26-
* @PublicPage
27-
* @NoCSRFRequired
28-
*
29-
* @AnonRateThrottle(limit=1, period=10)
30-
*
3128
* @return JSONResponse
3229
*/
30+
#[PublicPage]
31+
#[NoCSRFRequired]
32+
#[AnonRateLimit(limit: 1, period: 10)]
3333
public function onlyAnonProtected() {
3434
return new JSONResponse();
3535
}

0 commit comments

Comments
 (0)