File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
apps/testing/lib/Controller Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change 66namespace OCA \Testing \Controller ;
77
88use 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 ;
913use OCP \AppFramework \Http \JSONResponse ;
1014
1115class 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 }
You can’t perform that action at this time.
0 commit comments