Skip to content

Commit

Permalink
refactor(testing): Replace security annotations with respective attri…
Browse files Browse the repository at this point in the history
…butes

Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Jul 27, 2024
1 parent 212a621 commit 1cc7a62
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions apps/testing/lib/Controller/RateLimitTestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 1cc7a62

Please sign in to comment.