aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/User/SessionTest.php
Commit message (Collapse)AuthorAgeFilesLines
* fix(session): Log when session_* calls are slowChristoph Wurst2024-08-071-14/+14
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* fix(session): Do not update authtoken last_check for passwordlessChristoph Wurst2024-06-031-0/+78
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* fix(session): Avoid two useless authtoken DB queries for every anonymous requestGit'Fellow2024-01-171-0/+50
| | | | | | Co-Authored-By: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* perf: Use more performant way to obtain and check the email as a login name ↵Julius Härtl2023-11-301-1/+1
| | | | | | with token login Signed-off-by: Julius Härtl <jus@bitgrid.net>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-1/+1
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* techdebt(DI): Use public IThrottler interface which exists since Nextcloud 25Joas Schilling2023-08-281-3/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix!: Remove symfony EventDispatcherInterface from UserJoas Schilling2023-07-271-11/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(dav): Abort requests with 429 instead of waitingJoas Schilling2023-05-031-5/+5
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Adapt tests to config value typingCôme Chilliet2023-04-051-3/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* chore(tests): add tests for handleLoginFailedDaniel Kesselberg2023-03-101-0/+97
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Fix dynamic property creations in test filesCôme Chilliet2022-08-011-0/+2
| | | | | | This fixes warnings in PHP 8.2 Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Migrate from ILogger to LoggerInterface where needed in the testsCôme Chilliet2022-03-241-3/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix testsJoas Schilling2022-02-231-45/+50
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Remove unused importsJoas Schilling2021-12-021-2/+0
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix testsCarl Schwan2021-12-011-420/+0
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Fix unit testsJoas Schilling2021-11-121-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Cache the user backend info for 300sJoas Schilling2021-02-151-7/+15
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix more testsJoas Schilling2020-10-131-2/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix unit testsJoas Schilling2020-08-191-10/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-251-80/+80
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add typed create user eventsChristoph Wurst2019-12-031-13/+39
| | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Mode to modern phpunitRoeland Jago Douma2019-11-271-12/+12
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-221-1/+1
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix the tests after #18029Roeland Jago Douma2019-11-211-2/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make the post login event publicChristoph Wurst2019-11-201-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make renewSessionToken return the new tokenRoeland Jago Douma2019-10-091-10/+9
| | | | | | | Avoids directly getting the token again. We just inserted it so it and have all the info. So that query is just a waste. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update testsRoeland Jago Douma2019-07-291-44/+71
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add dispatcher events to User and Group objectsJoas Schilling2019-03-011-14/+15
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add testsRoeland Jago Douma2018-10-021-0/+57
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Mark token as invalid if the password doesn't matchRoeland Jago Douma2018-10-021-4/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix session testsRoeland Jago Douma2018-05-151-2/+11
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix testsRoeland Jago Douma2018-01-231-45/+50
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Use ::class in test mocksMorris Jobke2017-10-241-4/+4
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix SessionTestRoeland Jago Douma2017-08-091-0/+11
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Adjust token nameLukas Reschke2017-05-181-1/+1
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Save the scope of an auth token in the sessionRobin Appelman2017-04-051-29/+36
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix testsJoas Schilling2017-01-051-1/+13
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Set last-login-check on basic authRoeland Jago Douma2016-12-051-0/+101
| | | | | | | | | Else the last-login-check fails hard because the session value is not set and thus defaults to 0. * Started with tests Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* fix parameter orderChristoph Wurst2016-11-281-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* do not remember session tokens by defaultChristoph Wurst2016-11-271-3/+43
| | | | | | | | We have to respect the value of the remember-me checkbox. Due to an error in the source code the default value for the session token was to remember it. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add missing tests and fix PHPDocLukas Reschke2016-11-021-1/+44
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* inject ISecureRandom into user session and use injected config tooChristoph Wurst2016-11-021-49/+60
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* bring back remember-meChristoph Wurst2016-11-021-128/+161
| | | | | | | | | | * try to reuse the old session token for remember me login * decrypt/encrypt token password and set the session id accordingly * create remember-me cookies only if checkbox is checked and 2fa solved * adjust db token cleanup to store remembered tokens longer * adjust unit tests Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Proper DI of configRoeland Jago Douma2016-10-281-6/+24
| | | | | | * Fixed comments Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix and cleanup SessionTestRoeland Jago Douma2016-10-251-43/+26
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix logClientIn for non-existing users (#26292)Vincent Petry2016-10-251-0/+26
| | | | | | | The check for two factor enforcement would return true for non-existing users. This fix makes it return false in order to be able to perform the regular login which will then fail and return false. This prevents throwing PasswordLoginForbidden for non-existing users.
* Add test to ensure token times are updatedRobin Appelman2016-10-111-24/+128
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>