Module: HTTPX::Plugins::DigestAuthentication

Defined in:
lib/httpx/plugins/digest_authentication.rb

Overview

This plugin adds helper methods to implement HTTP Digest Auth (tools.ietf.org/html/rfc7616)

gitlab.com/honeyryderchuck/httpx/wikis/Authentication#authentication

Defined Under Namespace

Modules: InstanceMethods Classes: Digest

Constant Summary collapse

DigestError =
Class.new(Error)

Class Method Summary collapse

Class Method Details

.extra_options(options) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/httpx/plugins/digest_authentication.rb', line 13

def self.extra_options(options)
  Class.new(options.class) do
    def_option(:digest) do |digest|
      raise Error, ":digest must be a Digest" unless digest.is_a?(Digest)

      digest
    end
  end.new(options)
end

.load_dependenciesObject



23
24
25
26
# File 'lib/httpx/plugins/digest_authentication.rb', line 23

def self.load_dependencies(*)
  require "securerandom"
  require "digest"
end