Class: HTTPClient::ProxyBasicAuth

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

Instance Attribute Summary

Attributes inherited from BasicAuth

#scheme

Instance Method Summary collapse

Methods inherited from BasicAuth

#initialize, #reset_challenge, #set?

Methods included from Util

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

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.



297
298
299
300
301
302
# File 'lib/httpclient/auth.rb', line 297

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

#get(req) ⇒ Object



289
290
291
292
293
294
# File 'lib/httpclient/auth.rb', line 289

def get(req)
  synchronize {
    return nil unless @challenge['challenged']
    @cred
  }
end

#set(uri, user, passwd) ⇒ Object



283
284
285
286
287
# File 'lib/httpclient/auth.rb', line 283

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