Просмотр исходного кода

fix(federation): re-add RequestSharedSecret job if necessary

fighting another race condition with federated server setup

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
fix/noid/federation-really-surely-init-token
Arthur Schiwon 2 месяцев назад
Родитель
Сommit
6ca4917faf
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 16 добавлений и 0 удалений
  1. 16
    0
      apps/federation/lib/Controller/OCSAuthAPIController.php

+ 16
- 0
apps/federation/lib/Controller/OCSAuthAPIController.php Просмотреть файл

@@ -28,6 +28,7 @@
*/
namespace OCA\Federation\Controller;

use OCA\Federation\BackgroundJob\RequestSharedSecret;
use OCA\Federation\DbHandler;
use OCA\Federation\TrustedServers;
use OCP\AppFramework\Http;
@@ -147,6 +148,21 @@ class OCSAuthAPIController extends OCSController {
'remote server (' . $url . ') presented lower token. We will initiate the exchange of the shared secret.',
['app' => 'federation']
);

$hasJob = false;
foreach ($this->jobList->getJobsIterator(RequestSharedSecret::class, 1, 0) as $job) {
$hasJob = true;
}
if (!$hasJob) {
$this->jobList->add(
RequestSharedSecret::class,
[
'url' => $url,
'token' => $this->dbHandler->getToken($url),
'created' => $this->timeFactory->getTime()
]
);
}
throw new OCSForbiddenException();
}


Загрузка…
Отмена
Сохранить