Merge pull request #1015 from nextcloud/1012-master

hide parameters of tryLogin when logging
This commit is contained in:
Lukas Reschke 2016-08-22 23:03:49 +02:00 committed by GitHub
commit 6ef6d499bf
2 changed files with 19 additions and 0 deletions

View File

@ -86,6 +86,9 @@ class Log implements ILogger {
'calculateHMAC',
'encrypt',
'decrypt',
//LoginController
'tryLogin'
];
/**

View File

@ -122,4 +122,20 @@ class LoggerTest extends TestCase {
$this->assertContains('validateUserPass(*** sensitive parameters replaced ***)', $logLine);
}
}
/**
* @dataProvider userAndPasswordData
*/
public function testDetecttryLogin($user, $password) {
$e = new \Exception('test');
$this->logger->logException($e);
$logLines = $this->getLogs();
foreach($logLines as $logLine) {
$this->assertNotContains($user, $logLine);
$this->assertNotContains($password, $logLine);
$this->assertContains('tryLogin(*** sensitive parameters replaced ***)', $logLine);
}
}
}