jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/338298 )
Change subject: Demote "throttler data not found" logs to info level
......................................................................
Demote "throttler data not found" logs to info level
Bug: T158364
Change-Id: I049c2d6da4720341ef2a380879ac19aff444b1d0
---
M includes/auth/ThrottlePreAuthenticationProvider.php
M tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php
2 files changed, 4 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Anomie: Looks good to me, approved
diff --git a/includes/auth/ThrottlePreAuthenticationProvider.php
b/includes/auth/ThrottlePreAuthenticationProvider.php
index 3f6a47d..ae0bc6b 100644
--- a/includes/auth/ThrottlePreAuthenticationProvider.php
+++ b/includes/auth/ThrottlePreAuthenticationProvider.php
@@ -167,7 +167,9 @@
$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 20f4cbc..2f3e27c 100644
--- a/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php
+++ b/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php
@@ -226,7 +226,7 @@
$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() );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/338298
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I049c2d6da4720341ef2a380879ac19aff444b1d0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits