aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webrick/httpauth/userdb.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-10 23:37:43 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-10 23:37:43 +0000
commit8c2a52937f3b71efa7bcb48e7b8b00bc6b616ab4 (patch)
tree757bcc2a71bbb2338e5ccc11a0f37e2424132e0c /lib/webrick/httpauth/userdb.rb
parent6626b0a2c567669cceebd3bfd0195b0ffd8c97c3 (diff)
downloadruby-8c2a52937f3b71efa7bcb48e7b8b00bc6b616ab4.tar.gz
* lib/webrick: Add documentation for WEBrick::HTTPAuth
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/httpauth/userdb.rb')
-rw-r--r--lib/webrick/httpauth/userdb.rb27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/webrick/httpauth/userdb.rb b/lib/webrick/httpauth/userdb.rb
index 95834f36e3..005c18dfd0 100644
--- a/lib/webrick/httpauth/userdb.rb
+++ b/lib/webrick/httpauth/userdb.rb
@@ -9,19 +9,42 @@
module WEBrick
module HTTPAuth
+
+ ##
+ # User database mixin for HTTPAuth. This mixin dispatches user record
+ # access to the underlying auth_type for this database.
+
module UserDB
- attr_accessor :auth_type # BasicAuth or DigestAuth
+
+ ##
+ # The authentication type.
+ #
+ # WEBrick::HTTPAuth::BasicAuth or WEBrick::HTTPAuth::DigestAuth are
+ # built-in.
+
+ attr_accessor :auth_type
+
+ ##
+ # Creates an obscured password in +realm+ with +user+ and +password+
+ # using the auth_type of this database.
def make_passwd(realm, user, pass)
@auth_type::make_passwd(realm, user, pass)
end
+ ##
+ # Sets a password in +realm+ with +user+ and +password+ for the
+ # auth_type of this database.
+
def set_passwd(realm, user, pass)
self[user] = pass
end
+ ##
+ # Retrieves a password in +realm+ for +user+ for the auth_type of this
+ # database. +reload_db+ is a dummy value.
+
def get_passwd(realm, user, reload_db=false)
- # reload_db is dummy
make_passwd(realm, user, self[user])
end
end