Sha256: 9ebb7c64fe54fa9fc5e7f24641558eb27335e075c4b29b2e3881dcb5b1fb2560

Contents?: true

Size: 969 Bytes

Versions: 64

Compression:

Stored size: 969 Bytes

Contents

# frozen_string_literal: true

require_relative '../abstract/request'
require_relative 'params'
require_relative '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

64 entries across 48 versions & 15 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/rack-2.2.10/lib/rack/auth/digest/request.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/rack-2.2.10/lib/rack/auth/digest/request.rb
rack-2.2.10 lib/rack/auth/digest/request.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rack-2.2.9/lib/rack/auth/digest/request.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rack-2.2.7/lib/rack/auth/digest/request.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rack-2.2.7/lib/rack/auth/digest/request.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rack-2.2.7/lib/rack/auth/digest/request.rb
rack-2.2.9 lib/rack/auth/digest/request.rb
rack-2.2.8.1 lib/rack/auth/digest/request.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rack-2.2.7/lib/rack/auth/digest/request.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rack-2.2.4/lib/rack/auth/digest/request.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb
rack-2.2.8 lib/rack/auth/digest/request.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rack-2.2.7/lib/rack/auth/digest/request.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rack-2.2.4/lib/rack/auth/digest/request.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/request.rb
rack-2.2.7 lib/rack/auth/digest/request.rb
rack-2.2.6.4 lib/rack/auth/digest/request.rb
rack-2.2.6.3 lib/rack/auth/digest/request.rb