aboutsummaryrefslogtreecommitdiffstats
path: root/apps/oauth2
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-08-28 15:50:45 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-28 15:50:45 +0200
commit25309bcb45232bf30fe719bac1776f0136f7cd7a (patch)
tree7cfa6dacd42f22a854b895c2ae5853ff1725d96b /apps/oauth2
parentac3d7e3a7e9848c5e134b79f481d73416cc810f4 (diff)
downloadnextcloud-server-25309bcb45232bf30fe719bac1776f0136f7cd7a.tar.gz
nextcloud-server-25309bcb45232bf30fe719bac1776f0136f7cd7a.zip
techdebt(DI): Use public IThrottler interface which exists since Nextcloud 25
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/oauth2')
-rw-r--r--apps/oauth2/lib/Controller/OauthApiController.php4
-rw-r--r--apps/oauth2/tests/Controller/OauthApiControllerTest.php6
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php
index 8cdd8132441..af1205be0d7 100644
--- a/apps/oauth2/lib/Controller/OauthApiController.php
+++ b/apps/oauth2/lib/Controller/OauthApiController.php
@@ -31,7 +31,6 @@ namespace OCA\OAuth2\Controller;
use OC\Authentication\Exceptions\ExpiredTokenException;
use OC\Authentication\Exceptions\InvalidTokenException;
use OC\Authentication\Token\IProvider as TokenProvider;
-use OC\Security\Bruteforce\Throttler;
use OCA\OAuth2\Db\AccessTokenMapper;
use OCA\OAuth2\Db\ClientMapper;
use OCA\OAuth2\Exceptions\AccessTokenNotFoundException;
@@ -41,6 +40,7 @@ use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IRequest;
+use OCP\Security\Bruteforce\IThrottler;
use OCP\Security\ICrypto;
use OCP\Security\ISecureRandom;
use Psr\Log\LoggerInterface;
@@ -57,7 +57,7 @@ class OauthApiController extends Controller {
private ISecureRandom $secureRandom,
private ITimeFactory $time,
private LoggerInterface $logger,
- private Throttler $throttler
+ private IThrottler $throttler
) {
parent::__construct($appName, $request);
}
diff --git a/apps/oauth2/tests/Controller/OauthApiControllerTest.php b/apps/oauth2/tests/Controller/OauthApiControllerTest.php
index c65302532a9..a7dc35943f0 100644
--- a/apps/oauth2/tests/Controller/OauthApiControllerTest.php
+++ b/apps/oauth2/tests/Controller/OauthApiControllerTest.php
@@ -29,7 +29,6 @@ use OC\Authentication\Exceptions\ExpiredTokenException;
use OC\Authentication\Exceptions\InvalidTokenException;
use OC\Authentication\Token\IProvider as TokenProvider;
use OC\Authentication\Token\PublicKeyToken;
-use OC\Security\Bruteforce\Throttler;
use OCA\OAuth2\Controller\OauthApiController;
use OCA\OAuth2\Db\AccessToken;
use OCA\OAuth2\Db\AccessTokenMapper;
@@ -41,6 +40,7 @@ use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IRequest;
+use OCP\Security\Bruteforce\IThrottler;
use OCP\Security\ICrypto;
use OCP\Security\ISecureRandom;
use Psr\Log\LoggerInterface;
@@ -66,7 +66,7 @@ class OauthApiControllerTest extends TestCase {
private $secureRandom;
/** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
private $time;
- /** @var Throttler|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IThrottler|\PHPUnit\Framework\MockObject\MockObject */
private $throttler;
/** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
private $logger;
@@ -83,7 +83,7 @@ class OauthApiControllerTest extends TestCase {
$this->tokenProvider = $this->createMock(TokenProvider::class);
$this->secureRandom = $this->createMock(ISecureRandom::class);
$this->time = $this->createMock(ITimeFactory::class);
- $this->throttler = $this->createMock(Throttler::class);
+ $this->throttler = $this->createMock(IThrottler::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->oauthApiController = new OauthApiController(