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
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/request.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/request.rb
rack-2.2.6.2 lib/rack/auth/digest/request.rb
rack-2.2.6.1 lib/rack/auth/digest/request.rb
rack-2.2.6 lib/rack/auth/digest/request.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/request.rb
rack-2.2.5 lib/rack/auth/digest/request.rb
diy_rails-0.1.0 vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/digest/request.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/auth/digest/request.rb
rack-2.2.4 lib/rack/auth/digest/request.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/rack-2.2.3.1/lib/rack/auth/digest/request.rb
rack-2.2.3.1 lib/rack/auth/digest/request.rb
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/3.0.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/auth/digest/request.rb