Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1869

Show
Ignore:
Timestamp:
07/01/07 00:40:30 (1 year ago)
Author:
nahi
Message:
  • added 'protocol.http.auth' option to set authentication information for both BasicAuth? and DigestAuth?. with the latest http-access2, now soap4r client can connect to DigestAuth? server. closes #345.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/httpconfigloader.rb

    r1824 r1869  
    4141      set_basic_auth(client, basic_auth) 
    4242    end 
     43    auth = options["auth"] ||= ::SOAP::Property.new 
     44    set_auth(client, auth) 
     45    auth.add_hook do |key, value| 
     46      set_auth(client, auth) 
     47    end 
    4348    options.add_hook("connect_timeout") do |key, value| 
    4449      client.connect_timeout = value 
     
    5459  def set_basic_auth(client, basic_auth) 
    5560    basic_auth.values.each do |ele| 
    56       if ele.is_a?(::Array) 
    57         url, userid, passwd = ele 
    58       else 
    59         url, userid, passwd = ele[:url], ele[:userid], ele[:password] 
    60       end 
    61       client.set_basic_auth(url, userid, passwd) 
     61      client.set_basic_auth(*authele_to_triplets(ele)) 
    6262    end 
     63  end 
     64 
     65  def set_auth(client, auth) 
     66    auth.values.each do |ele| 
     67      client.set_auth(*authele_to_triplets(ele)) 
     68    end 
     69  end 
     70 
     71  def authele_to_triplets(ele) 
     72    if ele.is_a?(::Array) 
     73      url, userid, passwd = ele 
     74    else 
     75      url, userid, passwd = ele[:url], ele[:userid], ele[:password] 
     76    end 
     77    return url, userid, passwd 
    6378  end 
    6479 
  • trunk/lib/soap/streamHandler.rb

    r1868 r1869  
    196196    ssl_config = @options["http.ssl_config"] 
    197197    basic_auth = @options["http.basic_auth"] 
     198    auth = @options["http.auth"] 
    198199    @options["http"].lock(true) 
    199200    ssl_config.unlock 
    200201    basic_auth.unlock 
     202    auth.unlock 
    201203  end 
    202204