Merge pull request #7656 from nextcloud/bugfix/noid/use-public-throttler

Use public throttler
This commit is contained in:
Joas Schilling 2022-08-03 16:30:58 +02:00 коммит произвёл GitHub
Родитель f42a4899cf b1b01f849a
Коммит afd3bb9288
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace OCA\Talk\Controller;
use OC\Security\Bruteforce\Throttler;
use OCA\Talk\AppInfo\Application;
use OCA\Talk\Exceptions\ParticipantNotFoundException;
use OCA\Talk\Exceptions\RoomNotFoundException;
@ -57,6 +56,7 @@ use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserSession;
use OCP\Notification\IManager as INotificationManager;
use OCP\Security\Bruteforce\IThrottler;
use Psr\Log\LoggerInterface;
class PageController extends Controller {
@ -74,7 +74,7 @@ class PageController extends Controller {
private INotificationManager $notificationManager;
private IAppManager $appManager;
private IRootFolder $rootFolder;
private Throttler $throttler;
private IThrottler $throttler;
public function __construct(string $appName,
IRequest $request,
@ -92,7 +92,7 @@ class PageController extends Controller {
IInitialState $initialState,
ICacheFactory $memcacheFactory,
IRootFolder $rootFolder,
Throttler $throttler,
IThrottler $throttler,
Config $talkConfig,
IConfig $serverConfig) {
parent::__construct($appName, $request);

Просмотреть файл

@ -28,7 +28,6 @@ declare(strict_types=1);
namespace OCA\Talk\Controller;
use InvalidArgumentException;
use OC\Security\Bruteforce\Throttler;
use OCA\Talk\Chat\ChatManager;
use OCA\Talk\Chat\MessageParser;
use OCA\Talk\Config;
@ -65,6 +64,7 @@ use OCP\IL10N;
use OCP\IRequest;
use OCP\IUser;
use OCP\IUserManager;
use OCP\Security\Bruteforce\IThrottler;
use OCP\User\Events\UserLiveStatusEvent;
use OCP\UserStatus\IManager as IUserStatusManager;
use OCP\UserStatus\IUserStatus;
@ -92,7 +92,7 @@ class RoomController extends AEnvironmentAwareController {
protected IL10N $l10n;
protected IConfig $config;
protected Config $talkConfig;
protected Throttler $throttler;
protected IThrottler $throttler;
protected LoggerInterface $logger;
protected array $commonReadMessages = [];
@ -118,7 +118,7 @@ class RoomController extends AEnvironmentAwareController {
IConfig $config,
Config $talkConfig,
ICloudIdManager $cloudIdManager,
Throttler $throttler,
IThrottler $throttler,
LoggerInterface $logger) {
parent::__construct($appName, $request);
$this->session = $session;

Просмотреть файл

@ -23,7 +23,6 @@ declare(strict_types=1);
namespace OCA\Talk\Middleware;
use OC\Security\Bruteforce\Throttler;
use OCA\Talk\Controller\AEnvironmentAwareController;
use OCA\Talk\Exceptions\ParticipantNotFoundException;
use OCA\Talk\Exceptions\PermissionsException;
@ -46,20 +45,21 @@ use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCSController;
use OCP\AppFramework\Utility\IControllerMethodReflector;
use OCP\IRequest;
use OCP\Security\Bruteforce\IThrottler;
class InjectionMiddleware extends Middleware {
private IRequest $request;
private IControllerMethodReflector $reflector;
private TalkSession $talkSession;
private Manager $manager;
private Throttler $throttler;
private IThrottler $throttler;
private ?string $userId;
public function __construct(IRequest $request,
IControllerMethodReflector $reflector,
TalkSession $talkSession,
Manager $manager,
Throttler $throttler,
IThrottler $throttler,
?string $userId) {
$this->request = $request;
$this->reflector = $reflector;

Просмотреть файл

@ -26,7 +26,6 @@
<referencedClass name="GuzzleHttp\Exception\ServerException" />
<referencedClass name="GuzzleHttp\Exception\ConnectException" />
<referencedClass name="OC" />
<referencedClass name="OC\Security\Bruteforce\Throttler" />
<referencedClass name="OCA\Circles\Api\v1\Circles" />
<referencedClass name="OCA\Circles\CirclesManager" />
<referencedClass name="OCA\Circles\Events\AddingCircleMemberEvent" />