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
rack-2.0.9.4 lib/rack/auth/digest/request.rb
rack-2.0.9.3 lib/rack/auth/digest/request.rb
rack-2.0.9.2 lib/rack/auth/digest/request.rb
rack-2.0.9.1 lib/rack/auth/digest/request.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-2.0.5/lib/rack/auth/digest/request.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/rack-2.0.8/lib/rack/auth/digest/request.rb
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/auth/digest/request.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
rack-2.0.9 lib/rack/auth/digest/request.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/rack-2.0.8/lib/rack/auth/digest/request.rb
rack-2.0.8 lib/rack/auth/digest/request.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
tdiary-5.1.0 vendor/bundle/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/auth/digest/request.rb