Class: Desviar::Authorized

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/desviar.rb

Class Method Summary collapse

Class Method Details

.newObject



158
159
160
161
162
163
164
165
166
167
# File 'lib/desviar.rb', line 158

def self.new(*)
  #   TODO: htpasswd parsing
  #   Desviar::Auth::authenticate!
  app = Rack::Auth::Digest::MD5.new(super) do |username|
    {$config[:adminuser] => $config[:adminpw]}[username]
  end
  app.realm  = $config[:authprompt]
  app.opaque = $config[:authsalt]
  app
end