Class: HTTPClient::ProxyBasicAuth

Inherits:
BasicAuth show all
Defined in:
lib/httpclient/auth.rb

Instance Attribute Summary

Attributes inherited from BasicAuth

#force_auth

Attributes inherited from AuthBase

#scheme

Instance Method Summary collapse

Methods inherited from BasicAuth

#initialize, #set?

Methods inherited from AuthBase

#initialize, #reset_challenge

Methods included from Util

#argument_to_hash, hash_find_value, #http?, #https?, #keyword_argument, try_require, uri_dirname, uri_part_of, urify, #warning

Constructor Details

This class inherits a constructor from HTTPClient::BasicAuth

Instance Method Details

#challenge(uri, param_str = nil) ⇒ Object

Challenge handler: remember URL for response.



321
322
323
324
325
326
# File 'lib/httpclient/auth.rb', line 321

def challenge(uri, param_str = nil)
  synchronize {
    @challenge['challenged'] = true
    true
  }
end

#get(req) ⇒ Object



313
314
315
316
317
318
# File 'lib/httpclient/auth.rb', line 313

def get(req)
  synchronize {
    return nil if !@force_auth and !@challenge['challenged']
    @cred
  }
end

#set(uri, user, passwd) ⇒ Object



307
308
309
310
311
# File 'lib/httpclient/auth.rb', line 307

def set(uri, user, passwd)
  synchronize do
    @cred = ["#{user}:#{passwd}"].pack('m').tr("\n", '')
  end
end