#274 new
AlekSi

[PATCH] Do not cache username and password by default in Subversion adapter

Reported by AlekSi | December 9th, 2009 @ 12:55 AM

Here is a patch:

From beea29addebc1f8fd606396f97c37a980f0056ec Mon Sep 17 00:00:00 2001
From: Aleksey Palazhchenko alek.silverstone@gmail.com
Date: Wed, 9 Dec 2009 11:49:21 +0300
Subject: [PATCH] Caching username and password by default breaks things. Use :auth_cache option for it.


app/views/documentation/source_control.red | 1 + lib/source_control/subversion.rb | 2 ++ test/unit/source_control/subversion_test.rb | 6 ++++++ 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/app/views/documentation/source_control.red b/app/views/documentation/source_control.red
index 8a16843..0813667 100644
--- a/app/views/documentation/source_control.red
+++ b/app/views/documentation/source_control.red
@@ -15,6 +15,7 @@ end
Subversion accepts the following configuration options:

  • :repository, :username, :password as in standard Subversion +* :auth_cache allows to cache username and password; false by default
  • :interactive sets interactive mode; false by default
  • :check_externals tells CC.rb to trigger a build if externals change; true by default
  • :path is the location of an empty directory to check your project out into
    diff --git a/lib/source_control/subversion.rb b/lib/source_control/subversion.rb
    index 3f86889..aff12e7 100644
    --- a/lib/source_control/subversion.rb
    +++ b/lib/source_control/subversion.rb
    @@ -21,6 +21,7 @@ module SourceControl
    @repository = options.delete(:repository)
    @username = options.delete(:username)
    @password = options.delete(:password)
    
  • @auth_cache = options.delete(:auth_cache) @interactive = options.delete(:interactive) @check_externals = options.has_key?(:check_externals) ? options.delete(:check_externals) : true

@@ -119,6 +120,7 @@ module SourceControl

 def svn(operation, arguments, options = {}, &block)
   command = ["svn"]
  • command << "--no-auth-cache" unless @auth_cache command << "--non-interactive" unless @interactive command << operation command += arguments.compact diff --git a/test/unit/source_control/subversion_test.rb b/test/unit/source_control/subversion_test.rb
    index aaf2e59..2c8dc20 100644
    --- a/test/unit/source_control/subversion_test.rb +++ b/test/unit/source_control/subversion_test.rb @@ -138,6 +138,12 @@ class SourceControl::SubversionTest < Test::Unit::TestCase svn.checkout(Subversion::Revision.new(5)) end

  • def test_allowing_auth_cache

  • svn = new_subversion(:repository => 'svn://foo.com/', :auth_cache => true)
  • svn.expects(:svn).with("co", ["svn://foo.com/", "."], :execute_in_project_directory => false)
  • svn.checkout
  • end + def test_allowing_interaction svn = new_subversion(:repository => 'svn://foo.com/', :interactive => true)

    svn.expects(:svn).with("co", ["svn://foo.com/", "."], :execute_in_project_directory => false)

    1.6.3.3

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Tags

Pages