[Groonga-commit] ranguba/groonga-client at 78f05c3 [master] Remove auth_ prefix from auth_user and auth_password

Back to archive index

KITAITI Makoto null+****@clear*****
Sat Feb 6 22:33:30 JST 2016


KITAITI Makoto	2016-02-06 22:33:30 +0900 (Sat, 06 Feb 2016)

  New Revision: 78f05c38ae9c39c83b857064d3d5981c6536abcb
  https://github.com/ranguba/groonga-client/commit/78f05c38ae9c39c83b857064d3d5981c6536abcb

  Merged 41a8b86: Merge pull request #4 from KitaitiMakoto/basic-auth

  Message:
    Remove auth_ prefix from auth_user and auth_password
    
    Their are not used for other than authentication.

  Modified files:
    lib/groonga/client.rb
    lib/groonga/client/protocol/http/synchronous.rb
    test/test-client.rb

  Modified: lib/groonga/client.rb (+4 -4)
===================================================================
--- lib/groonga/client.rb    2016-02-06 12:59:57 +0900 (d2864ff)
+++ lib/groonga/client.rb    2016-02-06 22:33:30 +0900 (16ffa18)
@@ -33,10 +33,10 @@ module Groonga
       #   @param [Hash] options The options.
       #   @option options [:gqtp or :http] :protocol The protocol that is
       #     used by the client.
-      #   @option options [String] :auth_user User ID for HTTP Basic
-      #     Authentication.
-      #   @option options [String] :auth_password Password for HTTP Basic
-      #     Authentication.
+      #   @option options [String] :user User ID. Currently used for HTTP
+      #     Basic Authentication.
+      #   @option options [String] :password Password. Currently used for
+      #     HTTP Basic Authentication.
       #
       # @overload open(options={})
       #   Opens a new client connection.

  Modified: lib/groonga/client/protocol/http/synchronous.rb (+2 -2)
===================================================================
--- lib/groonga/client/protocol/http/synchronous.rb    2016-02-06 12:59:57 +0900 (a1bbca8)
+++ lib/groonga/client/protocol/http/synchronous.rb    2016-02-06 22:33:30 +0900 (3ce6a8f)
@@ -113,7 +113,7 @@ module Groonga
               request = Net::HTTP::Get.new(path, headers)
             end
             if do_authenticate?
-              request.basic_auth @options[:auth_user], @options[:auth_password]
+              request.basic_auth @options[:user], @options[:password]
             end
             http.request(request)
           end
@@ -125,7 +125,7 @@ module Groonga
           end
 
           def do_authenticate?
-            @options[:auth_user] && @options[:auth_password]
+            @options[:user] && @options[:password]
           end
         end
       end

  Modified: test/test-client.rb (+7 -7)
===================================================================
--- test/test-client.rb    2016-02-06 12:59:57 +0900 (39b45bb)
+++ test/test-client.rb    2016-02-06 22:33:30 +0900 (8dd8410)
@@ -50,7 +50,7 @@ class TestClient < Test::Unit::TestCase
     end
 
     def open_client(&block)
-      options = {:host => @address, :port => @port, :protocol => @protocol, :auth_user => @auth_user, :auth_password => @auth_password}
+      options = {:host => @address, :port => @port, :protocol => @protocol, :user => @user, :password => @password}
       Groonga::Client.open(options, &block)
     end
 
@@ -257,8 +257,8 @@ JSON
 
   module BasicAuthenticationTests
     def setup
-      @auth_user = 'Aladdin'
-      @auth_password = 'open sesame'
+      @user = 'Aladdin'
+      @password = 'open sesame'
     end
 
     def test_request_header
@@ -289,8 +289,8 @@ JSON
       @port =****@serve*****[1]
       @protocol = :gqtp
 
-      @auth_user = nil
-      @auth_password = nil
+      @user = nil
+      @password = nil
       @actual_commands = []
       @response_body = nil
       @thread = Thread.new do
@@ -334,8 +334,8 @@ JSON
       @port =****@serve*****[1]
       @protocol = :http
 
-      @auth_user ||= nil
-      @auth_password ||= nil
+      @user ||= nil
+      @password ||= nil
       @request_headers = {}
       @actual_commands = []
       @response_body = nil
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index