blob: 06e48cfd73d64d528b122ce3a2709cd827464959 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Testing\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
class RateLimitTestController extends Controller {
/**
* @PublicPage
* @NoCSRFRequired
*
* @UserRateThrottle(limit=5, period=100)
* @AnonRateThrottle(limit=1, period=100)
*
* @return JSONResponse
*/
public function userAndAnonProtected() {
return new JSONResponse();
}
/**
* @PublicPage
* @NoCSRFRequired
*
* @AnonRateThrottle(limit=1, period=10)
*
* @return JSONResponse
*/
public function onlyAnonProtected() {
return new JSONResponse();
}
}
|