Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Introduce (in /Users/jeremy/rails/git/trunk) to output a crytographic…
…ally secure secret key for use with cookie sessions. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8400 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
- Loading branch information
Showing
with
14 additions
and 1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,4 +1,12 @@ | ||
task :default => :test | ||
task :environment do | ||
require(File.join(RAILS_ROOT, 'config', 'environment')) | ||
end | ||
|
||
require 'rails_generator/secret_key_generator' | ||
namespace :generate do | ||
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.' | ||
task :secret do | ||
puts Rails::SecretKeyGenerator.new(ENV['ID']).generate_secret | ||
end | ||
end |