DmitryTsepelev / store_model

Work with JSON-backed attributes as ActiveRecord-ish models
MIT License
1.09k stars 89 forks source link

Encrypt attributes #115

Open 23tux opened 2 years ago

23tux commented 2 years ago

Rails provides with Rails::Secrets.encrypt("foo") a way to securely encrypt information. Rails 7 provides a nice interface to it via encrypts :my_attribute.

Is there some way, this could be used with StoreModel as well? Maybe also before upgrading to Rails 7?

DmitryTsepelev commented 2 years ago

Hi @23tux! I guess we can try to bring encrypts to the gem by including the right module 🙂 Before Rails 7 there was a lockbox which works with store_model out of the box.

OliverGilan commented 1 year ago

Any update on this? My desire would be to encrypt individual properties of a storemodel object and my understanding is that lockbox only allows you to encrypt db columns. So if I have one json db column called Configuration and I'm using StoreModel to represent that configuration then it would be awesome to encrypt just specific properties of that configuration

23tux commented 5 months ago

@OliverGilan I'm working on it and waiting for feedback from @DmitryTsepelev, see https://github.com/DmitryTsepelev/store_model/issues/60#issuecomment-2143844111