absolute-quantum / DoctrineEncryptBundle

:key: Encrypted symfony entities by verified and standardized libraries
https://packagist.org/packages/michaeldegroot/doctrine-encrypt-bundle
MIT License
143 stars 74 forks source link

Issue with Custom Encryptor #54

Open cs-akash-jarad opened 3 years ago

cs-akash-jarad commented 3 years ago

currently, the key mapping process is considered using Halite and Defuse only if i give a custom call path for my Encrypter class then it expected the key to be at that path . eg : at line 37 in src/DependencyInjection/DoctrineEncryptExtension.php $config['encryptor_class_full'] = $config['encryptor_class']; and for mapping the key path below code is used $config['secret_directory_path'].'/.'.$config['encryptor_class'].'.key' issue is if i give my Encryptor calls Path as App\Encryptors\CustomEncryption and my secret_directory_path path as /opt/application/keypath/

the formation of the key will be expected /opt/application/keypath/App\Encryptors\CustomEncryption which is not the case.

my proposed solution is to add a new config param as "secret_key_name" if set then it will make the encryption key path accordingly.

PR: https://github.com/GiveMeAllYourCats/DoctrineEncryptBundle/pull/55