Permalink
Browse files

Some initial documentation for the main authentication classes

darcs-hash:20070403205822-5d7f7-c5f2783bf8dca06c81d357802525251baa4c9fe7.gz
  • Loading branch information...
tim committed Apr 3, 2007
1 parent d46031f commit 9191ff3106cd694ad95b40f1cc497d5939c9d9ab
Showing with 27 additions and 0 deletions.
  1. +4 −0 lib/rack/auth/abstract/handler.rb
  2. +7 −0 lib/rack/auth/basic.rb
  3. +8 −0 lib/rack/auth/digest/md5.rb
  4. +8 −0 lib/rack/auth/digest/nonce.rb
@@ -1,5 +1,9 @@
module Rack
module Auth
+ # Rack::Auth::AbstractHandler implements common authentication functionality.
+ #
+ # +realm+ should be set for all handlers.
+
class AbstractHandler
attr_accessor :realm
View
@@ -3,6 +3,13 @@
module Rack
module Auth
+ # Rack::Auth::Basic implements HTTP Basic Authentication, as per RFC 2617.
+ #
+ # Initialize with the [Rack] application that you want protecting,
+ # and a block that checks if a username and password pair are valid.
+ #
+ # See also: example/protectedlobster.rb
+
class Basic < AbstractHandler
def call(env)
@@ -7,6 +7,14 @@
module Rack
module Auth
module Digest
+ # Rack::Auth::Digest::MD5 implements the MD5 algorithm version of
+ # HTTP Digest Authentication, as per RFC 2617.
+ #
+ # Initialize with the [Rack] application that you want protecting,
+ # and a block that looks up a plaintext password for a given username.
+ #
+ # +opaque+ needs to be set to a constant base64/hexadecimal string.
+ #
class MD5 < AbstractHandler
attr_accessor :opaque
@@ -4,6 +4,14 @@
module Rack
module Auth
module Digest
+ # Rack::Auth::Digest::Nonce is the default nonce generator for the
+ # Rack::Auth::Digest::MD5 authentication handler.
+ #
+ # +private_key+ needs to set to a constant string.
+ #
+ # +time_limit+ can be optionally set to an integer (number of seconds),
+ # to limit the validity of the generated nonces.
+
class Nonce
class << self

0 comments on commit 9191ff3

Please sign in to comment.