madmatt / silverstripe-encrypt-at-rest

Encrypt data at rest in your database
7 stars 11 forks source link

Upgrade module for SilverStripe 4 #16

Closed jakxnz closed 3 years ago

jakxnz commented 6 years ago

Sadly this upgrade reduces the functionality of the module, because I was unable to establish an accessible way to decrypt database values on-fetch (before DataObject hydration).

It might be worth tagging the current version at 0.1.0 and tagging this version as 0.2.0.

madmatt commented 3 years ago

Hey @jakxnz, thanks so much for your contribution! I've actually just gone through this and ended up solving it a different way, by adding a hook into framework (see silverstripe/silverstripe-framework#10047) that allows us to hook into object hydration and decrypt the values whenever we extract them from the database. This way, things like $object = Page::get()->first()->EncryptedTextField just return the decrypted value and basically act as if they were never encrypted.

I'll close this PR, but if there's anything else that you'd like to still see in use, please let me know!

For reference, right now my work isn't merged into master, I'm running it on the pulls/TMP-ss4-upgrade branch, however once we've tested it a bit more internally I'll merge it into master and release a new major version of the module.

Thanks again for doing this, and sorry I didn't merge this sooner.