Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-03-23Automatically cut the token name on the first levelJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-23Fix unit testsJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-02More test fixingJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-02More test fixingJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-01More unit test adjustmentsJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-23Fix test class namesCôme Chilliet
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-10-22Prevent duplicate auth token activity updatesChristoph Wurst
The auth token activity logic works as follows * Read auth token * Compare last activity time stamp to current time * Update auth token activity if it's older than x seconds This works fine in isolation but with concurrency that means that occasionally the same token is read simultaneously by two processes and both of these processes will trigger an update of the same row. Affectively the second update doesn't add much value. It might set the time stamp to the exact same time stamp or one a few seconds later. But the last activity is no precise science, we don't need this accuracy. This patch changes the UPDATE query to include the expected value in a comparison with the current data. This results in an affected row when the data in the DB still has an old time stamp, but won't affect a row if the time stamp is (nearly) up to date. This is a micro optimization and will possibly not show any significant performance improvement. Yet in setups with a DB cluster it means that the write node has to send fewer changes to the read nodes due to the lower number of actual changes. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-04-22Fix Authentication testJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-20Move 2FA registration to IBootstrapRoeland Jago Douma
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-04-16Fix unit testRoeland Jago Douma
* Fix namespace * Fix test Was broken after https://github.com/nextcloud/server/pull/26529 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-03-22Add real events for enabled 2fa providers for usersRoeland Jago Douma
* Shiny new events * Listener to still emit the old event Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-02-10Always renew apppasswords on loginRoeland Jago Douma
Else you can end up that you renewed your password (LDAP for example). But they still don't work because you did not use them before you logged in. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-01-22Convert 2FA token type to stringChristoph Wurst
The IConfig service is documented to handle its data as strings, hence this changes the code a bit to ensure we store keys as string and convert them back when reading. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-12Use PSR logger in authenticationJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-05Format code to a single space around binary operatorsChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-04Allow configuring the activity update interval of tokenRoeland Jago Douma
On some systems with a lot of users this creates a lot of extra DB writes. Being able to increase this interval helps there. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-09-07Fix undefined class property access after upgrade from 19 to 20Christoph Wurst
The serialized data in 19 has one property less and this was not considered in the code. Hence adding a fallback. Moreover I'm changing the deserialization into an array instead of object, as that is the safer option. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-20adapt testGetLoginCredentialsInvalidTokenLoginCredentials() unit test to uid ↵Lionel Elie Mamane
!= loginname Signed-off-by: Lionel Elie Mamane <lionel@mamane.lu>
2020-08-13Merge pull request #21344 from nextcloud/fix/twofactor-cleanup-eventMorris Jobke
Emit an event for every disabled 2FA provider during cleanup
2020-08-12Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke
\PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-06-16Emit an event for every disabled 2FA provider during cleanupChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-06-15Clean up auth tokens when user is deletedChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-23Do not create remember me cookieJulius Härtl
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-04-10Format control structures, classes, methods and functionChristoph Wurst
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10Use elseif instead of else ifChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09Unify function spacing to PSR2 recommendationChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09Use a blank line after the opening tagChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-08Fix multiline commentsChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31[POC] Event for failed login attemptsRoeland Jago Douma
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-03-27Merge pull request #20170 from nextcloud/techdebt/remove-unused-importsChristoph Wurst
Remove unused imports
2020-03-26Use the shorter phpunit syntax for mocked return valuesChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26Remove unused importsChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-16Check the user on remote wipeJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-01-08Clean up 2FA provider registry when a user is deletedChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-11-27Mode to modern phpunitRoeland Jago Douma
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27Make phpunit8 compatibleRoeland Jago Douma
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-26Handle token insert conflictsChristoph Wurst
Env-based SAML uses the "Apache auth" mechanism to log users in. In this code path, we first delete all existin auth tokens from the database, before a new one is inserted. This is problematic for concurrent requests as they might reach the same code at the same time, hence both trying to insert a new row wit the same token (the session ID). This also bubbles up and disables user_saml. As the token might still be OK (both request will insert the same data), we can actually just check if the UIDs of the conflict row is the same as the one we want to insert right now. In that case let's just use the existing entry and carry on. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-11-22Some php-cs fixesRoeland Jago Douma
* 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>
2019-09-18Use the actual password to update the tokensRoeland Jago Douma
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-09-12Use Symfony's new contract Event class instead of the deprecated oneChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-07-16Update unit testsJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-09Make it possible to wipe all tokens/devices of a userChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-07-09Refactor: move remote wipe token logic to RW serviceChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-07-02Send emails when remote wipe starts/finishesChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-06-27Decouple remote wipe notifcation channels with eventsChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-05-17Allow 2FA to be setup on first loginRoeland Jago Douma
Once 2FA is enforced for a user and they have no 2FA setup yet this will now prompt them with a setup screen. Given that providers are enabled that allow setup then. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-05-07Add a login chain to reduce the complexity of LoginController::tryLoginChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2018-11-08Use the defined func()->count() instead of manual countingJoas Schilling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-10-30Move ExpiredTokenException to the correct namespaceRoeland Jago Douma
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-15Make it possible to enforce mandatory 2FA for groupsChristoph Wurst
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>