Class: HTTPX::Plugins::Authentication::Digest
- Inherits:
-
Object
- Object
- HTTPX::Plugins::Authentication::Digest
- Defined in:
- lib/httpx/plugins/authentication/digest.rb
Instance Method Summary collapse
- #authenticate(request, authenticate) ⇒ Object
- #can_authenticate?(authenticate) ⇒ Boolean
-
#initialize(user, password) ⇒ Digest
constructor
A new instance of Digest.
Constructor Details
#initialize(user, password) ⇒ Digest
Returns a new instance of Digest.
13 14 15 16 17 |
# File 'lib/httpx/plugins/authentication/digest.rb', line 13 def initialize(user, password, **) @user = user @password = password @nonce = 0 end |
Instance Method Details
#authenticate(request, authenticate) ⇒ Object
23 24 25 |
# File 'lib/httpx/plugins/authentication/digest.rb', line 23 def authenticate(request, authenticate) "Digest #{generate_header(request.verb, request.path, authenticate)}" end |
#can_authenticate?(authenticate) ⇒ Boolean
19 20 21 |
# File 'lib/httpx/plugins/authentication/digest.rb', line 19 def can_authenticate?(authenticate) authenticate && /Digest .*/.match?(authenticate) end |