From 7dcefe44682d513cf2700a3e5dba6b276f3f64c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerg=C5=91=20Tisza?= Date: Thu, 16 Feb 2017 16:47:49 -0800 Subject: [PATCH] Demote "throttler data not found" logs to info level Bug: T158364 Change-Id: I049c2d6da4720341ef2a380879ac19aff444b1d0 --- includes/auth/ThrottlePreAuthenticationProvider.php | 4 +++- .../includes/auth/ThrottlePreAuthenticationProviderTest.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/auth/ThrottlePreAuthenticationProvider.php b/includes/auth/ThrottlePreAuthenticationProvider.php index 3f6a47d2d3..ae0bc6bb77 100644 --- a/includes/auth/ThrottlePreAuthenticationProvider.php +++ b/includes/auth/ThrottlePreAuthenticationProvider.php @@ -167,7 +167,9 @@ class ThrottlePreAuthenticationProvider extends AbstractPreAuthenticationProvide $data = $this->manager->getAuthenticationSessionData( 'LoginThrottle' ); if ( !$data ) { - $this->logger->error( 'throttler data not found for {user}', [ 'user' => $user->getName() ] ); + // this can occur when login is happening via AuthenticationRequest::$loginRequest + // so testForAuthentication is skipped + $this->logger->info( 'throttler data not found for {user}', [ 'user' => $user->getName() ] ); return; } diff --git a/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php b/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php index 20f4cbc44d..2f3e27c6fe 100644 --- a/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php @@ -226,7 +226,7 @@ class ThrottlePreAuthenticationProviderTest extends \MediaWikiTestCase { $provider->postAuthentication( \User::newFromName( 'SomeUser' ), AuthenticationResponse::newPass() ); $this->assertSame( [ - [ \Psr\Log\LogLevel::ERROR, 'throttler data not found for {user}' ], + [ \Psr\Log\LogLevel::INFO, 'throttler data not found for {user}' ], ], $logger->getBuffer() ); } } -- 2.20.1