From 3b333ec2366b4814e18761f814feabc605301bc1 Mon Sep 17 00:00:00 2001 From: Ross Cooper Date: Tue, 5 Oct 2021 10:12:29 +0100 Subject: [PATCH 1/4] Added php 8 compatibility --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c463c326..40e1ff29 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "description": "Encrypted symfony entity's by verified and standardized libraries", "require": { - "php": "^7.2", + "php": "^7.2|^8.0", "paragonie/halite": "^4.6", "paragonie/sodium_compat": "^1.5", "doctrine/orm": "^2.5", From e299c0dffd2fe222fbeeb2c1beabaf1bcb377ede Mon Sep 17 00:00:00 2001 From: Ross Cooper Date: Tue, 5 Oct 2021 10:12:50 +0100 Subject: [PATCH 2/4] Updated console commands in docs --- src/Resources/doc/commands.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Resources/doc/commands.md b/src/Resources/doc/commands.md index 5a6b6590..c2c7fad7 100644 --- a/src/Resources/doc/commands.md +++ b/src/Resources/doc/commands.md @@ -7,7 +7,7 @@ To make your life a little easier we created some commands that you can use for You can use the comment `doctrine:encrypt:status` to get the current database and encryption information. ``` -$ php app/console doctrine:encrypt:status +$ php bin/console doctrine:encrypt:status ``` This command will return the amount of entities and the amount of properties with the @Encrypted tag for each entity. @@ -29,17 +29,17 @@ You can use the comment `doctrine:encrypt:database [encryptor]` to encrypt the c * Default: Your encryptor set in the configuration file or the default encryption class when not set in the configuration file ``` -$ php app/console doctrine:encrypt:database +$ php bin/console doctrine:encrypt:database ``` or you can provide an encryptor (optional). ``` -$ php app/console doctrine:encrypt:database Defuse +$ php bin/console doctrine:encrypt:database Defuse ``` ``` -$ php app/console doctrine:encrypt:database Halite +$ php bin/console doctrine:encrypt:database Halite ``` This command will return the amount of values encrypted in the database. @@ -58,17 +58,17 @@ You can use the comment `doctrine:decrypt:database [encryptor]` to decrypt the c * Default: Your encryptor set in the configuration file or the default encryption class when not set in the configuration file ``` -$ php app/console doctrine:decrypt:database +$ php bin/console doctrine:decrypt:database ``` or you can provide an encryptor (optional). ``` -$ php app/console doctrine:decrypt:database Defuse +$ php bin/console doctrine:decrypt:database Defuse ``` ``` -$ php app/console doctrine:decrypt:database Halite +$ php bin/console doctrine:decrypt:database Halite ``` This command will return the amount of entities and the amount of values decrypted in the database. From 0d2d8300a61017cdf14ebd5f3e9031e0d639a887 Mon Sep 17 00:00:00 2001 From: Ross Cooper Date: Tue, 5 Oct 2021 10:36:56 +0100 Subject: [PATCH 3/4] Fixed returns on console commands --- src/Command/DoctrineDecryptDatabaseCommand.php | 4 +++- src/Command/DoctrineEncryptDatabaseCommand.php | 3 ++- src/Command/DoctrineEncryptStatusCommand.php | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Command/DoctrineDecryptDatabaseCommand.php b/src/Command/DoctrineDecryptDatabaseCommand.php index c677111d..fa2fc731 100644 --- a/src/Command/DoctrineDecryptDatabaseCommand.php +++ b/src/Command/DoctrineDecryptDatabaseCommand.php @@ -82,7 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); if (!$question->ask($input, $output, $confirmationQuestion)) { - return 1; + return AbstractCommand::FAILURE; } // Start decrypting database @@ -146,5 +146,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $output->writeln('' . PHP_EOL . 'Decryption finished values found: ' . $valueCounter . ', decrypted: ' . $this->subscriber->decryptCounter . '.' . PHP_EOL . 'All values are now decrypted.'); + + return AbstractCommand::SUCCESS; } } diff --git a/src/Command/DoctrineEncryptDatabaseCommand.php b/src/Command/DoctrineEncryptDatabaseCommand.php index f5d371c8..a53794c3 100644 --- a/src/Command/DoctrineEncryptDatabaseCommand.php +++ b/src/Command/DoctrineEncryptDatabaseCommand.php @@ -69,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); if (!$question->ask($input, $output, $confirmationQuestion)) { - return 1; + return AbstractCommand::FAILURE; } // Start decrypting database @@ -104,4 +104,5 @@ protected function execute(InputInterface $input, OutputInterface $output) } + return AbstractCommand::SUCCESS; } diff --git a/src/Command/DoctrineEncryptStatusCommand.php b/src/Command/DoctrineEncryptStatusCommand.php index 37b826ac..be86ed90 100644 --- a/src/Command/DoctrineEncryptStatusCommand.php +++ b/src/Command/DoctrineEncryptStatusCommand.php @@ -53,5 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln(''); $output->writeln(sprintf('%d entities found which are containing %d encrypted properties.', count($metaDataArray), $totalCount)); + + return AbstractCommand::SUCCESS; } } From b7ef82fe56b49011132d18fa0d90766f364dd4fb Mon Sep 17 00:00:00 2001 From: Ross Cooper Date: Tue, 5 Oct 2021 10:39:18 +0100 Subject: [PATCH 4/4] Fixed return --- src/Command/DoctrineEncryptDatabaseCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Command/DoctrineEncryptDatabaseCommand.php b/src/Command/DoctrineEncryptDatabaseCommand.php index a53794c3..6a2b9846 100644 --- a/src/Command/DoctrineEncryptDatabaseCommand.php +++ b/src/Command/DoctrineEncryptDatabaseCommand.php @@ -101,8 +101,9 @@ protected function execute(InputInterface $input, OutputInterface $output) // Say it is finished $output->writeln('Encryption finished. Values encrypted: ' . $this->subscriber->encryptCounter . ' values.' . PHP_EOL . 'All values are now encrypted.'); + + return AbstractCommand::SUCCESS; } - return AbstractCommand::SUCCESS; }