diff --git a/app/modules/web/Controllers/ConfigEncryptionController.php b/app/modules/web/Controllers/ConfigEncryptionController.php index 098d8317..5af6fa79 100644 --- a/app/modules/web/Controllers/ConfigEncryptionController.php +++ b/app/modules/web/Controllers/ConfigEncryptionController.php @@ -24,8 +24,6 @@ namespace SP\Modules\Web\Controllers; -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; use SP\Core\Acl\Acl; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Crypt\Hash; @@ -54,9 +52,8 @@ class ConfigEncryptionController extends SimpleControllerBase use JsonTrait; /** - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface - * @throws \SP\Services\Config\ParameterNotFoundException + * @throws \SP\Repositories\NoSuchItemException + * @throws \SP\Services\ServiceException */ public function saveAction() { diff --git a/app/modules/web/Controllers/ConfigManagerController.php b/app/modules/web/Controllers/ConfigManagerController.php index a1a6fc10..23748c7f 100644 --- a/app/modules/web/Controllers/ConfigManagerController.php +++ b/app/modules/web/Controllers/ConfigManagerController.php @@ -62,7 +62,6 @@ class ConfigManagerController extends ControllerBase /** * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface - * @throws \SP\Services\Config\ParameterNotFoundException * @throws \SP\Core\Exceptions\SPException */ public function indexAction() @@ -75,7 +74,6 @@ class ConfigManagerController extends ControllerBase * * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface - * @throws \SP\Services\Config\ParameterNotFoundException * @throws \SP\Core\Exceptions\SPException */ protected function getTabs() @@ -220,7 +218,8 @@ class ConfigManagerController extends ControllerBase * @return DataTab * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException - * @throws \SP\Services\Config\ParameterNotFoundException + * @throws \SP\Repositories\NoSuchItemException + * @throws \SP\Services\ServiceException */ protected function getEncryptionConfig() { @@ -322,7 +321,8 @@ class ConfigManagerController extends ControllerBase /** * @return DataTab - * @throws \SP\Core\Exceptions\SPException + * @throws \SP\Repositories\NoSuchItemException + * @throws \SP\Services\ServiceException */ protected function getInfo() { @@ -332,7 +332,7 @@ class ConfigManagerController extends ControllerBase $template->assign('dbInfo', DBUtil::getDBinfo($this->dic->get(MySQLHandler::class))); $template->assign('dbName', $this->configData->getDbName() . '@' . $this->configData->getDbHost()); - $template->assign('configBackupDate', date('r', $this->dic->get(ConfigService::class)->getByParam('config_backupdate', 0))); + $template->assign('configBackupDate', date('r', $this->dic->get(ConfigService::class)->getByParam('config_backup_date', 0))); $template->assign('plugins', PluginUtil::getLoadedPlugins()); $template->assign('locale', Language::$localeStatus ?: sprintf('%s (%s)', $this->configData->getSiteLang(), __('No instalado'))); $template->assign('securedSession', CryptSessionHandler::$isSecured); diff --git a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php index 608336e5..ad376079 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php @@ -190,9 +190,10 @@ class AccountHelper extends HelperBase } /** + * @throws NoSuchItemException * @throws UnauthorizedPageException * @throws UpdatedMasterPassException - * @throws \SP\Services\Config\ParameterNotFoundException + * @throws \SP\Services\ServiceException */ public function checkActionAccess() { @@ -286,11 +287,12 @@ class AccountHelper extends HelperBase * @param $actionId * * @return void + * @throws NoSuchItemException * @throws UnauthorizedPageException * @throws UpdatedMasterPassException * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException - * @throws \SP\Services\Config\ParameterNotFoundException + * @throws \SP\Services\ServiceException */ public function setViewForBlank($actionId) { @@ -335,11 +337,10 @@ class AccountHelper extends HelperBase * @param int $actionId * * @return bool + * @throws NoSuchItemException * @throws UnauthorizedPageException * @throws UpdatedMasterPassException - * @throws \Psr\Container\ContainerExceptionInterface - * @throws \Psr\Container\NotFoundExceptionInterface - * @throws \SP\Services\Config\ParameterNotFoundException + * @throws \SP\Services\ServiceException */ public function setViewForRequest(AccountDetailsResponse $accountDetailsResponse, $actionId) { diff --git a/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php index 673d8f64..767af039 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountHistoryHelper.php @@ -81,7 +81,6 @@ class AccountHistoryHelper extends HelperBase * @throws UpdatedMasterPassException * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException - * @throws \SP\Services\Config\ParameterNotFoundException */ public function setView(AccountHistoryData $accountHistoryData, $actionId) { @@ -114,8 +113,9 @@ class AccountHistoryHelper extends HelperBase /** * @throws UnauthorizedPageException - * @throws \SP\Services\Config\ParameterNotFoundException * @throws UpdatedMasterPassException + * @throws \SP\Repositories\NoSuchItemException + * @throws \SP\Services\ServiceException */ protected function checkActionAccess() { diff --git a/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php index e8197976..c6e84a5d 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -51,6 +51,7 @@ class AccountPasswordHelper extends HelperBase * @param AccountPassData $account * @param \SP\Core\Acl\Acl $acl * @param $type + * * @return string|null * @throws HelperException * @throws \Defuse\Crypto\Exception\CryptoException @@ -76,10 +77,12 @@ class AccountPasswordHelper extends HelperBase * Returns account's password * * @param AccountPassData $accountData + * * @return string * @throws HelperException * @throws \Defuse\Crypto\Exception\CryptoException - * @throws \SP\Services\Config\ParameterNotFoundException + * @throws \SP\Repositories\NoSuchItemException + * @throws \SP\Services\ServiceException */ protected function getPasswordClear(AccountPassData $accountData) { @@ -98,6 +101,7 @@ class AccountPasswordHelper extends HelperBase /** * @param AccountPassData $accountData + * * @throws HelperException * @throws \Defuse\Crypto\Exception\CryptoException * @throws \SP\Core\Exceptions\SPException diff --git a/lib/SP/Config/Config.php b/lib/SP/Config/Config.php index 4349d062..5040b4ef 100644 --- a/lib/SP/Config/Config.php +++ b/lib/SP/Config/Config.php @@ -154,7 +154,7 @@ class Config try { if ($backup) { $this->dic->get(ConfigBackupService::class) - ->backup(); + ->backup($configData); } $configData->setConfigDate(time()); @@ -162,6 +162,8 @@ class Config $configData->setConfigHash(); $this->fileStorage->save($configData, 'config'); + + $this->configData = $configData; } catch (\Exception $e) { processException($e); } diff --git a/lib/SP/DataModel/ConfigData.php b/lib/SP/DataModel/ConfigData.php index 0d92fcc6..75bb9869 100644 --- a/lib/SP/DataModel/ConfigData.php +++ b/lib/SP/DataModel/ConfigData.php @@ -35,7 +35,7 @@ class ConfigData /** * @var string */ - public $param; + public $parameter; /** * @var string */ @@ -49,24 +49,24 @@ class ConfigData */ public function __construct($param, $value) { - $this->param = $param; + $this->parameter = $param; $this->value = $value; } /** * @return string */ - public function getParam() + public function getParameter() { - return $this->param; + return $this->parameter; } /** - * @param string $param + * @param string $parameter */ - public function setParam($param) + public function setParameter($parameter) { - $this->param = $param; + $this->parameter = $parameter; } /** diff --git a/lib/SP/Repositories/Config/ConfigRepository.php b/lib/SP/Repositories/Config/ConfigRepository.php index a54a74aa..36e0ae18 100644 --- a/lib/SP/Repositories/Config/ConfigRepository.php +++ b/lib/SP/Repositories/Config/ConfigRepository.php @@ -37,29 +37,6 @@ use SP\Storage\Database\QueryData; */ class ConfigRepository extends Repository { - /** - * @param ConfigData[] $data - * - * @return bool - * @throws \SP\Core\Exceptions\SPException - */ - public function updateBatch(array $data) - { - $this->db->beginTransaction(); - - try { - foreach ($data as $configData) { - $this->update($configData); - } - } catch (QueryException $e) { - debugLog($e->getMessage()); - } catch (ConstraintException $e) { - debugLog($e->getMessage()); - } finally { - return $this->db->endTransaction(); - } - } - /** * @param ConfigData $configData * @@ -71,7 +48,7 @@ class ConfigRepository extends Repository { $queryData = new QueryData(); $queryData->setQuery('UPDATE Config SET `value` = ? WHERE parameter = ?'); - $queryData->setParams([$configData->getValue(), $configData->getParam()]); + $queryData->setParams([$configData->getValue(), $configData->getParameter()]); return $this->db->doQuery($queryData)->getAffectedNumRows(); } @@ -86,8 +63,8 @@ class ConfigRepository extends Repository public function create(ConfigData $configData) { $queryData = new QueryData(); - $queryData->setQuery('INSERT INTO Config SET parameter = ?, value = ?'); - $queryData->setParams([$configData->getParam(), $configData->getValue()]); + $queryData->setQuery('INSERT INTO Config SET parameter = ?, `value` = ?'); + $queryData->setParams([$configData->getParameter(), $configData->getValue()]); return $this->db->doQuery($queryData)->getAffectedNumRows(); } @@ -95,32 +72,32 @@ class ConfigRepository extends Repository /** * Obtener un array con la configuración almacenada en la BBDD. * - * @return ConfigData[] + * @return \SP\Storage\Database\QueryResult * @throws ConstraintException * @throws QueryException */ public function getAll() { $queryData = new QueryData(); - $queryData->setQuery('SELECT parameter, value FROM Config'); + $queryData->setQuery('SELECT parameter, `value` FROM Config ORDER BY parameter'); - return $this->db->doSelect($queryData)->getData(); + return $this->db->doSelect($queryData); } /** * @param string $param * - * @return mixed + * @return \SP\Storage\Database\QueryResult * @throws ConstraintException * @throws QueryException */ public function getByParam($param) { $queryData = new QueryData(); - $queryData->setQuery('SELECT value FROM Config WHERE parameter = ? LIMIT 1'); + $queryData->setQuery('SELECT parameter, `value` FROM Config WHERE parameter = ? LIMIT 1'); $queryData->addParam($param); - return $this->db->doSelect($queryData)->getData(); + return $this->db->doSelect($queryData); } /** @@ -142,7 +119,7 @@ class ConfigRepository extends Repository /** * @param $param * - * @return bool + * @return int * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException */ diff --git a/lib/SP/Services/Account/AccountService.php b/lib/SP/Services/Account/AccountService.php index 1153b4eb..98be6f53 100644 --- a/lib/SP/Services/Account/AccountService.php +++ b/lib/SP/Services/Account/AccountService.php @@ -307,11 +307,10 @@ class AccountService extends Service implements AccountServiceInterface * @param bool $isDelete * * @return bool + * @throws NoSuchItemException * @throws QueryException - * @throws \Psr\Container\ContainerExceptionInterface - * @throws \Psr\Container\NotFoundExceptionInterface + * @throws ServiceException * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Services\Config\ParameterNotFoundException */ protected function addHistory($accountId, $isDelete = false) { diff --git a/lib/SP/Services/Config/ConfigBackupService.php b/lib/SP/Services/Config/ConfigBackupService.php index e8b6c088..93823be5 100644 --- a/lib/SP/Services/Config/ConfigBackupService.php +++ b/lib/SP/Services/Config/ConfigBackupService.php @@ -24,8 +24,11 @@ namespace SP\Services\Config; +use SP\Config\ConfigData; +use SP\Repositories\NoSuchItemException; use SP\Services\Service; use SP\Services\ServiceException; +use SP\Util\Util; /** * Class ConfigBackupService @@ -40,12 +43,14 @@ class ConfigBackupService extends Service protected $configService; /** - * Backups the config data into the database + * Backs up the config data into the database + * + * @param ConfigData $configData */ - public function backup() + public function backup(ConfigData $configData) { try { - $this->configService->save('config_backup', bin2hex(gzcompress(serialize($this->config->getConfigData())))); + $this->configService->save('config_backup', $this->packConfigData($configData)); $this->configService->save('config_backup_date', time()); } catch (\Exception $e) { processException($e); @@ -53,11 +58,44 @@ class ConfigBackupService extends Service } /** + * @param ConfigData $configData + * + * @return string + */ + private function packConfigData(ConfigData $configData) + { + return bin2hex(gzcompress(serialize($configData))); + } + + /** + * @return ConfigData * @throws ServiceException */ public function restore() { - throw new ServiceException('Not implemented'); + try { + $data = $this->configService->getByParam('config_backup'); + + if ($data === null) { + throw new ServiceException(__u('No es posible restaurar la configuración')); + } + + return $this->config->saveConfig($this->unpackConfigData($data))->getConfigData(); + } catch (NoSuchItemException $e) { + processException($e); + + throw new ServiceException(__u('No es posible restaurar la configuración')); + } + } + + /** + * @param string $configData + * + * @return ConfigData + */ + private function unpackConfigData(string $configData) + { + return Util::unserialize(ConfigData::class, gzuncompress(hex2bin($configData))); } protected function initialize() diff --git a/lib/SP/Services/Config/ConfigService.php b/lib/SP/Services/Config/ConfigService.php index 4b450384..041dc2e5 100644 --- a/lib/SP/Services/Config/ConfigService.php +++ b/lib/SP/Services/Config/ConfigService.php @@ -29,6 +29,7 @@ use SP\Core\Exceptions\QueryException; use SP\DataModel\ConfigData; use SP\DataModel\Dto\ConfigRequest; use SP\Repositories\Config\ConfigRepository; +use SP\Repositories\NoSuchItemException; use SP\Services\Service; use SP\Services\ServiceException; @@ -46,32 +47,39 @@ class ConfigService extends Service /** * @param string $param - * @param null $default + * @param mixed $default + * * @return mixed - * @throws ParameterNotFoundException + * @throws NoSuchItemException + * @throws ServiceException */ public function getByParam($param, $default = null) { - $query = $this->configRepository->getByParam($param); + try { + /** @var ConfigData $data */ + $data = $this->configRepository->getByParam($param)->getData(); + } catch (\Exception $e) { + throw new ServiceException($e->getMessage(), ServiceException::ERROR, null, $e->getCode(), $e); + } - if (empty($query)) { + + if (empty($data)) { if ($default !== null) { return $default; } - throw new ParameterNotFoundException( - sprintf(__('Parámetro no encontrado (%s)'), - ParameterNotFoundException::ERROR, - $param) + throw new NoSuchItemException( + sprintf(__('Parámetro no encontrado (%s)'), $param) ); } - return empty($query->value) ? $default : $query->value; + return empty($data->value) ? $default : $data->value; } /** * @param ConfigData $configData - * @return bool + * + * @return int * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException */ @@ -82,28 +90,28 @@ class ConfigService extends Service /** * @param ConfigRequest $configRequest + * * @throws ServiceException */ public function saveBatch(ConfigRequest $configRequest) { - foreach ($configRequest->getData() as $param => $value) { - try { - $this->save($param, $value); - } catch (ConstraintException $e) { - processException($e); + try { + $this->transactionAware(function () use ($configRequest) { + foreach ($configRequest->getData() as $param => $value) { + $this->save($param, $value); + } + }); + } catch (\Exception $e) { + processException($e); - throw new ServiceException($e->getMessage(), $e->getType(), $e->getHint(), $e->getCode()); - } catch (QueryException $e) { - processException($e); - - throw new ServiceException($e->getMessage(), $e->getType(), $e->getHint(), $e->getCode()); - } + throw new ServiceException($e->getMessage(), ServiceException::ERROR, null, $e->getCode(), $e); } } /** * @param string $param * @param string $value + * * @return bool * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException @@ -121,21 +129,27 @@ class ConfigService extends Service * Obtener un array con la configuración almacenada en la BBDD. * * @return ConfigData[] + * @throws ConstraintException + * @throws QueryException */ public function getAll() { - return $this->configRepository->getAll(); + return $this->configRepository->getAll()->getDataAsArray(); } /** * @param $param - * @return bool - * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Core\Exceptions\QueryException + * + * @return void + * @throws ConstraintException + * @throws NoSuchItemException + * @throws QueryException */ public function deleteByParam($param) { - return $this->configRepository->deleteByParam($param); + if ($this->configRepository->deleteByParam($param) === 0) { + throw new NoSuchItemException(sprintf(__('Parámetro no encontrado (%s)'), $param)); + } } /** diff --git a/lib/SP/Services/Crypt/MasterPassService.php b/lib/SP/Services/Crypt/MasterPassService.php index 8bef9ac9..e20816b0 100644 --- a/lib/SP/Services/Crypt/MasterPassService.php +++ b/lib/SP/Services/Crypt/MasterPassService.php @@ -56,8 +56,10 @@ class MasterPassService extends Service /** * @param int $userMPassTime + * * @return bool - * @throws \SP\Services\Config\ParameterNotFoundException + * @throws ServiceException + * @throws \SP\Repositories\NoSuchItemException */ public function checkUserUpdateMPass($userMPassTime) { @@ -69,8 +71,10 @@ class MasterPassService extends Service /** * @param string $masterPassword + * * @return bool - * @throws \SP\Services\Config\ParameterNotFoundException + * @throws ServiceException + * @throws \SP\Repositories\NoSuchItemException */ public function checkMasterPassword($masterPassword) { diff --git a/lib/SP/Services/Crypt/TemporaryMasterPassService.php b/lib/SP/Services/Crypt/TemporaryMasterPassService.php index 6104275d..7f39fc07 100644 --- a/lib/SP/Services/Crypt/TemporaryMasterPassService.php +++ b/lib/SP/Services/Crypt/TemporaryMasterPassService.php @@ -29,8 +29,9 @@ use SP\Core\Crypt\Hash; use SP\Core\Crypt\Session; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; +use SP\DataModel\Dto\ConfigRequest; +use SP\Repositories\NoSuchItemException; use SP\Services\Config\ConfigService; -use SP\Services\Config\ParameterNotFoundException; use SP\Services\Service; use SP\Services\ServiceException; use SP\Util\Util; @@ -59,6 +60,7 @@ class TemporaryMasterPassService extends Service * Crea una clave temporal para encriptar la clave maestra y guardarla. * * @param int $maxTime El tiempo máximo de validez de la clave + * * @return string * @throws ServiceException */ @@ -71,12 +73,15 @@ class TemporaryMasterPassService extends Service $randomKey = Util::generateRandomBytes(32); $secureKey = Crypt::makeSecuredKey($randomKey); - $this->configService->save('tempmaster_pass', Crypt::encrypt(Session::getSessionKey($this->context), $secureKey, $randomKey)); - $this->configService->save('tempmaster_passkey', $secureKey); - $this->configService->save('tempmaster_passhash', Hash::hashKey($randomKey)); - $this->configService->save('tempmaster_passtime', time()); - $this->configService->save('tempmaster_maxtime', $this->maxTime); - $this->configService->save('tempmaster_attempts', 0); + $configRequest = new ConfigRequest(); + $configRequest->add('tempmaster_pass', Crypt::encrypt(Session::getSessionKey($this->context), $secureKey, $randomKey)); + $configRequest->add('tempmaster_passkey', $secureKey); + $configRequest->add('tempmaster_passhash', Hash::hashKey($randomKey)); + $configRequest->add('tempmaster_passtime', time()); + $configRequest->add('tempmaster_maxtime', $this->maxTime); + $configRequest->add('tempmaster_attempts', 0); + + $this->configService->saveBatch($configRequest); // Guardar la clave temporal hasta que finalice la sesión $this->context->setTemporaryMasterPass($randomKey); @@ -98,6 +103,7 @@ class TemporaryMasterPassService extends Service * Comprueba si la clave temporal es válida * * @param string $pass clave a comprobar + * * @return bool * @throws ServiceException */ @@ -133,7 +139,7 @@ class TemporaryMasterPassService extends Service } return $isValid; - } catch (ParameterNotFoundException $e) { + } catch (NoSuchItemException $e) { return false; } catch (\Exception $e) { processException($e); @@ -143,16 +149,19 @@ class TemporaryMasterPassService extends Service } /** - * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Core\Exceptions\QueryException + * @throws ServiceException */ protected function expire() { - $this->configService->save('tempmaster_pass', ''); - $this->configService->save('tempmaster_passkey', ''); - $this->configService->save('tempmaster_passhash', ''); - $this->configService->save('tempmaster_maxtime', ''); - $this->configService->save('tempmaster_attempts', 0); + $configRequest = new ConfigRequest(); + $configRequest->add('tempmaster_pass', ''); + $configRequest->add('tempmaster_passkey', ''); + $configRequest->add('tempmaster_passhash', ''); + $configRequest->add('tempmaster_passtime', 0); + $configRequest->add('tempmaster_maxtime', 0); + $configRequest->add('tempmaster_attempts', 0); + + $this->configService->saveBatch($configRequest); $this->eventDispatcher->notifyEvent('expire.tempMasterPassword', new Event($this, EventMessage::factory() @@ -164,9 +173,11 @@ class TemporaryMasterPassService extends Service * Devuelve la clave maestra que ha sido encriptada con la clave temporal * * @param $key string con la clave utilizada para encriptar + * * @return string con la clave maestra desencriptada + * @throws NoSuchItemException + * @throws ServiceException * @throws \Defuse\Crypto\Exception\CryptoException - * @throws \SP\Services\Config\ParameterNotFoundException */ public function getUsingKey($key) { diff --git a/lib/SP/Services/User/UserPassService.php b/lib/SP/Services/User/UserPassService.php index 4dd46164..98a0d665 100644 --- a/lib/SP/Services/User/UserPassService.php +++ b/lib/SP/Services/User/UserPassService.php @@ -72,6 +72,7 @@ class UserPassService extends Service * * @param string $oldUserPass * @param UserLoginData $userLoginData $UserData + * * @return UserPassResponse * @throws SPException * @throws \Defuse\Crypto\Exception\CryptoException @@ -94,6 +95,7 @@ class UserPassService extends Service * * @param UserLoginData $userLoginData * @param string $key Clave de cifrado + * * @return UserPassResponse * @throws SPException * @throws \Psr\Container\ContainerExceptionInterface @@ -152,6 +154,7 @@ class UserPassService extends Service * @param string $userLogin * @param string $userPass * @param ConfigData $configData + * * @return string con la clave de cifrado */ public static function makeKeyForUser($userLogin, $userPass, ConfigData $configData) @@ -164,6 +167,7 @@ class UserPassService extends Service * * @param string $userMPass con la clave maestra * @param UserLoginData $userLoginData $userLoginData + * * @return UserPassResponse * @throws SPException * @throws \Defuse\Crypto\Exception\CryptoException @@ -205,6 +209,7 @@ class UserPassService extends Service * @param string $masterPass * @param string $userLogin * @param string $userPass + * * @return UserPassResponse * @throws CryptoException * @throws SPException @@ -239,6 +244,7 @@ class UserPassService extends Service /** * @param int $id * @param string $userPass + * * @return bool * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException diff --git a/tests/Repositories/ConfigRepositoryTest.php b/tests/Repositories/ConfigRepositoryTest.php new file mode 100644 index 00000000..a09cfe2b --- /dev/null +++ b/tests/Repositories/ConfigRepositoryTest.php @@ -0,0 +1,159 @@ +. + */ + +namespace SP\Tests\Repositories; + +use SP\DataModel\ConfigData; +use SP\Repositories\Config\ConfigRepository; +use SP\Storage\Database\DatabaseConnectionData; +use SP\Tests\DatabaseTestCase; +use function SP\Tests\setupContext; + +/** + * Class ConfigRepositoryTest + * + * @package SP\Tests\Repositories + */ +class ConfigRepositoryTest extends DatabaseTestCase +{ + /** + * @var ConfigRepository + */ + private static $repository; + + /** + * @throws \DI\DependencyException + * @throws \DI\NotFoundException + * @throws \SP\Core\Context\ContextException + */ + public static function setUpBeforeClass() + { + $dic = setupContext(); + + self::$dataset = 'syspass_config.xml'; + + // Datos de conexión a la BBDD + self::$databaseConnectionData = $dic->get(DatabaseConnectionData::class); + + // Inicializar el repositorio + self::$repository = $dic->get(ConfigRepository::class); + } + + /** + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + */ + public function testCreate() + { + $data = new ConfigData('test', uniqid()); + + $this->assertEquals(1, self::$repository->create($data)); + + $result = self::$repository->getByParam($data->getParameter()); + $this->assertEquals(1, $result->getNumRows()); + + $resultData = $result->getData(); + + $this->assertEquals($data->getParameter(), $resultData->parameter); + $this->assertEquals($data->getValue(), $resultData->value); + + } + + /** + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + */ + public function testHas() + { + $this->assertTrue(self::$repository->has('config_backup_date')); + $this->assertFalse(self::$repository->has('test')); + } + + /** + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + */ + public function testUpdate() + { + $data = new ConfigData('config_backup_date', time()); + + $this->assertEquals(1, self::$repository->update($data)); + + $result = self::$repository->getByParam($data->getParameter()); + $this->assertEquals(1, $result->getNumRows()); + + $resultData = $result->getData(); + + $this->assertEquals($data->getParameter(), $resultData->parameter); + $this->assertEquals($data->getValue(), $resultData->value); + + $data = new ConfigData('test', time()); + + $this->assertEquals(0, self::$repository->update($data)); + } + + /** + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + */ + public function testGetAll() + { + $result = self::$repository->getAll(); + + $this->assertEquals($this->conn->getRowCount('Config'), $result->getNumRows()); + + $data = $result->getDataAsArray(); + + $this->assertEquals('config_backup', $data[0]->parameter); + $this->assertEquals('789ca558db6edb3810edb718c5be6c6b88ba4b45814de3a497a48d374e832cb0404191944d589654916a9216f9f71d5292633ba1a4621f628bf11cce68e6cc85bc886d2b9e2ce6ff1e1779ca97edd70c4b3c89c328fe2562c78e272f9e13785197cb0a5376c6ee276f440cdba82f273089d3625ddff2353fc97192313a79c3634b019c21c0d72afb2d0520ff0e0bb68b7107318255bf059863217601d110e00bde305162b2675768426514973396e23a93efaba22e95b710205c6b04625e1529cf588731bf4c591577f7a3e3a1a517acfab1ef2ad42b3f2f2aa9b60eadd01a963e0cc3c0de0731307ab3ac938ce76bf119df5d73762b94414e2f977610577ca35de95bd628c88e3ffbbd8f0929ea5c1eab0fada0d7fbadf439a818de9aac18597f2d29964c6c03db2f9d1792931d6963da13fdf8018bd5a42524b6701a440125a1635386b01721124436b27c9fb1d0775ddb4d9dc8f394bc6d0c124d3e14422a1904968a7b4816215ed3e435653f74788dd4a7c9a2206b2677b8d0a74665a29209b65a86101dd1901f4f2e681cf0facbf787e4e5d9fd59fc6b08db515a6145f9cd4b506061d7717c8cc9a0de36791cc752e4b0cda58f25f5724445659be230dd8dea550911475956dc327a7227c101384661fcabc5c593f9ec74cbc478f269fe5eadec66f5fee3e936c940f28bfecd6d5617b32bb5f2bad5624bfe7832bb3856ab40314baf6e74f1687ebc39d7a251bb5a9c6bf5ad35d78b995eb6e65cdd6825a8b5e77871ad97ad41ef8ecef4b2b5e87236d7cbd6a4b3937ff4b2b5e9f8b2d92a68f57e06bd0f633db7e03f9b426cd96e6f126ad0e8dab1cc8a04670b862bb2da86d2582d792e24ce7637ee6d235df7b481b294bc55ac41afe021ad18e325568f45b5ecef937a1f9ed38efe1e70b7e6f42da61b9ebf22f9db1a7e10eaa12d6ce2d5ff55d56529b4e205231593c87634d2eb43ce9feb3bc60c5288830cb28dad5f091f51311c1f25d8b6f9471b8c0558493fb6611b76054f4db5eba6addfa6a39ca6de1a4b598dd35a2c0fd9697e1f90fdc1f2a666d85dc900064054a0254dbb1d2030ca8e69934fc6eab6c13c3baae58a8d9d5414e0d05823e395f069556cba220d2d53fed53686ad1f7bd1dbf600cefbe3d3cbdbb5fc13fdbd621723906d81b755e5718dfe54a297ec7b0d9689c3fa6d8cb002411ed41597f7a322dc003a5e2957a8ff4c7fcb15bbddee5947fafdef4878c93be2a08e38cf6ff630f42e8f14dceeb44fb83efee412d8961336ec6765d16d51d105cef404e28383528a2c2f24d84a129c467e40ad10852ea3b6cd984d42eaf98107bf92089e228252db09e02f85f19da6fd6eaa9880095f1c89635ced9416a3bc6042f02257436c51cba6253683ac318e824b768e731d2f7030cbfb4771257eb562cd4c851cc51ac92a8eb3d74956b3fe02dccc92d7d009c0c62e851ccb9aa2d0f21c64a181131f7c24d0ac86363006fab9f3a891534af894677264ab684e894b56ef1f5f8dbe50f24d433f400c4ce2f0d84c18f0be8ee7f8be1a795c23a83ba67cdc806d8745d2f8320926ebbafcb6da99fa49845c3b0ac324a211c28e2274e83861905a5ee49000239be1d4c376bf97d85d0935707f633742294e08248b150528f1121b411e3976e0fbd8713d0b0784fa76d2dfe05652964f8aa5d1f95059f61b9cd55b901bf14b68b9928d2ec80de8e901da18aa06d0f5084f4fabe60b80768e52cde8aad0d11d6e940d8316b8b508dca3e7b3fe12c47252dd9772d15496edcdc4d039f7b4ce323de41c1138678a2de78c633486960fa32827072c758df5608b8069a1382f963c3f24f8307456a8ea3feac24988e2b93b1af35dd023e0e08ac69caeadf34eee4a5e3d4957a3a23d547781812cc70f2d28fe0fff0152be6bea', $data[0]->value); + } + + /** + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + */ + public function testGetByParam() + { + $result = self::$repository->getByParam('config_backup_date'); + $this->assertEquals(1, $result->getNumRows()); + + $resultData = $result->getData(); + + $this->assertEquals('config_backup_date', $resultData->parameter); + $this->assertEquals('1531353681', $resultData->value); + + $result = self::$repository->getByParam('test'); + $this->assertEquals(0, $result->getNumRows()); + } + + /** + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + */ + public function testDeleteByParam() + { + $this->assertEquals(1, self::$repository->deleteByParam('tempmaster_passtime')); + $this->assertEquals(0, self::$repository->deleteByParam('test')); + } +} diff --git a/tests/Services/Account/AccountServiceTest.php b/tests/Services/Account/AccountServiceTest.php index eb18aae7..54918131 100644 --- a/tests/Services/Account/AccountServiceTest.php +++ b/tests/Services/Account/AccountServiceTest.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link https://syspass.org + * @author nuxsmin + * @link https://syspass.org * @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. @@ -243,10 +243,7 @@ class AccountServiceTest extends DatabaseTestCase } /** - * @throws \SP\Core\Exceptions\ConstraintException - * @throws \SP\Core\Exceptions\QueryException - * @throws \SP\Services\Config\ParameterNotFoundException - * @throws \SP\Services\ServiceException + * @throws \Exception */ public function testEditRestore() { diff --git a/tests/Services/Config/ConfigBackupServiceTest.php b/tests/Services/Config/ConfigBackupServiceTest.php new file mode 100644 index 00000000..7885c00b --- /dev/null +++ b/tests/Services/Config/ConfigBackupServiceTest.php @@ -0,0 +1,88 @@ +. + */ + +namespace SP\Tests\Services\Config; + +use PHPUnit\Framework\TestCase; +use SP\Config\Config; +use SP\Config\ConfigData; +use SP\Services\Config\ConfigBackupService; +use function SP\Tests\setupContext; + +/** + * Class ConfigBackupServiceTest + * + * @package SP\Tests\Services\Config + */ +class ConfigBackupServiceTest extends TestCase +{ + + /** + * @throws \DI\DependencyException + * @throws \DI\NotFoundException + * @throws \SP\Core\Context\ContextException + */ + public function testBackup() + { + $dic = setupContext(); + + $configData = new ConfigData(); + $configData->setConfigVersion(uniqid()); + + $service = $dic->get(ConfigBackupService::class); + $service->backup($configData); + + $this->assertTrue(true); + + return $configData; + } + + /** + * @depends testBackup + * + * @param ConfigData $configData + * + * @throws \DI\DependencyException + * @throws \DI\NotFoundException + * @throws \SP\Core\Context\ContextException + * @throws \SP\Core\Exceptions\ConfigException + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + * @throws \SP\Services\ServiceException + * @throws \SP\Storage\FileException + */ + public function testRestore(ConfigData $configData) + { + $dic = setupContext(); + + $service = $dic->get(ConfigBackupService::class); + $data = $service->restore(); + + $this->assertEquals($configData->getConfigVersion(), $data->getConfigVersion()); + + $config = $dic->get(Config::class); + $this->assertEquals($data->getConfigHash(), $config->loadConfigFromFile()->getConfigHash()); + + } +} diff --git a/tests/Services/Config/ConfigServiceTest.php b/tests/Services/Config/ConfigServiceTest.php new file mode 100644 index 00000000..8c9bb779 --- /dev/null +++ b/tests/Services/Config/ConfigServiceTest.php @@ -0,0 +1,151 @@ +. + */ + +namespace SP\Tests\Services\Config; + +use SP\DataModel\ConfigData; +use SP\DataModel\Dto\ConfigRequest; +use SP\Repositories\NoSuchItemException; +use SP\Services\Config\ConfigService; +use SP\Storage\Database\DatabaseConnectionData; +use SP\Tests\DatabaseTestCase; +use function SP\Tests\setupContext; + +/** + * Class ConfigServiceTest + * + * @package SP\Tests\Services\Config + */ +class ConfigServiceTest extends DatabaseTestCase +{ + /** + * @var ConfigService + */ + private static $service; + + /** + * @throws \DI\NotFoundException + * @throws \SP\Core\Context\ContextException + * @throws \DI\DependencyException + */ + public static function setUpBeforeClass() + { + $dic = setupContext(); + + self::$dataset = 'syspass_config.xml'; + + // Datos de conexión a la BBDD + self::$databaseConnectionData = $dic->get(DatabaseConnectionData::class); + + // Inicializar el repositorio + self::$service = $dic->get(ConfigService::class); + + } + + /** + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + */ + public function testGetAll() + { + $data = self::$service->getAll(); + + $this->assertCount($this->conn->getRowCount('Config'), $data); + + $this->assertEquals('config_backup', $data[0]->parameter); + $this->assertEquals('789ca558db6edb3810edb718c5be6c6b88ba4b45814de3a497a48d374e832cb0404191944d589654916a9216f9f71d5292633ba1a4621f628bf11cce68e6cc85bc886d2b9e2ce6ff1e1779ca97edd70c4b3c89c328fe2562c78e272f9e13785197cb0a5376c6ee276f440cdba82f273089d3625ddff2353fc97192313a79c3634b019c21c0d72afb2d0520ff0e0bb68b7107318255bf059863217601d110e00bde305162b2675768426514973396e23a93efaba22e95b710205c6b04625e1529cf588731bf4c591577f7a3e3a1a517acfab1ef2ad42b3f2f2aa9b60eadd01a963e0cc3c0de0731307ab3ac938ce76bf119df5d73762b94414e2f977610577ca35de95bd628c88e3ffbbd8f0929ea5c1eab0fada0d7fbadf439a818de9aac18597f2d29964c6c03db2f9d1792931d6963da13fdf8018bd5a42524b6701a440125a1635386b01721124436b27c9fb1d0775ddb4d9dc8f394bc6d0c124d3e14422a1904968a7b4816215ed3e435653f74788dd4a7c9a2206b2677b8d0a74665a29209b65a86101dd1901f4f2e681cf0facbf787e4e5d9fd59fc6b08db515a6145f9cd4b506061d7717c8cc9a0de36791cc752e4b0cda58f25f5724445659be230dd8dea550911475956dc327a7227c101384661fcabc5c593f9ec74cbc478f269fe5eadec66f5fee3e936c940f28bfecd6d5617b32bb5f2bad5624bfe7832bb3856ab40314baf6e74f1687ebc39d7a251bb5a9c6bf5ad35d78b995eb6e65cdd6825a8b5e77871ad97ad41ef8ecef4b2b5e87236d7cbd6a4b3937ff4b2b5e9f8b2d92a68f57e06bd0f633db7e03f9b426cd96e6f126ad0e8dab1cc8a04670b862bb2da86d2582d792e24ce7637ee6d235df7b481b294bc55ac41afe021ad18e325568f45b5ecef937a1f9ed38efe1e70b7e6f42da61b9ebf22f9db1a7e10eaa12d6ce2d5ff55d56529b4e205231593c87634d2eb43ce9feb3bc60c5288830cb28dad5f091f51311c1f25d8b6f9471b8c0558493fb6611b76054f4db5eba6addfa6a39ca6de1a4b598dd35a2c0fd9697e1f90fdc1f2a666d85dc900064054a0254dbb1d2030ca8e69934fc6eab6c13c3baae58a8d9d5414e0d05823e395f069556cba220d2d53fed53686ad1f7bd1dbf600cefbe3d3cbdbb5fc13fdbd621723906d81b755e5718dfe54a297ec7b0d9689c3fa6d8cb002411ed41597f7a322dc003a5e2957a8ff4c7fcb15bbddee5947fafdef4878c93be2a08e38cf6ff630f42e8f14dceeb44fb83efee412d8961336ec6765d16d51d105cef404e28383528a2c2f24d84a129c467e40ad10852ea3b6cd984d42eaf98107bf92089e228252db09e02f85f19da6fd6eaa9880095f1c89635ced9416a3bc6042f02257436c51cba6253683ac318e824b768e731d2f7030cbfb4771257eb562cd4c851cc51ac92a8eb3d74956b3fe02dccc92d7d009c0c62e851ccb9aa2d0f21c64a181131f7c24d0ac86363006fab9f3a891534af894677264ab684e894b56ef1f5f8dbe50f24d433f400c4ce2f0d84c18f0be8ee7f8be1a795c23a83ba67cdc806d8745d2f8320926ebbafcb6da99fa49845c3b0ac324a211c28e2274e83861905a5ee49000239be1d4c376bf97d85d0935707f633742294e08248b150528f1121b411e3976e0fbd8713d0b0784fa76d2dfe05652964f8aa5d1f95059f61b9cd55b901bf14b68b9928d2ec80de8e901da18aa06d0f5084f4fabe60b80768e52cde8aad0d11d6e940d8316b8b508dca3e7b3fe12c47252dd9772d15496edcdc4d039f7b4ce323de41c1138678a2de78c633486960fa32827072c758df5608b8069a1382f963c3f24f8307456a8ea3feac24988e2b93b1af35dd023e0e08ac69caeadf34eee4a5e3d4957a3a23d547781812cc70f2d28fe0fff0152be6bea', $data[0]->value); + } + + /** + * @throws NoSuchItemException + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + */ + public function testDeleteByParam() + { + self::$service->deleteByParam('tempmaster_passtime'); + + $this->expectException(NoSuchItemException::class); + + self::$service->deleteByParam('test'); + } + + /** + * @throws \SP\Services\ServiceException + */ + public function testSaveBatch() + { + $request = new ConfigRequest(); + $request->add('tempmaster_attempts', 4); + $request->add('tempmaster_maxtime', time()); + $request->add('tempmaster_passtime', time()); + $request->add('test', uniqid()); + + self::$service->saveBatch($request); + + $this->assertTrue(true); + } + + /** + * @throws NoSuchItemException + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + * @throws \SP\Services\ServiceException + */ + public function testSave() + { + $data = uniqid(); + self::$service->save('test', $data); + + $this->assertEquals($data, self::$service->getByParam('test')); + } + + /** + * @throws NoSuchItemException + * @throws \SP\Core\Exceptions\ConstraintException + * @throws \SP\Core\Exceptions\QueryException + * @throws \SP\Services\ServiceException + */ + public function testCreate() + { + $data = new ConfigData('test', uniqid()); + + $this->assertEquals(1, self::$service->create($data)); + + $this->assertEquals($data->getValue(), self::$service->getByParam($data->getParameter())); + } + + /** + * @throws NoSuchItemException + * @throws \SP\Services\ServiceException + */ + public function testGetByParam() + { + $this->assertEquals('1531353681', self::$service->getByParam('config_backup_date')); + + $this->expectException(NoSuchItemException::class); + + self::$service->getByParam('test'); + } +} diff --git a/tests/res/datasets/syspass_config.xml b/tests/res/datasets/syspass_config.xml new file mode 100644 index 00000000..fa6cd73f --- /dev/null +++ b/tests/res/datasets/syspass_config.xml @@ -0,0 +1,51 @@ + + + + + + config_backup + 789ca558db6edb3810edb718c5be6c6b88ba4b45814de3a497a48d374e832cb0404191944d589654916a9216f9f71d5292633ba1a4621f628bf11cce68e6cc85bc886d2b9e2ce6ff1e1779ca97edd70c4b3c89c328fe2562c78e272f9e13785197cb0a5376c6ee276f440cdba82f273089d3625ddff2353fc97192313a79c3634b019c21c0d72afb2d0520ff0e0bb68b7107318255bf059863217601d110e00bde305162b2675768426514973396e23a93efaba22e95b710205c6b04625e1529cf588731bf4c591577f7a3e3a1a517acfab1ef2ad42b3f2f2aa9b60eadd01a963e0cc3c0de0731307ab3ac938ce76bf119df5d73762b94414e2f977610577ca35de95bd628c88e3ffbbd8f0929ea5c1eab0fada0d7fbadf439a818de9aac18597f2d29964c6c03db2f9d1792931d6963da13fdf8018bd5a42524b6701a440125a1635386b01721124436b27c9fb1d0775ddb4d9dc8f394bc6d0c124d3e14422a1904968a7b4816215ed3e435653f74788dd4a7c9a2206b2677b8d0a74665a29209b65a86101dd1901f4f2e681cf0facbf787e4e5d9fd59fc6b08db515a6145f9cd4b506061d7717c8cc9a0de36791cc752e4b0cda58f25f5724445659be230dd8dea550911475956dc327a7227c101384661fcabc5c593f9ec74cbc478f269fe5eadec66f5fee3e936c940f28bfecd6d5617b32bb5f2bad5624bfe7832bb3856ab40314baf6e74f1687ebc39d7a251bb5a9c6bf5ad35d78b995eb6e65cdd6825a8b5e77871ad97ad41ef8ecef4b2b5e87236d7cbd6a4b3937ff4b2b5e9f8b2d92a68f57e06bd0f633db7e03f9b426cd96e6f126ad0e8dab1cc8a04670b862bb2da86d2582d792e24ce7637ee6d235df7b481b294bc55ac41afe021ad18e325568f45b5ecef937a1f9ed38efe1e70b7e6f42da61b9ebf22f9db1a7e10eaa12d6ce2d5ff55d56529b4e205231593c87634d2eb43ce9feb3bc60c5288830cb28dad5f091f51311c1f25d8b6f9471b8c0558493fb6611b76054f4db5eba6addfa6a39ca6de1a4b598dd35a2c0fd9697e1f90fdc1f2a666d85dc900064054a0254dbb1d2030ca8e69934fc6eab6c13c3baae58a8d9d5414e0d05823e395f069556cba220d2d53fed53686ad1f7bd1dbf600cefbe3d3cbdbb5fc13fdbd621723906d81b755e5718dfe54a297ec7b0d9689c3fa6d8cb002411ed41597f7a322dc003a5e2957a8ff4c7fcb15bbddee5947fafdef4878c93be2a08e38cf6ff630f42e8f14dceeb44fb83efee412d8961336ec6765d16d51d105cef404e28383528a2c2f24d84a129c467e40ad10852ea3b6cd984d42eaf98107bf92089e228252db09e02f85f19da6fd6eaa9880095f1c89635ced9416a3bc6042f02257436c51cba6253683ac318e824b768e731d2f7030cbfb4771257eb562cd4c851cc51ac92a8eb3d74956b3fe02dccc92d7d009c0c62e851ccb9aa2d0f21c64a181131f7c24d0ac86363006fab9f3a891534af894677264ab684e894b56ef1f5f8dbe50f24d433f400c4ce2f0d84c18f0be8ee7f8be1a795c23a83ba67cdc806d8745d2f8320926ebbafcb6da99fa49845c3b0ac324a211c28e2274e83861905a5ee49000239be1d4c376bf97d85d0935707f633742294e08248b150528f1121b411e3976e0fbd8713d0b0784fa76d2dfe05652964f8aa5d1f95059f61b9cd55b901bf14b68b9928d2ec80de8e901da18aa06d0f5084f4fabe60b80768e52cde8aad0d11d6e940d8316b8b508dca3e7b3fe12c47252dd9772d15496edcdc4d039f7b4ce323de41c1138678a2de78c633486960fa32827072c758df5608b8069a1382f963c3f24f8307456a8ea3feac24988e2b93b1af35dd023e0e08ac69caeadf34eee4a5e3d4957a3a23d547781812cc70f2d28fe0fff0152be6bea + + + config_backup_date + 1531353681 + + + lastupdatempass + 1528236611 + + + masterPwd + $2y$10$xtsuN2PUvgSH/0mrfBlsbOActVgCjYcqDqC6L3T9QraNxZC4RXGYa + + + tempmaster_attempts + 0 + + + tempmaster_maxtime + 1531268994 + + + tempmaster_pass + def502004ade49f88af42e50363817fe90be2a5ebe3fc9a390510f2043ea23f231c5e3d31fbdd84ab93634b139a02ae1b005767317602ef093053ed8613bd7ca500c7398b4d600de088a9fa57ccff44480a263a0bb3a250f6430e62c004fbd + + + tempmaster_passhash + $2y$10$34Kc7lFqwVdjaPCBGLlAC.ZpCL//IaHCodDeEX/fcSPNiOxx.nvhm + + + tempmaster_passkey + def10000def50200b5b5061cc8abf3cfd7221c92833d0016e65d39c75ccae5410cbb2eaf55ff4c7de04de1754f38480e8f8eb305c552310468fea3d84752e649c867ca16b6ba078c2cc42fdbd0b2dfe1a362fc5cc20599326c9e194b24020b8bdad22940721c6f1e3c29e491057a8323aad9cd265962cca06499e2f59278322ed3f2f909553df0f13be17c2b1650bfbc81057b334caafca8c13d4811c7034737834bc1cad0e763c4bbc34b8af0baa47413971e9e553a8f9642a414d3e2245072b137448083823cf89130796c2ec7a5ecaa346538ed3cbb2112b6c1ca51d732ad8dada7b4a78eedc27748611f51b7edf763a4b21f0f4f5893b3b014f901269b0a + + + tempmaster_passtime + 1531265394 + + + version + 300.18053101 + + + +