diff options
author | Hongli Lai (Phusion <hongli@phusion.nl> | 2008-08-27 12:42:08 +0200 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-08-27 15:08:16 +0200 |
commit | b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5 (patch) | |
tree | c0bacd1a0ffa73149ce3eb81b5ef6a345093147d /railties/lib/tasks/misc.rake | |
parent | 9dbde4f5cbd0617ee6cce3e41d41335f9c9ce3fd (diff) | |
download | rails-b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5.tar.gz rails-b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5.tar.bz2 rails-b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5.zip |
Deprecate Rails::SecretKeyGenerator in favor of ActiveSupport::SecureRandom.
SecureRandom has a few minor security enhancements and can be used as a drop-in replacement
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#913 state:committed]
Diffstat (limited to 'railties/lib/tasks/misc.rake')
-rw-r--r-- | railties/lib/tasks/misc.rake | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/railties/lib/tasks/misc.rake b/railties/lib/tasks/misc.rake index 33bbba1101..5c99725203 100644 --- a/railties/lib/tasks/misc.rake +++ b/railties/lib/tasks/misc.rake @@ -3,10 +3,9 @@ task :environment do require(File.join(RAILS_ROOT, 'config', 'environment')) end -require 'rails_generator/secret_key_generator' -desc 'Generate a crytographically secure secret key. This is typically used to generate a secret for cookie sessions. Pass a unique identifier to the generator using ID="some unique identifier" for greater security.' +desc 'Generate a crytographically secure secret key. This is typically used to generate a secret for cookie sessions.' task :secret do - puts Rails::SecretKeyGenerator.new(ENV['ID']).generate_secret + puts ActiveSupport::SecureRandom.hex(64) end require 'active_support' @@ -54,4 +53,4 @@ namespace :time do puts "\n" end end -end
\ No newline at end of file +end |