|
|
@@ -13,7 +13,7 @@ use GuzzleHttp\Client as HttpClient;
|
|
|
|
use GuzzleHttp\Psr7\HttpFactory;
|
|
|
|
use GuzzleHttp\Psr7\HttpFactory;
|
|
|
|
use JmapClient\Authentication\Basic;
|
|
|
|
use JmapClient\Authentication\Basic;
|
|
|
|
use JmapClient\Client as JmapClient;
|
|
|
|
use JmapClient\Client as JmapClient;
|
|
|
|
use KTXC\Server;
|
|
|
|
use KTXF\Security\Crypto;
|
|
|
|
use KTXF\Resource\Provider\ResourceServiceIdentityBasic;
|
|
|
|
use KTXF\Resource\Provider\ResourceServiceIdentityBasic;
|
|
|
|
use KTXF\Resource\Provider\ResourceServiceLocationUri;
|
|
|
|
use KTXF\Resource\Provider\ResourceServiceLocationUri;
|
|
|
|
use KTXM\ProviderJmapc\Providers\Mail\Service as MailService;
|
|
|
|
use KTXM\ProviderJmapc\Providers\Mail\Service as MailService;
|
|
|
@@ -73,8 +73,7 @@ class RemoteService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// debugging
|
|
|
|
// debugging
|
|
|
|
if ($service->getDebug()) {
|
|
|
|
if ($service->getDebug()) {
|
|
|
|
$logDir = Server::getInstance()?->logDir();
|
|
|
|
$logDir = dirname(__DIR__, 5) . '/var/log/jmap/' . $service->identifier() . '.json';
|
|
|
|
$logDir .= '/jmap/' . $service->identifier() . '.json';
|
|
|
|
|
|
|
|
$client->configureTransportLogState(true);
|
|
|
|
$client->configureTransportLogState(true);
|
|
|
|
$client->configureTransportLogLocation($logDir);
|
|
|
|
$client->configureTransportLogLocation($logDir);
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -200,7 +199,7 @@ class RemoteService {
|
|
|
|
return $service;
|
|
|
|
return $service;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static function cookieStoreRetrieve(mixed $id): ?array {
|
|
|
|
public static function cookieStoreRetrieve(mixed $id, Crypto $crypto): ?array {
|
|
|
|
|
|
|
|
|
|
|
|
$file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc';
|
|
|
|
$file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc';
|
|
|
|
|
|
|
|
|
|
|
@@ -209,7 +208,6 @@ class RemoteService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$data = file_get_contents($file);
|
|
|
|
$data = file_get_contents($file);
|
|
|
|
$crypto = Server::getInstance()->container()->get(\KTXF\Security\Crypto::class);
|
|
|
|
|
|
|
|
$data = $crypto->decrypt($data);
|
|
|
|
$data = $crypto->decrypt($data);
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($data)) {
|
|
|
|
if (!empty($data)) {
|
|
|
@@ -220,13 +218,12 @@ class RemoteService {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static function cookieStoreDeposit(mixed $id, array $value): void {
|
|
|
|
public static function cookieStoreDeposit(mixed $id, array $value, Crypto $crypto): void {
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($value)) {
|
|
|
|
if (empty($value)) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$crypto = Server::getInstance()->container()->get(\KTXF\Security\Crypto::class);
|
|
|
|
|
|
|
|
$data = $crypto->encrypt(json_encode($value));
|
|
|
|
$data = $crypto->encrypt(json_encode($value));
|
|
|
|
|
|
|
|
|
|
|
|
$file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc';
|
|
|
|
$file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc';
|
|
|
|