Loading lib/Command/Migrate2FASecrets.php +19 −22 Original line number Diff line number Diff line Loading @@ -3,10 +3,10 @@ declare(strict_types=1); namespace OCA\EcloudAccounts\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use OCA\TwoFactorTOTP\Db\TotpSecretMapper; use OCP\Security\ICrypto; Loading @@ -14,7 +14,6 @@ use OCP\IDBConnection; use OCA\EcloudAccounts\Db\SSOMapper; class Migrate2FASecrets extends Command { private TotpSecretMapper $totpSecretMapper; private SSOMapper $SSOMapper; private IDBConnection $dbConn; Loading Loading @@ -70,14 +69,13 @@ class Migrate2FASecrets extends Command { $entries[] = $this->getSSOSecretEntry($userId, $secret); } return $entries; } private function getSSOSecretEntry(string $userId, string $secret) : array { $SSOUserId = $this->SSOMapper->getUserId($userId); $credentialEntry = [ 'ID' => $this->randomUUID(), 'SALT' => NULL, 'SALT' => null, 'USER_ID' => $SSOUserId, 'USER_LABEL' => 'Murena Cloud 2FA', 'SECRET_DATA' => [ Loading Loading @@ -113,5 +111,4 @@ class Migrate2FASecrets extends Command { // Output the 36 character UUID. return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); } } lib/Db/SSOMapper.php +10 −12 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use OCP\IConfig; use OCP\ILogger; use OCA\EcloudAccounts\Exception\DbConnectionParamsException; use Doctrine\DBAL\DriverManager; use Throwable; class SSOMapper { private $config; Loading Loading @@ -68,6 +67,5 @@ class SSOMapper { } public function insertCredentials(array $entries) { } } Loading
lib/Command/Migrate2FASecrets.php +19 −22 Original line number Diff line number Diff line Loading @@ -3,10 +3,10 @@ declare(strict_types=1); namespace OCA\EcloudAccounts\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use OCA\TwoFactorTOTP\Db\TotpSecretMapper; use OCP\Security\ICrypto; Loading @@ -14,7 +14,6 @@ use OCP\IDBConnection; use OCA\EcloudAccounts\Db\SSOMapper; class Migrate2FASecrets extends Command { private TotpSecretMapper $totpSecretMapper; private SSOMapper $SSOMapper; private IDBConnection $dbConn; Loading Loading @@ -70,14 +69,13 @@ class Migrate2FASecrets extends Command { $entries[] = $this->getSSOSecretEntry($userId, $secret); } return $entries; } private function getSSOSecretEntry(string $userId, string $secret) : array { $SSOUserId = $this->SSOMapper->getUserId($userId); $credentialEntry = [ 'ID' => $this->randomUUID(), 'SALT' => NULL, 'SALT' => null, 'USER_ID' => $SSOUserId, 'USER_LABEL' => 'Murena Cloud 2FA', 'SECRET_DATA' => [ Loading Loading @@ -113,5 +111,4 @@ class Migrate2FASecrets extends Command { // Output the 36 character UUID. return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); } }
lib/Db/SSOMapper.php +10 −12 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use OCP\IConfig; use OCP\ILogger; use OCA\EcloudAccounts\Exception\DbConnectionParamsException; use Doctrine\DBAL\DriverManager; use Throwable; class SSOMapper { private $config; Loading Loading @@ -68,6 +67,5 @@ class SSOMapper { } public function insertCredentials(array $entries) { } }