Closed davekleijn closed 1 month ago
Hi @convenient,
Thank you for your feedback. I already tried this, but was getting some strange issue. Probably because I was changing the env.php
multiple times and was manually changing the file during testing. Now it is working.
I am also not happy with adding a __construct
function, because it requires a lot of extra dependencies. It was needed for DeploymentConfig
. I see that the \Magento\EncryptionKey\Model\ResourceModel\Key\Change::changeEncryptionKey
method is public. Is it an idea to create an after plugin for this?
Hey @davekleijn
If a plugin achieved this then that's sensible 👍 would it be possible to make the plugin scoped only to our custom class to leave the vanilla Magento controller action untouched?
@davekleijn Or alternatively create a new service class who's whole responsibility is this functionality. Then you can inject that into the console command and call it in the same way you have done.
That way we can avoid fiddling too much more with the class we're extending?
That would have a nicer and more predictable callstack than a plugin
Hello @davekleijn
I've been testing your code in here https://github.com/genecommerce/module-encryption-key-manager/pull/31
Can you please have a look at that and let me know what you think?
Thanks
Hi @convenient,
Sorry, couldn't finish the code yesterday. The wrong version 0:3
was used for re-encryption, but I see that you have fixed it now.
Everything looks good I think.
Hey @davekleijn no worries. I spotted that issue pretty quick while scaffolding a test so just fixed it.
Have you had the chance to pull it down locally and verify it meets your expectations?
Hi @convenient
Yes, I also tested this with some real data from projects. It all looks good.
Thank you @davekleijn i'll get this merged and tagged soon
Thank you for your contribution
Description
This PR adds functionality to re-encrypt values in the
env.php
configuration file.Issue
Fixes #12