diff options
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r-- | lib/private/Server.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index 00698a04f89..2aa7c15af00 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -516,6 +516,21 @@ class Server extends ServerContainer implements IServerContainer { }); $this->registerAlias('Search', \OCP\ISearch::class); + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function($c) { + return new \OC\Security\RateLimiting\Limiter( + $this->getUserSession(), + $this->getRequest(), + new \OC\AppFramework\Utility\TimeFactory(), + $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) + ); + }); + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { + return new \OC\Security\RateLimiting\Backend\MemoryCache( + $this->getMemCacheFactory(), + new \OC\AppFramework\Utility\TimeFactory() + ); + }); + $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { return new SecureRandom(); }); |