Module WEBrick::HTTPAuth
In: lib/webrick/httpauth.rb
lib/webrick/httpauth/userdb.rb
lib/webrick/httpauth/basicauth.rb
lib/webrick/httpauth/htpasswd.rb
lib/webrick/httpauth/htgroup.rb
lib/webrick/httpauth/htdigest.rb
lib/webrick/httpauth/authenticator.rb
lib/webrick/httpauth/digestauth.rb

Methods

Classes and Modules

Module WEBrick::HTTPAuth::Authenticator
Module WEBrick::HTTPAuth::ProxyAuthenticator
Module WEBrick::HTTPAuth::UserDB
Class WEBrick::HTTPAuth::BasicAuth
Class WEBrick::HTTPAuth::DigestAuth
Class WEBrick::HTTPAuth::Htdigest
Class WEBrick::HTTPAuth::Htgroup
Class WEBrick::HTTPAuth::Htpasswd
Class WEBrick::HTTPAuth::ProxyBasicAuth
Class WEBrick::HTTPAuth::ProxyDigestAuth

Public Instance methods

[Source]

    # File lib/webrick/httpauth.rb, line 21
21:     def _basic_auth(req, res, realm, req_field, res_field, err_type, block)
22:       user = pass = nil
23:       if /^Basic\s+(.*)/o =~ req[req_field]
24:         userpass = $1
25:         user, pass = userpass.unpack("m*")[0].split(":", 2)
26:       end
27:       if block.call(user, pass)
28:         req.user = user
29:         return
30:       end
31:       res[res_field] = "Basic realm=\"#{realm}\""
32:       raise err_type
33:     end

[Source]

    # File lib/webrick/httpauth.rb, line 35
35:     def basic_auth(req, res, realm, &block)
36:       _basic_auth(req, res, realm, "Authorization", "WWW-Authenticate",
37:                   HTTPStatus::Unauthorized, block)
38:     end

[Source]

    # File lib/webrick/httpauth.rb, line 40
40:     def proxy_basic_auth(req, res, realm, &block)
41:       _basic_auth(req, res, realm, "Proxy-Authorization", "Proxy-Authenticate",
42:                   HTTPStatus::ProxyAuthenticationRequired, block)
43:     end

[Validate]