Merge pull request #1015 from nextcloud/1012-master
hide parameters of tryLogin when logging
This commit is contained in:
commit
6ef6d499bf
|
@ -86,6 +86,9 @@ class Log implements ILogger {
|
|||
'calculateHMAC',
|
||||
'encrypt',
|
||||
'decrypt',
|
||||
|
||||
//LoginController
|
||||
'tryLogin'
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue