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.
# File lib/rack/auth/digest/nonce.rb, line 32 def digest ::Digest::MD5.hexdigest([ @timestamp, self.class.private_key ] * ':') end
# File lib/rack/auth/digest/nonce.rb, line 44 def fresh? !stale? end
# File lib/rack/auth/digest/nonce.rb, line 40 def stale? !self.class.time_limit.nil? && (@timestamp - Time.now.to_i) < self.class.time_limit end
Generated with the Darkfish Rdoc Generator 2.