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

[IMP] Gene_EncryptionKeyManager: Add support for JSON fields (#27 plus test) #32

Closed convenient closed 1 month ago

convenient commented 1 month ago

This PR is https://github.com/genecommerce/module-encryption-key-manager/pull/27 with a test case added

Test case data

Generating a fake json column
id      text_column
1       {"user": "foobar", "password": "0:3:s5zntv9Zdeq0Iyn6mVv2IOWU9GutCIvbz/LpHPTWc/p2g25BpVDwaThRd344xg==", "request_url": ""}

Test case output

Running reencrypt-column on JSON column
The latest encryption key is number 1, looking for old entries
Looking for JSON field 'password.text_column' in 'fake_json_table', identified by 'id'
########################################################################################################################
id: 1
ciphertext_old: 0:3:s5zntv9Zdeq0Iyn6mVv2IOWU9GutCIvbz/LpHPTWc/p2g25BpVDwaThRd344xg==
plaintext: jsonpasswordabc123
ciphertext_new: 1:3:nMrDMSft3v9+o21NQcwbGgWryaPjkrwN4HRurQvy15I88tR90Wzhev3TxOQyGw==
########################################################################################################################
Done
PASS

Running reencrypt-column on JSON column - again to verify it was all processed
The latest encryption key is number 1, looking for old entries
Looking for JSON field 'password.text_column' in 'fake_json_table', identified by 'id'
No old entries found
PASS
jorgehs91 commented 1 month ago

Hi @convenient, any idea when the release with these changes will be available on packagist? I mean, v0.0.10-alpha.

convenient commented 1 month ago

@jorgehs91 I fixed the packagist webhook sync this morning so its there now, and will continue to be up to date going forward. thanks