Sha256: 3676325aeb9ebb998818180b87e95caca4da7ae947a8f3f2ce80bdba0f5ad92f

Contents?: true

Size: 952 Bytes

Versions: 55

Compression:

Stored size: 952 Bytes

Contents

require 'rack/auth/abstract/request'
require 'rack/auth/digest/params'
require 'rack/auth/digest/nonce'

module Rack
  module Auth
    module Digest
      class Request < Auth::AbstractRequest
        def method
          @env[RACK_METHODOVERRIDE_ORIGINAL_METHOD] || @env[REQUEST_METHOD]
        end

        def digest?
          "digest" == scheme
        end

        def correct_uri?
          request.fullpath == uri
        end

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

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

        def respond_to?(sym, *)
          super or params.has_key? sym.to_s
        end

        def method_missing(sym, *args)
          return super unless params.has_key?(key = sym.to_s)
          return params[key] if args.size == 0
          raise ArgumentError, "wrong number of arguments (#{args.size} for 0)"
        end
      end
    end
  end
end

Version data entries

55 entries across 53 versions & 14 rubygems

Version Path
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
spiral_form-0.1.1 vendor/bundle/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
spiral_form-0.1.0 vendor/bundle/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
tdiary-5.0.13 vendor/bundle/gems/rack-2.0.6/lib/rack/auth/digest/request.rb
rack-2.0.7 lib/rack/auth/digest/request.rb
tdiary-5.0.12.1 vendor/bundle/gems/rack-2.0.6/lib/rack/auth/digest/request.rb
tdiary-5.0.11 vendor/bundle/gems/rack-2.0.5/lib/rack/auth/digest/request.rb
tdiary-5.0.11 vendor/bundle/gems/rack-2.0.6/lib/rack/auth/digest/request.rb
rack-2.0.6 lib/rack/auth/digest/request.rb
sprokovuln-0.2.0 vendor/ruby/gems/rack-2.0.5/lib/rack/auth/digest/request.rb
tdiary-5.0.9 vendor/bundle/gems/rack-2.0.5/lib/rack/auth/digest/request.rb
rack-2.0.5 lib/rack/auth/digest/request.rb
tdiary-5.0.8 vendor/bundle/gems/rack-2.0.4/lib/rack/auth/digest/request.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/rack-2.0.4/lib/rack/auth/digest/request.rb
rack-2.0.4 lib/rack/auth/digest/request.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/rack-2.0.3/lib/rack/auth/digest/request.rb