Class: Rack::Auth::Digest::Request

Inherits:
AbstractRequest show all
Defined in:
lib/rack/auth/digest/request.rb

Instance Method Summary collapse

Methods inherited from AbstractRequest

#initialize, #parts, #provided?, #scheme

Constructor Details

This class inherits a constructor from Rack::Auth::AbstractRequest

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym) ⇒ Object



30
31
32
33
34
35
# File 'lib/rack/auth/digest/request.rb', line 30

def method_missing(sym)
  if params.has_key? key = sym.to_s
    return params[key]
  end
  super
end

Instance Method Details

#correct_uri?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rack/auth/digest/request.rb', line 18

def correct_uri?
  (@env['SCRIPT_NAME'].to_s + @env['PATH_INFO'].to_s) == uri
end

#digest?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rack/auth/digest/request.rb', line 14

def digest?
  :digest == scheme
end

#methodObject



10
11
12
# File 'lib/rack/auth/digest/request.rb', line 10

def method
  @env['rack.methodoverride.original_method'] || @env['REQUEST_METHOD']
end

#nonceObject



22
23
24
# File 'lib/rack/auth/digest/request.rb', line 22

def nonce
  @nonce ||= Nonce.parse(params['nonce'])
end

#paramsObject



26
27
28
# File 'lib/rack/auth/digest/request.rb', line 26

def params
  @params ||= Params.parse(parts.last)
end