diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6fb8a8ba..a051c6a8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -68,4 +68,4 @@ jobs: run: composer test integration-tests: name: "REST integration tests" - uses: ./.github/workflows/integration-tests-callable.yaml@4.1 + uses: ./.github/workflows/integration-tests-callable.yaml diff --git a/composer.json b/composer.json index 3112f43a..4cf4e14c 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,8 @@ "config": { "allow-plugins": { "composer/package-versions-deprecated": true - } + }, + "process-timeout": 600 }, "scripts": { "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots", diff --git a/src/bundle/Resources/config/default_settings.yml b/src/bundle/Resources/config/default_settings.yml index e0a8888c..a5a33dbc 100644 --- a/src/bundle/Resources/config/default_settings.yml +++ b/src/bundle/Resources/config/default_settings.yml @@ -87,7 +87,3 @@ parameters: createToken: mediaType: 'JWT' href: 'router.generate("ibexa.rest.create_token")' - - # Boundary times in microseconds which the authentication check will be delayed by. - ibexa.rest.authentication_min_delay_time: 30000 - ibexa.rest.authentication_max_delay_time: 500000 diff --git a/src/bundle/Resources/config/security.yml b/src/bundle/Resources/config/security.yml index a3f04ed4..f2557ab7 100644 --- a/src/bundle/Resources/config/security.yml +++ b/src/bundle/Resources/config/security.yml @@ -10,8 +10,6 @@ services: - "@event_dispatcher" - '@ibexa.config.resolver' - "@?logger" - - "%ibexa.rest.authentication_min_delay_time%" - - "%ibexa.rest.authentication_max_delay_time%" abstract: true Ibexa\Rest\Server\Security\RestLogoutHandler: diff --git a/src/lib/Server/Security/RestAuthenticator.php b/src/lib/Server/Security/RestAuthenticator.php index 59f70811..83baed21 100644 --- a/src/lib/Server/Security/RestAuthenticator.php +++ b/src/lib/Server/Security/RestAuthenticator.php @@ -34,10 +34,6 @@ */ class RestAuthenticator implements AuthenticatorInterface { - private const DEFAULT_MIN_SLEEP_VALUE = 30000; - - private const DEFAULT_MAX_SLEEP_VALUE = 500000; - /** * @var \Psr\Log\LoggerInterface */ @@ -73,25 +69,13 @@ class RestAuthenticator implements AuthenticatorInterface */ private $logoutHandlers = []; - /** - * @var int|null - */ - private $minSleepTime; - - /** - * @var int|null - */ - private $maxSleepTime; - public function __construct( TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, $providerKey, EventDispatcherInterface $dispatcher, ConfigResolverInterface $configResolver, - LoggerInterface $logger = null, - $minSleepTime = self::DEFAULT_MIN_SLEEP_VALUE, - $maxSleepTime = self::DEFAULT_MAX_SLEEP_VALUE + LoggerInterface $logger = null ) { $this->tokenStorage = $tokenStorage; $this->authenticationManager = $authenticationManager; @@ -99,8 +83,6 @@ public function __construct( $this->dispatcher = $dispatcher; $this->configResolver = $configResolver; $this->logger = $logger; - $this->minSleepTime = !is_int($minSleepTime) ? self::DEFAULT_MIN_SLEEP_VALUE : $minSleepTime; - $this->maxSleepTime = !is_int($maxSleepTime) ? self::DEFAULT_MAX_SLEEP_VALUE : $maxSleepTime; } /** @@ -115,8 +97,6 @@ public function __invoke(RequestEvent $event) public function authenticate(Request $request) { - usleep(random_int($this->minSleepTime, $this->maxSleepTime)); - // If a token already exists and username is the same as the one we request authentication for, // then return it and mark it as coming from session. $previousToken = $this->tokenStorage->getToken();