genecommerce / module-encryption-key-manager

Tooling to help generate and invalidate magento encryption keys
GNU Lesser General Public License v3.0
54 stars 14 forks source link

The CLI command for getting the reencrypted cloud keys #52

Closed AlexRapatij closed 1 month ago

AlexRapatij commented 1 month ago

As you know there is possibility to override Adobe Commerce configuration settings using environment variables. In some cases there is presented encoded variables. This CLI command has been created specially for those cases. The command DOES NOT rewrite values in cloud console, it just shows regenerated values which dev has to update manually there.

The CLI command

bin/magento gene:encryption-key-manager:get-cloud-keys

The CLI command option to show decrypted value show-decrypted

bin/magento gene:encryption-key-manager:get-cloud-keys --show-decrypted

Examples

No old encrypted env vars has been founded

$ bin/magento gene:encryption-key-manager:get-cloud-keys
There is no old encrypted environment variables found

There is some

$ bin/magento gene:encryption-key-manager:get-cloud-keys --show-decrypted
The CLI command doesn't rewrite values. You have to update them manually in cloud console!
Rows count: 2
##################################################################
Name: CONFIG__DEFAULT__SOME_KEY
Dectypted value: dectypted_value
Old Encrypted Value: 0:3:AAA1
New Encrypted Value: 1:3:BBB1
##################################################################
Name: CONFIG__DEFAULT__SOME_KEY_2
Dectypted value: dectypted_value_2
Old Encrypted Value: 0:3:AAA2
New Encrypted Value: 1:3:BBB2