Class: Occi::Api::Client::Http::AuthnPlugins::Digest

Inherits:
Base
  • Object
show all
Defined in:
lib/occi/api/client/http/authn_plugins/digest.rb

Instance Attribute Summary

Attributes inherited from Base

#env_ref, #fallbacks, #options

Instance Method Summary collapse

Methods inherited from Base

#authenticate

Constructor Details

#initialize(env_ref, options = {}) ⇒ Digest


7
8
9
10
# File 'lib/occi/api/client/http/authn_plugins/digest.rb', line 7

def initialize(env_ref, options = {})
  super env_ref, options
  @fallbacks = %w(keystone)
end

Instance Method Details

#setup(options = {}) ⇒ Object

Raises:

  • (ArgumentError)

12
13
14
15
16
# File 'lib/occi/api/client/http/authn_plugins/digest.rb', line 12

def setup(options = {})
  # set up digest auth
  raise ArgumentError, "Missing required options 'username' and 'password' for digest auth!" unless @options[:username] and @options[:password]
  @env_ref.class.digest_auth @options[:username], @options[:password]
end