Skip to content

Releases: katafrakt/rom-encrypted_attribute

0.0.5

Choose a tag to compare

@katafrakt katafrakt released this 09 Sep 19:55
63e5016
  • Support for nil/NULL values in encrypted columns.
  • New support_unencrypted_data option, 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
end

0.0.4

Choose a tag to compare

@katafrakt katafrakt released this 26 Oct 20:06
  • 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

0.0.3

Choose a tag to compare

@katafrakt katafrakt released this 03 Mar 20:05
e2e792f
  • Test against Ruby 3.3
  • Change default hash digest for key derivation to SHA1 (from SHA256) to match ActiveRecord's default
  • Add configuration option to change hash digest (hash_digest_class)