From 047479ccf9ff332cc249cd08d5c315394f3e48da Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 17 Jul 2024 15:25:51 +0200 Subject: feat(security): Add public API to allow validating IP Ranges and checking for "in range" Signed-off-by: Joas Schilling Signed-off-by: Benjamin Gaussorgues --- tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/lib/AppFramework/Middleware') diff --git a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php index 1aa7ad456a8..fb457579fac 100644 --- a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php @@ -18,7 +18,6 @@ use OC\AppFramework\Middleware\Security\Exceptions\SecurityException; use OC\Appframework\Middleware\Security\Exceptions\StrictCookieMissingException; use OC\AppFramework\Middleware\Security\SecurityMiddleware; use OC\AppFramework\Utility\ControllerMethodReflector; -use OC\Security\RemoteIpAddress; use OC\Settings\AuthorizedGroupMapper; use OC\User\Session; use OCP\App\IAppManager; @@ -33,6 +32,7 @@ use OCP\IRequestId; use OCP\ISession; use OCP\IURLGenerator; use OCP\IUserSession; +use OCP\Security\Ip\IRemoteAddress; use Psr\Log\LoggerInterface; use Test\AppFramework\Middleware\Security\Mock\NormalController; use Test\AppFramework\Middleware\Security\Mock\OCSController; @@ -91,7 +91,7 @@ class SecurityMiddlewareTest extends \Test\TestCase { $this->appManager->expects($this->any()) ->method('isEnabledForUser') ->willReturn($isAppEnabledForUser); - $remoteIpAddress = $this->createMock(RemoteIpAddress::class); + $remoteIpAddress = $this->createMock(IRemoteAddress::class); $remoteIpAddress->method('allowsAdminActions')->willReturn(true); return new SecurityMiddleware( -- cgit v1.2.3