mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 23:03:00 -04:00
refactor(testing): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
212a621697
commit
1cc7a620b5
1 changed files with 11 additions and 11 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue