Sha256: e1a4ded134eb69319f96eab9286f2fe6e37d7372843a7260044088edddc187ea
Contents?: true
Size: 1008 Bytes
Versions: 5
Compression:
Stored size: 1008 Bytes
Contents
namespace :secret_service do desc 'Store a desired secret in the database' task :store => :environment do store = SecretService::Store.new puts "Enter source secret (as given in your source code; leave blank to auto-generate):" source_secret = STDIN.gets.chomp if source_secret == '' source_secret = store.generate_secret end puts "Enter secret:" final_secret = STDIN.gets.chomp store.set(source_secret, final_secret) puts "We're done!" puts puts "Retrieve this secret in your app using" puts " SecretService.secret(#{source_secret.inspect})" puts end desc 'Show a previously stored secret' task :show => :environment do store = SecretService::Store.new puts "Enter source secret (as given in your source code):" source_secret = STDIN.gets.chomp secret = store.get(source_secret, :only_existing => true) if secret puts "Secret: ", secret else puts "Secret not stored" end puts end end
Version data entries
5 entries across 5 versions & 1 rubygems