From 7440bf44baea53de950093ebf9ee4e8a3ed71066 Mon Sep 17 00:00:00 2001 From: Assain Date: Sat, 3 Jun 2017 01:21:10 +0530 Subject: set message_encryptor default cipher to aes-256-gcm - Introduce a method to select default cipher, and maintain backward compatibility --- activesupport/lib/active_support/railtie.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/lib/active_support/railtie.rb') diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb index 1b4ecf4d72..61d6e4aae3 100644 --- a/activesupport/lib/active_support/railtie.rb +++ b/activesupport/lib/active_support/railtie.rb @@ -7,6 +7,13 @@ module ActiveSupport config.eager_load_namespaces << ActiveSupport + initializer "active_support.set_authenticated_message_encryption" do |app| + if app.config.active_support.respond_to?(:use_authenticated_message_encryption) + ActiveSupport::MessageEncryptor.use_authenticated_message_encryption = + app.config.active_support.use_authenticated_message_encryption + end + end + initializer "active_support.reset_all_current_attributes_instances" do |app| app.reloader.before_class_unload { ActiveSupport::CurrentAttributes.clear_all } app.executor.to_run { ActiveSupport::CurrentAttributes.reset_all } -- cgit v1.2.3