Repository navigation
Releases: katafrakt/rom-encrypted_attribute
Releases · katafrakt/rom-encrypted_attribute
Release list
0.0.5
- Support for
nil/NULLvalues in encrypted columns. - New
support_unencrypted_dataoption, defaulting to false. If the database, for whatever reason, contains plaintext values, starting from this version it will result in an exception. However, if you want to support this behaviour, most likely due to legacy database, you can opt in to reading the plaintext values too.
NOTE: this requires a monkey patch for non-PostgreSQL databases. It's because of a bug in rom-sql. You have to "install" this monkey patch directly, using:
require "rom/encrypted_attribute/rom_sql_patch"
ROM::SQL::Patch432.install!Then you can use the option for example in a ROM plugin:
class SecretNotes < ::ROM::Relation[:sql]
schema(:secret_notes, infer: true) do
use :encrypted_attributes
encrypt :content, support_unencrypted_data: true
end
end0.0.4
- Add ROM plugin support
class SecretNotes < ::ROM::Relation[:sql]
schema(:secret_notes, infer: true) do
use :encrypted_attributes
encrypt :content
end
end- Add global configuration which supports ROM plugin
ROM::EncryptedAttribute.configure do |config|
config.primary_key = "your-primary-key" # required
config.key_derivation_salt = "your-derivation-salt" # required
config.hash_digest_class = OpenSSL::Digest::SHA256 # SHA1 by default
end