-
Notifications
You must be signed in to change notification settings - Fork 17
Added re-encryption functionality for env.php #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added re-encryption functionality for env.php #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello
Thank you for your PR.
So this implementation would attempt to fix up the env.php at this point in the process
I think the sequencing of this may need a bit of tweaking, possibly do this custom handling after the changeEncryptionKey function has successfully completed?
It would not be ideal for an error in _reEncryptCreditCardNumbers to cause a database rollback, including preventing updating the crypt/key in env.php at this point. As with this change in place in its current form we would have moved along all the other encrypted data in env.php but they will no longer have a corresponding key.
Perhaps we can follow the same (ugly) pattern as the rest of the functions in this class and extend changeEncryptionKey and then inject our additional custom handling afterwards? Or alternatively make it part of the console command itself 🤔
convenient
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see above comment, I just realised I left it as a comment and not a "request changes" sorry.
|
Hi @convenient, Thank you for your feedback. I already tried this, but was getting some strange issue. Probably because I was changing the I am also not happy with adding a |
|
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 #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 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 |
…nfig Added re-encryption functionality for env.php (#30 plus test)
|
Thank you for your contribution |
Description
This PR adds functionality to re-encrypt values in the
env.phpconfiguration file.Issue
Fixes #12