Skip to content

Commit ca0ff85

Browse files
Fix encryption difference with rails 8 (#3466)
* bookmark for problems on encryption * what if no encryption * harder compat * tidy
1 parent 1e84cdf commit ca0ff85

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

config/application.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,8 @@ class Application < Rails::Application
3737
config.active_record.encryption.primary_key = [ENV.fetch("ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY", "default_primary_key")]
3838
config.active_record.encryption.key_derivation_salt = ENV.fetch("ACTIVE_RECORD_KEY_DERIVATION_SALT", "default_salt")
3939
config.active_record.encryption.deterministic_key = [ENV.fetch("ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY", "default_deterministic_key")]
40+
# for backwards compatibility's sake
41+
config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256 # New data uses SHA256
42+
config.active_record.encryption.support_sha1_for_non_deterministic_encryption = true # Allows decryption of old SHA1 data
4043
end
4144
end

0 commit comments

Comments
 (0)