Class: Rack::Client::Auth::Digest::Challenge
Instance Method Summary
collapse
#method_missing, #nonce, #params, #parts, #required?, #scheme, #unspecified?, #www_authenticate
Constructor Details
#initialize(request, response, realm, username, password) ⇒ Challenge
Returns a new instance of Challenge.
6
7
8
9
|
# File 'lib/rack/client/middleware/auth/digest/challenge.rb', line 6
def initialize(request, response, realm, username, password)
super(request, response)
@realm, @username, @password = realm, username, password
end
|
Instance Method Details
#A1 ⇒ Object
23
24
25
|
# File 'lib/rack/client/middleware/auth/digest/challenge.rb', line 23
def A1
H([ @username, @realm, @password ] * ':')
end
|
#A2 ⇒ Object
27
28
29
|
# File 'lib/rack/client/middleware/auth/digest/challenge.rb', line 27
def A2
H([ request_method, path ] * ':')
end
|
#cnonce ⇒ Object
15
16
17
|
# File 'lib/rack/client/middleware/auth/digest/challenge.rb', line 15
def cnonce
@cnonce ||= Rack::Auth::Digest::Nonce.new.to_s
end
|
#digest? ⇒ Boolean
11
12
13
|
# File 'lib/rack/client/middleware/auth/digest/challenge.rb', line 11
def digest?
:digest == scheme
end
|
#H(data) ⇒ Object
31
32
33
|
# File 'lib/rack/client/middleware/auth/digest/challenge.rb', line 31
def H(data)
::Digest::MD5.hexdigest(data)
end
|
#response(nc) ⇒ Object
19
20
21
|
# File 'lib/rack/client/middleware/auth/digest/challenge.rb', line 19
def response(nc)
H([ A1(), nonce, nc, cnonce, qop, A2() ] * ':')
end
|