Class: HTTPClient::ProxyDigestAuth
- Inherits:
-
DigestAuth
- Object
- AuthBase
- DigestAuth
- HTTPClient::ProxyDigestAuth
- Defined in:
- lib/httpclient/auth.rb
Overview
Authentication filter for handling DigestAuth negotiation. Ignores uri argument. Used in ProxyAuth.
Instance Attribute Summary
Attributes inherited from AuthBase
Instance Method Summary collapse
- #challenge(uri, param_str) ⇒ Object
-
#get(req) ⇒ Object
overrides DigestAuth#get.
- #reset_challenge ⇒ Object
-
#set(uri, user, passwd) ⇒ Object
overrides DigestAuth#set.
Methods inherited from DigestAuth
Methods inherited from AuthBase
Methods included from Util
#argument_to_hash, hash_find_value, #http?, #https?, #keyword_argument, try_require, uri_dirname, uri_part_of, urify, #warning
Constructor Details
This class inherits a constructor from HTTPClient::DigestAuth
Instance Method Details
#challenge(uri, param_str) ⇒ Object
487 488 489 490 491 492 |
# File 'lib/httpclient/auth.rb', line 487 def challenge(uri, param_str) synchronize { @challenge = parse_challenge_param(param_str) true } end |
#get(req) ⇒ Object
overrides DigestAuth#get. Uses default user name and password regardless of target uri if the proxy has required authentication before
471 472 473 474 475 476 477 478 479 |
# File 'lib/httpclient/auth.rb', line 471 def get(req) synchronize { param = @challenge return nil unless param user, passwd = @auth return nil unless user calc_cred(req, user, passwd, param) } end |
#reset_challenge ⇒ Object
481 482 483 484 485 |
# File 'lib/httpclient/auth.rb', line 481 def reset_challenge synchronize do @challenge = nil end end |
#set(uri, user, passwd) ⇒ Object
overrides DigestAuth#set. sets default user name and password. uri is not used.
462 463 464 465 466 |
# File 'lib/httpclient/auth.rb', line 462 def set(uri, user, passwd) synchronize do @auth = [user, passwd] end end |