/usr/lib/ruby/vendor_ruby/rack/test/mock_digest_request.rb is in ruby-rack-test 0.6.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | module Rack
module Test
class MockDigestRequest # :nodoc:
def initialize(params)
@params = params
end
def method_missing(sym)
if @params.has_key? k = sym.to_s
return @params[k]
end
super
end
def method
@params['method']
end
def response(password)
Rack::Auth::Digest::MD5.new(nil).send :digest, self, password
end
end
end
end
|