aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorLukasz Sarnacki <lukesarnacki@gmail.com>2014-01-10 12:57:50 +0100
committerLukasz Sarnacki <lukesarnacki@gmail.com>2014-01-29 17:05:00 +0100
commitb23ffd0dac895aa3fd3afd8d9be36794941731b2 (patch)
treea287df4bfcaff9c0838d3f4062a02fd1e5134b9f /activesupport/lib/active_support
parentf142527eb30626904cb1e655a1a28801f08b8acf (diff)
downloadrails-b23ffd0dac895aa3fd3afd8d9be36794941731b2.tar.gz
rails-b23ffd0dac895aa3fd3afd8d9be36794941731b2.tar.bz2
rails-b23ffd0dac895aa3fd3afd8d9be36794941731b2.zip
Allow session serializer key in config.session_store
MessageEncryptor has :serializer option, where any serializer object can be passed. This commit make it possible to set this serializer from configuration level. There are predefined serializers (:marshal_serializer, :json_serialzier) and custom serializer can be passed as String, Symbol (camelized and constantized in ActionDispatch::Session namepspace) or serializer object. Default :json_serializer was also added to generators to provide secure defalt.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/message_encryptor.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/message_encryptor.rb b/activesupport/lib/active_support/message_encryptor.rb
index 7773611e11..b019ad0dec 100644
--- a/activesupport/lib/active_support/message_encryptor.rb
+++ b/activesupport/lib/active_support/message_encryptor.rb
@@ -12,7 +12,7 @@ module ActiveSupport
# This can be used in situations similar to the <tt>MessageVerifier</tt>, but
# where you don't want users to be able to determine the value of the payload.
#
- # salt = SecureRandom.random_bytes(64)
+ # salt = SecureRandom.random_bytes(64)
# key = ActiveSupport::KeyGenerator.new('password').generate_key(salt) # => "\x89\xE0\x156\xAC..."
# crypt = ActiveSupport::MessageEncryptor.new(key) # => #<ActiveSupport::MessageEncryptor ...>
# encrypted_data = crypt.encrypt_and_sign('my secret data') # => "NlFBTTMwOUV5UlA1QlNEN2xkY2d6eThYWWh..."