nextcloud/tests/lib/Authentication/Token
Christoph Wurst 0299ea0a96
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-11-26 12:07:12 +01:00
..
DefaultTokenCleanupJobTest.php Add more tests 2018-06-18 22:11:55 +02:00
DefaultTokenMapperTest.php Use the defined func()->count() instead of manual counting 2018-11-08 15:44:45 +01:00
DefaultTokenProviderTest.php Move ExpiredTokenException to the correct namespace 2018-10-30 19:30:45 +01:00
DefaultTokenTest.php Fix tests 2018-05-15 10:56:40 +02:00
ManagerTest.php Handle token insert conflicts 2019-11-26 12:07:12 +01:00
PublicKeyTokenMapperTest.php Some php-cs fixes 2019-11-22 20:52:10 +01:00
PublicKeyTokenProviderTest.php Some php-cs fixes 2019-11-22 20:52:10 +01:00
PublicKeyTokenTest.php Add first tests 2018-06-18 22:11:54 +02:00
RemoteWipeTest.php Some php-cs fixes 2019-11-22 20:52:10 +01:00