nextcloud/tests/lib
Christoph Wurst 55b5e13e15
Handle token insert conflicts
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-12-02 14:20:51 +01:00
..
Accounts Use IAccountManager constants 2018-10-15 13:30:31 +02:00
Activity Remove legacy activity stuff 2019-01-24 16:52:38 +01:00
App Properly inject the logger 2019-07-16 22:38:14 +02:00
AppFramework SessionMiddleware: declare session property 2019-08-28 13:02:29 +02:00
Archive Remove \OCP\Files::tmpFolder 2018-03-19 10:54:39 +01:00
Authentication Handle token insert conflicts 2019-12-02 14:20:51 +01:00
Avatar adjust test expectations 2019-10-01 10:18:20 +00:00
BackgroundJob fixup! fixup! Add backgroundjobs to OCP 2018-10-09 15:25:56 +02:00
Cache Make cache tests a bit more clear 2017-05-04 19:37:40 -03:00
Calendar RoomManager/ResourceManager: Inject IServerContainer instead of using OC Server 2018-10-08 01:50:17 +02:00
Collaboration/Collaborators Search sharees on lookup server when explicitly requested by user 2019-02-26 19:44:49 +01:00
Command Fix AsyncBusTests 2019-02-14 20:04:17 +01:00
Comments Add a unit test for guests as well 2019-07-11 10:24:27 +02:00
Contacts/ContactsMenu Do not try to autoload built in types 2019-06-04 15:13:32 +02:00
DB Update the tests to the comparison logic 2018-12-17 13:52:09 +01:00
Diagnostics Adjust query/event logging code in favour of more complex owncloud/diagnostics (#27643) 2017-04-26 13:19:43 +02:00
Encryption update encryption wrapper tests 2018-11-29 16:34:49 +01:00
Federation Fix risky tests without assertions 2018-01-25 11:33:25 +01:00
Files Merge pull request #17277 from nextcloud/backport/17264/stable17 2019-09-27 12:28:40 +02:00
GlobalScale add new config switched for the global scale architecture 2017-05-29 18:19:28 +02:00
Group Add dispatcher events to User and Group objects 2019-03-01 20:56:59 +01:00
Hooks Fix risky tests without assertions 2018-01-25 11:33:25 +01:00
Http/Client Add default timeout to expected request options 2019-09-03 14:59:09 +02:00
IntegrityCheck Exclude .rnd files from integrity check 2019-07-21 20:29:11 +02:00
L10N Add simple unit test for findLanguageFromLocale 2018-09-23 20:12:00 +02:00
Lock prevent lock values from going negative with memcache backend 2018-07-05 14:39:10 +02:00
Lockdown Remove deprecated searchByTag 2019-07-26 12:29:19 +02:00
Log Fix tests 2018-10-02 18:37:57 +02:00
Mail Addressing comments, array() to [] 2018-12-17 23:34:55 +01:00
Memcache Drop support for xcache 2018-08-12 17:14:08 +02:00
Migration Properly inject EventDispatched in BackgroundRepair 2019-03-22 10:29:36 +01:00
Notification Keep the old method as a fallback and adjust the tests 2019-07-16 11:36:32 +02:00
OCS PrivateData to app 2017-07-21 08:51:14 +02:00
Preview Add new Provider interface for preview providers 2019-06-17 14:09:09 +02:00
PublicNamespace Migrate tests for contacts manager to correct test class 2018-03-21 10:43:18 +01:00
Remote Add some more tests for ocs remote api 2017-12-08 16:37:14 +01:00
Repair Remove one time repair steps that have already run when updating to 17 2019-07-08 14:47:26 +02:00
RichObjectStrings Fix risky tests without assertions 2018-01-25 11:33:25 +01:00
Security Fix report of phpstan in Limiter 2019-08-19 19:38:43 +02:00
Session Use ::class in test mocks of encryption app 2017-10-26 13:56:56 +02:00
Settings Cleanup the Settings class 2019-08-26 11:50:26 +02:00
Share Remove unused OC\Share\Share::checkPasswordProtectedShare 2019-07-29 15:23:21 +02:00
Share20 Fix permission check on incoming federated shares 2019-07-31 12:59:51 +02:00
Support Fix subscription tests 2019-06-17 16:36:24 +02:00
SystemTag Use ::class in test mocks 2017-10-24 17:45:32 +02:00
Template Lock SCSS so we only run 1 job at a time 2019-07-12 16:18:02 +02:00
Traits Cleanup OC_User and OCP\User 2018-01-16 18:39:11 +01:00
Updater Do not check for updates if we have no internet 2019-11-20 19:55:19 +00:00
User Update tests 2019-07-29 16:31:40 +02:00
Util Return true in the dummy backend for successful display name change 2019-04-11 11:43:33 +02:00
APITest.php Remove unused methods and constants from legacy OC_API 2018-03-12 18:03:25 +01:00
AllConfigTest.php Don't use deprecated getMock() anymore 2017-04-20 12:30:21 +02:00
AppConfigTest.php treat sensitive config keys by pattern 2019-07-26 13:31:14 +02:00
AppTest.php Properly inject the logger 2019-07-16 22:38:14 +02:00
AutoLoaderTest.php Fix unit tests 2016-05-20 16:35:07 +02:00
CapabilitiesManagerTest.php Properly log the full exception instead of only the message 2018-01-23 10:57:21 +01:00
ConfigTest.php Check for boolean false and add tests 2017-04-04 15:56:50 -05:00
ContactsManagerTest.php Migrate tests for contacts manager to correct test class 2018-03-21 10:43:18 +01:00
DateTimeFormatterTest.php Provide tests for future timestamp formatting 2017-10-23 14:20:21 +02:00
ErrorHandlerTest.php FIx lib/ a-d 2016-05-19 09:27:21 +02:00
FileChunkingTest.php Use ::class in test mocks of dav app 2017-10-26 10:16:12 +02:00
HelperStorageTest.php fix quota tests for external storage 2017-05-12 11:32:16 -05:00
HookHelper.php Move tests/ to PSR-4 (#24731) 2016-05-20 15:38:20 +02:00
ImageTest.php Improve OC_Image code to not guess the type of input, but actually request the specific methods to be called 2018-01-18 13:40:55 +01:00
InfoXmlTest.php Fix risky tests without assertions 2018-01-25 11:33:25 +01:00
InitialStateServiceTest.php Add a key parameter to the new initial state API 2019-01-30 16:08:08 +01:00
InstallerTest.php Update CRL to contain revoked files_external_dropbox, passman & payback 2019-02-14 11:49:35 +01:00
LargeFileHelperGetFileSizeTest.php Remove unneeded Windows logic 2016-09-01 10:47:57 +02:00
LargeFileHelperTest.php Move tests/ to PSR-4 (#24731) 2016-05-20 15:38:20 +02:00
LegacyHelperTest.php Remove the upload and memory setting 2019-03-04 12:14:22 +01:00
LoggerTest.php revert Log's dependency to SystemConfig to work during Installation 2018-04-26 12:10:53 +02:00
MemoryInfoTest.php Adds license to files. Updates the branch. 2018-08-20 20:46:23 +02:00
NaturalSortTest.php Fix lib/ 2016-05-19 09:38:52 +02:00
NavigationManagerTest.php Use non-absolute logout URL to fix wrong URL in reverse proxy scenario 2019-05-08 18:02:00 +02:00
RepairStepTest.php Don't use deprecated getMock() anymore 2017-04-20 12:30:21 +02:00
ServerTest.php Implement guest avatar endpoint 2019-02-07 14:23:16 +01:00
SetupTest.php Add more test cases 2018-09-30 12:24:38 +02:00
SubAdminTest.php Expose subadmin to OCP 2019-01-29 20:47:35 +01:00
TagsTest.php Add dispatcher events to User and Group objects 2019-03-01 20:56:59 +01:00
TempManagerTest.php Loglevel is an int 2018-02-27 10:45:35 +01:00
TemplateFunctionsTest.php Fix lib/ 2016-05-19 09:38:52 +02:00
TestCase.php whitelist audit.log 2018-06-29 11:03:13 +02:00
TestMoveableMountPoint.php Move tests/ to PSR-4 (#24731) 2016-05-20 15:38:20 +02:00
UpdaterTest.php Revert "Wait for cron to finish before running upgrade command" 2018-11-01 15:23:40 +01:00
UrlGeneratorTest.php Allow empty strings in getAbsoluteURL 2018-11-20 13:36:16 +01:00
UtilCheckServerTest.php Use SystemConfig instead of AllConfig for DB stuff 2017-03-19 15:53:49 -06:00
UtilTest.php Remove \OCP\Files::tmpFolder 2018-03-19 10:54:39 +01:00