8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/passage/environment.rb', line 8
def configure!(opts)
opts[:auth] ||= :pass_through
set :sessions, true
set :log, opts[:logger] || Logger.new(STDOUT)
if(opts[:ids_file])
ids = Identities.new YAML::load_file(opts[:ids_file] || ENV['PSG_IDS_FILE'] )
set :identities, ids
log.info "loaded #{ids.count} identities from #{opts[:ids_file]}"
else
set :identities, {}
log.info "no identities loaded (free for all)"
end
Dir.glob(File.expand_path("auth/**/*.rb", File.dirname(__FILE__))).each do |f|
require f
log.debug "discovered auth: #{File.basename(f)[0..-4]}"
end
register constantize(opts[:auth] || ENV['PSG_AUTH'])
log.info "loaded #{opts[:auth] || ENV['PSG_AUTH']} authentication"
end
|