Class: RHC::Rest::WWWAuth::DeferredBasic

Inherits:
HTTPClient::BasicAuth
  • Object
show all
Defined in:
lib/rhc/rest/httpclient.rb

Instance Method Summary collapse

Instance Method Details

#challenge(uri, param_str = nil) ⇒ Object



135
136
137
138
139
140
141
# File 'lib/rhc/rest/httpclient.rb', line 135

def challenge(uri, param_str = nil)
  return false if caller.any?{ |s| s =~ /webmock.*httpclient_adapter.*build_request_signature/ }
  uri = urify(uri)
  challenged = @challengeable[uri]
  @challengeable[uri] = true
  !challenged
end

#set(uri, user, passwd) ⇒ Object

Set authentication credential. uri == nil for generic purpose (allow to use user/password for any URL).



126
127
128
129
130
131
132
133
134
# File 'lib/rhc/rest/httpclient.rb', line 126

def set(uri, user, passwd)
  @set = true
  if uri.nil?
    @cred = DeferredCredential.new(user, passwd)
  else
    uri = uri_dirname(urify(uri))
    @auth[uri] = DeferredCredential.new(user, passwd)
  end
end