chore: use "app_api" session key, "app_api_system" is deprecated

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
pull/46446/head
Andrey Borysenko 5 months ago
parent 9cd2e5bed9
commit 40f820470a
No known key found for this signature in database
GPG Key ID: 934CB29F9F59B0D1
  1. 5
      lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php

@ -11,6 +11,7 @@ namespace OC\AppFramework\Middleware\Security;
use OC\AppFramework\Utility\ControllerMethodReflector;
use OC\Security\RateLimiting\Exception\RateLimitExceededException;
use OC\Security\RateLimiting\Limiter;
use OC\User\Session;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\Attribute\ARateLimit;
@ -63,8 +64,8 @@ class RateLimitingMiddleware extends Middleware {
parent::beforeController($controller, $methodName);
$rateLimitIdentifier = get_class($controller) . '::' . $methodName;
if ($this->session->exists('app_api_system')) {
// Bypass rate limiting for app_api
if ($this->userSession instanceof Session && $this->userSession->getSession()->get('app_api') === true && $this->userSession->getUser() === null) {
// if userId is not specified and the request is authenticated by AppAPI, we skip the rate limit
return;
}

Loading…
Cancel
Save