Class: Htpasswd::Auths::Basic

Inherits:
Base
  • Object
show all
Defined in:
lib/htpasswd/auths/basic.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

<=>, #authorize, #authorize_pass, #authorize_type, #authorize_user, #initialize, #pass, #random, #realm, #scheme, #set_controller, #user

Constructor Details

This class inherits a constructor from Htpasswd::Auths::Base

Class Method Details

.parse(data) ⇒ Object



5
6
7
8
# File 'lib/htpasswd/auths/basic.rb', line 5

def parse(data)
  user, pass = Base64.decode64(data.to_s).split(':', 2)
  new(:user=>user, :pass=>pass)
end

.strengthObject



10
11
12
# File 'lib/htpasswd/auths/basic.rb', line 10

def strength
  10
end

Instance Method Details

#server_headerObject



15
16
17
# File 'lib/htpasswd/auths/basic.rb', line 15

def server_header
  %Q|Basic realm="%s"| % realm
end