Module: WEBrick::HTTPAuth::UserDB
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/webrick/httpauth/userdb.rb |
Overview
User database mixin for ::WEBrick::HTTPAuth
. This mixin dispatches user record access to the underlying auth_type for this database.
Instance Attribute Summary
-
#auth_type
rw
The authentication type.
Instance Method Summary
-
#get_passwd(realm, user, reload_db = false)
Retrieves a password in
realm
foruser
for the auth_type of this database. -
#make_passwd(realm, user, pass)
Creates an obscured password in
realm
withuser
andpassword
using the auth_type of this database. -
#set_passwd(realm, user, pass)
Sets a password in
realm
withuser
andpassword
for the auth_type of this database.
Instance Attribute Details
#auth_type (rw)
The authentication type.
BasicAuth
or DigestAuth
are built-in.
# File 'lib/webrick/httpauth/userdb.rb', line 26
attr_accessor :auth_type
Instance Method Details
#get_passwd(realm, user, reload_db = false)
Retrieves a password in realm
for user
for the auth_type of this database. reload_db
is a dummy value.
# File 'lib/webrick/httpauth/userdb.rb', line 48
def get_passwd(realm, user, reload_db=false) make_passwd(realm, user, self[user]) end
#make_passwd(realm, user, pass)
Creates an obscured password in realm
with user
and password
using the auth_type of this database.
# File 'lib/webrick/httpauth/userdb.rb', line 32
def make_passwd(realm, user, pass) @auth_type::make_passwd(realm, user, pass) end
#set_passwd(realm, user, pass)
Sets a password in realm
with user
and password
for the auth_type of this database.
# File 'lib/webrick/httpauth/userdb.rb', line 40
def set_passwd(realm, user, pass) self[user] = pass end