]> source.dussan.org Git - nextcloud-server.git/commit
Run session token renewals in a database transaction 34379/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Sun, 2 Oct 2022 12:11:41 +0000 (14:11 +0200)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Tue, 18 Oct 2022 06:28:22 +0000 (08:28 +0200)
commitc5922e67d37f3bcf7748a36b4c7ab10d1d10f2b8
treebf00de8c823c15886571e8fe7b2066e03be8dddd
parent495d49a1324d5047ab122a20d1900e0239d4de59
Run session token renewals in a database transaction

The session token renewal does
1) Read the old token
2) Write a new token
3) Delete the old token

If two processes succeed to read the old token there can be two new tokens because
the queries were not run in a transaction. This is particularly problematic on
clustered DBs where 1) would go to a read node and 2) and 3) go to a write node.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
lib/private/Authentication/Token/PublicKeyTokenProvider.php
tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php