right_scraper 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,11 +21,12 @@
21
21
  # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  #++
23
23
 
24
+ require 'tmpdir'
25
+
24
26
  module RightScraper
25
27
  module Retrievers
26
28
  # Retriever for resources stored in a git repository.
27
29
  class Git < CheckoutBasedRetriever
28
-
29
30
  @@available = false
30
31
 
31
32
  # Determines if downloader is available.
@@ -58,7 +59,7 @@ module RightScraper
58
59
  def retrieve
59
60
  raise RetrieverError.new("git retriever is unavailable") unless available?
60
61
  RightScraper::Processes::SSHAgent.with do |agent|
61
- unless @repository.first_credential.nil? || @repository.first_credential.blank?
62
+ unless @repository.first_credential.nil? || @repository.first_credential.empty?
62
63
  agent.add_key(@repository.first_credential)
63
64
  end
64
65
  super
@@ -111,7 +112,9 @@ module RightScraper
111
112
  def do_checkout
112
113
  super
113
114
  git = @logger.operation(:cloning, "to #{@repo_dir}") do
114
- ::Git.clone(@repository.url, @repo_dir)
115
+ without_host_key_checking do
116
+ ::Git.clone(@repository.url, @repo_dir)
117
+ end
115
118
  end
116
119
  do_fetch(git)
117
120
  do_checkout_revision(git)
@@ -133,6 +136,11 @@ module RightScraper
133
136
  end if repo_tag
134
137
  end
135
138
 
139
+ # Ignore .git directories.
140
+ def ignorable_paths
141
+ ['.git']
142
+ end
143
+
136
144
  def tag?(git, name)
137
145
  git.tags.find {|t| t.name == name}
138
146
  end
@@ -159,9 +167,29 @@ module RightScraper
159
167
  git.branches.remote.find {|b| b.name == name}
160
168
  end
161
169
 
162
- # Ignore .git directories.
163
- def ignorable_paths
164
- ['.git']
170
+ # Temporarily disable SSH host-key checking for SSH clients invoked by Git, for the duration of the
171
+ # block that is passed to this method.
172
+ #
173
+ # @yield after disabling strict host key checking, yields to caller
174
+ def without_host_key_checking
175
+ tmpdir = Dir.mktmpdir
176
+ ssh_cmd = File.join(tmpdir, 'ssh')
177
+
178
+ File.open(ssh_cmd, 'w') do |cmd|
179
+ cmd.puts "#!/bin/bash"
180
+ cmd.puts "exec ssh -o StrictHostKeyChecking=no ${@}"
181
+ end
182
+ FileUtils.chmod(0700, ssh_cmd)
183
+
184
+ old_env = ENV['GIT_SSH']
185
+ ENV['GIT_SSH'] = ssh_cmd
186
+
187
+ result = yield
188
+ ensure
189
+ FileUtils.rm_rf(tmpdir)
190
+ ENV['GIT_SSH'] = old_env
191
+
192
+ result
165
193
  end
166
194
  end
167
195
  end
@@ -24,7 +24,7 @@ require 'rubygems'
24
24
 
25
25
  Gem::Specification.new do |spec|
26
26
  spec.name = 'right_scraper'
27
- spec.version = '3.0.3'
27
+ spec.version = '3.0.4'
28
28
  spec.authors = ['Graham Hughes', 'Raphael Simon']
29
29
  spec.email = 'raphael@rightscale.com'
30
30
  spec.homepage = 'https://github.com/rightscale/right_scraper'
@@ -56,8 +56,8 @@ describe RightScraper::Scanners::CookbookS3Upload do
56
56
  end
57
57
 
58
58
  before(:each) do
59
- pending "Not run unless AMAZON_ACCESS_KEY_ID and AMAZON_SECRET_ACCESS_KEY set" unless
60
- ENV['AMAZON_ACCESS_KEY_ID'] && ENV['AMAZON_SECRET_ACCESS_KEY']
59
+ pending "Not run unless AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY set" unless
60
+ ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY']
61
61
  end
62
62
 
63
63
  context "given a bucket that doesn't exist" do
@@ -73,8 +73,8 @@ describe RightScraper::Scanners::CookbookS3Upload do
73
73
  @repo = RightScraper::Repositories::Base.from_hash(:display_name => 'test repo',
74
74
  :repo_type => :download,
75
75
  :url => "file:///#{@download_file}")
76
- @s3 = RightAws::S3.new(aws_access_key_id=ENV['AMAZON_ACCESS_KEY_ID'],
77
- aws_secret_access_key=ENV['AMAZON_SECRET_ACCESS_KEY'],
76
+ @s3 = RightAws::S3.new(aws_access_key_id=ENV['AWS_ACCESS_KEY_ID'],
77
+ aws_secret_access_key=ENV['AWS_SECRET_ACCESS_KEY'],
78
78
  :logger => RightScraper::Logger.new)
79
79
  FileUtils.rm_rf(RightScraper::Retrievers::Base.repo_dir(@repo_path, @repo))
80
80
  end
@@ -88,8 +88,8 @@ describe RightScraper::Scanners::CookbookS3Upload do
88
88
  :scanners => [RightScraper::Scanners::CookbookMetadata,
89
89
  RightScraper::Scanners::CookbookManifest,
90
90
  RightScraper::Scanners::CookbookS3Upload],
91
- :s3_key => ENV['AMAZON_ACCESS_KEY_ID'],
92
- :s3_secret => ENV['AMAZON_SECRET_ACCESS_KEY'],
91
+ :s3_key => ENV['AWS_ACCESS_KEY_ID'],
92
+ :s3_secret => ENV['AWS_SECRET_ACCESS_KEY'],
93
93
  :s3_bucket => bucket_name,
94
94
  :max_bytes => 1024**2,
95
95
  :max_seconds => 20)
@@ -112,13 +112,13 @@ describe RightScraper::Scanners::CookbookS3Upload do
112
112
  :scanners => [RightScraper::Scanners::CookbookMetadata,
113
113
  RightScraper::Scanners::CookbookManifest,
114
114
  RightScraper::Scanners::CookbookS3Upload],
115
- :s3_key => ENV['AMAZON_ACCESS_KEY_ID'],
116
- :s3_secret => ENV['AMAZON_SECRET_ACCESS_KEY'],
115
+ :s3_key => ENV['AWS_ACCESS_KEY_ID'],
116
+ :s3_secret => ENV['AWS_SECRET_ACCESS_KEY'],
117
117
  :s3_bucket => bucket_name,
118
118
  :max_bytes => 1024**2,
119
119
  :max_seconds => 20)
120
- s3 = RightAws::S3.new(aws_access_key_id=ENV['AMAZON_ACCESS_KEY_ID'],
121
- aws_secret_access_key=ENV['AMAZON_SECRET_ACCESS_KEY'],
120
+ s3 = RightAws::S3.new(aws_access_key_id=ENV['AWS_ACCESS_KEY_ID'],
121
+ aws_secret_access_key=ENV['AWS_SECRET_ACCESS_KEY'],
122
122
  :logger => RightScraper::Logger.new)
123
123
  @bucket = s3.bucket(bucket_name, create=true)
124
124
  FileUtils.rm_rf(RightScraper::Retrievers::Base.repo_dir(@repo_path, @repo))
data/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Dwy7t5Y8zJNycbz1tfJ5PiY7xfWRCZj453/WZTc
24
+ y5e9KQKBgQCj6Z9nZ0pRTx1Ng020yFUo1FQ2w8DGxtbjMot3CnEVMbM/ELFbsuE5
25
+ GAGMzo0yJ9v4ZgYyuIKm3poS96g9SXEH31+u9IOFBL2YPrHoa7mB9oQAkyS1wtus
26
+ fRizNFXbKrnnB+2xBcE0OnHZ+TfGoNMDyO8NvV1oumxnj3DTOTUBEQ==
27
27
  -----END RSA PRIVATE KEY-----
data/spec/git/demokey.pub CHANGED
@@ -1 +1 @@
1
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxJsM8sZ6++Nky/ogLEYhKtKivB37sPB9M6Un0z6PkIRgUsGdntMJqP1U6820jH+n1/lOH/MnlUsvzoo8DnOdbe9kGOHBmtWmNcjqacZUn9DbpbjvlI7RUUmZ5OBKn8Pjt2qbSXnnci9Q5j5Rgh6DR8A70S04FIUP8AGpCIO23BhA928CiM18zN5mBvzET7L2DYiNhJJFsFWMbN13CdukTjNVNLETEusNVUU09G1NxX4esKky7tHh1c9APFvu98KjYOHkv1o7dB7T4dO3KaKCNWINCHeeoE+QmAkhAZwI72ijRkPxH+QMisMsHucPFvgOVVObxHWu9hRlNWIOodANHQ== grahamhughes@Graham-Hughess-Computer.local
1
+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC18gNzaOwgJkHhUgPPNtCNp0H08ywzH1AquwSca19ZOedGnRWa673t4sXW0BeBn1wd8v0EulHRNwIyn0xJLsEStMOpo4A0qN+B2sM9gjBcY8nMOyUqy5s32pXncGfEwiRuiAxqz45VJqvL3CD8X5WxG300u/DNUbLZN0IT1aPn52Bo6gcGleZklxF1cccrbMelWfXE7KYKjD3/TfLdJeOlP9PJM8ijFHCsyWcKt5AH8bFkQ/xETPfqPzUIwvLDU7HpVDLZZ6JBi2rxhAAG+NhE3GMmY5i+vMB+g7CCfY200SFxzyjIcag05MGGko8Rv9bHnE3AYj9cxCULyDJyZm/T nobody@localhost.localdomain
@@ -1,30 +1,30 @@
1
1
  -----BEGIN RSA PRIVATE KEY-----
2
2
  Proc-Type: 4,ENCRYPTED
3
- DEK-Info: DES-EDE3-CBC,6B0CA080DABAAD1E
3
+ DEK-Info: AES-128-CBC,6DF3FE56B08906976427C247F02F8EF1
4
4
 
5
- /HzipjC3L/jIQGWAIBLbAIFYd3R9a/LtZhYlH0BL2fa3xIhCfSTrgaF/dSGivhXp
6
- bAJC1JBvIKfyZp/sNJxN058rbhWJXUeixbyjGqCZpfHGbWRRp41V3s0Vtlb6yv/t
7
- tpv+wAf36RcE/Did+SEvLSesBAeYqt+6RAeyntDPiBDXA24neJ9krn8LoYu6vc7L
8
- u4M7YmAcjxdive3AYYz8pnldzLBtvJ+2QK9gMexyGiFrvJi7efHRw1aqac4LOLSE
9
- /0575oEvULJoUSgNSMMqCU+CDBbSn6re+TMA89gDAEKYDyAL/SU0OJGs30ulfHMg
10
- CCkDF8NK7X9zBlAkD/m0mrIHbjWjnWIlBj1ZUcGYtp3/oMuMyBTpkVcNJVUMN5YF
11
- U9iWGsP+OTXGxOWQh3NiG+0xBgLjzPkaJIxw4tWg5pSpavD6yZ8rOQcpPFC05NzE
12
- Kll750p7fX0G+/M9gVu84QfCc+xTpD/bJ8BvdfQnpBAPx653IO1OCNWtdURTu4a5
13
- 6lBVa0NG92xx9CeuyC9jFNpqMN65YLF4vchLnTH1UkzEJ46S8TIIiEj2UPHP82N9
14
- aKX+0lc60s3RKZWTEvPYzEAAXRihyVUefvbT0e1Dz1NzW2WzRA4UwHc0rg5r/2d5
15
- MGnI77i+cNtyPmEucLn5PQAkSubGs5Ww9vwB2mAyLIWsLDzkUX7/TFBE/05p35if
16
- Tz8Lj7bpIY4itzV752rfYI17QL2AXUkEaR3PKFl8JC9NxrO/Uw/xeuFeGsti7pKk
17
- gqsFV0PzfrlbKXnL2EMpyOYIf7T5bd5ScWL6+59pPujPZ1XiPrcffGWJ6jFUghqu
18
- e7isM8r+byAUEM+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pZJBne4CYBBYjTiG97CGb1D8mYuGxneMlt/ImYt+D3W+wa9j17+UdamFKJl+3lZC3k3WJXyfLHFYFkkW2NeJNqYefAXgULIyMdybcOvI++/hXxJmh5p6cML4yA08IFqYHQY/f nobody@localhost.localdomain
@@ -508,7 +508,7 @@ describe RightScraper::Retrievers::Git do
508
508
  @repo = RightScraper::Repositories::Base.from_hash(
509
509
  :display_name => 'test repo',
510
510
  :repo_type => :git,
511
- :url => 'git@github.com:rightscale-test-account/cookbooks.git',
511
+ :url => 'git@github.com:xeger/cookbooks_test_fixture.git',
512
512
  :first_credential => credential)
513
513
  @helper.setup_cookbooks
514
514
  end
@@ -525,5 +525,29 @@ describe RightScraper::Retrievers::Git do
525
525
  pending "Don't annoy GitHub unless ANNOY_GITHUB is set" unless ENV['ANNOY_GITHUB']
526
526
  @scraper.next_resource.should_not be_nil
527
527
  end
528
+
529
+ context :without_host_key_checking do
530
+ before(:each) do
531
+ @retriever = RightScraper::Retrievers::Git.new(@repo, :basedir=>@helper.scraper_path)
532
+ end
533
+
534
+
535
+ it 'should override the git-SSH command' do
536
+ ENV['GIT_SSH'] = nil
537
+ @retriever.without_host_key_checking do
538
+ ENV['GIT_SSH'].should =~ /ssh/
539
+ # Run the git-ssh command, make sure it invokes the SSH client
540
+ `#{ENV['GIT_SSH']} -V 2>&1`.should =~ /OpenSSH_[0-9]+\.[0-9]+/
541
+ end
542
+ end
543
+
544
+ it 'should clean up after itself' do
545
+ ENV['GIT_SSH'] = 'banana'
546
+ @retriever.without_host_key_checking do
547
+ ENV['GIT_SSH'].should =~ /ssh/
548
+ end
549
+ ENV['GIT_SSH'].should == 'banana'
550
+ end
551
+ end
528
552
  end
529
553
  end
data/spec/git/ssh_spec.rb CHANGED
@@ -136,9 +136,9 @@ describe RightScraper::Processes::SSHAgent do
136
136
  File.chmod(0600, demofile)
137
137
  demofile = File.join(File.dirname(__FILE__), 'demokey')
138
138
  agent.add_keyfile(demofile)
139
- `ssh-add -l`.should == "2048 3d:6a:4f:8b:ec:35:da:e9:7e:cc:e8:2d:03:2f:6f:23 #{demofile} (RSA)\n"
139
+ `ssh-add -l`.should == "2048 c7:66:87:fc:17:b5:2f:32:f2:c1:ed:40:a6:8d:17:44 #{demofile} (RSA)\n"
140
140
  `ssh-add -L`.should == <<FULLOUTPUT
141
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxJsM8sZ6++Nky/ogLEYhKtKivB37sPB9M6Un0z6PkIRgUsGdntMJqP1U6820jH+n1/lOH/MnlUsvzoo8DnOdbe9kGOHBmtWmNcjqacZUn9DbpbjvlI7RUUmZ5OBKn8Pjt2qbSXnnci9Q5j5Rgh6DR8A70S04FIUP8AGpCIO23BhA928CiM18zN5mBvzET7L2DYiNhJJFsFWMbN13CdukTjNVNLETEusNVUU09G1NxX4esKky7tHh1c9APFvu98KjYOHkv1o7dB7T4dO3KaKCNWINCHeeoE+QmAkhAZwI72ijRkPxH+QMisMsHucPFvgOVVObxHWu9hRlNWIOodANHQ== #{demofile}
141
+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC18gNzaOwgJkHhUgPPNtCNp0H08ywzH1AquwSca19ZOedGnRWa673t4sXW0BeBn1wd8v0EulHRNwIyn0xJLsEStMOpo4A0qN+B2sM9gjBcY8nMOyUqy5s32pXncGfEwiRuiAxqz45VJqvL3CD8X5WxG300u/DNUbLZN0IT1aPn52Bo6gcGleZklxF1cccrbMelWfXE7KYKjD3/TfLdJeOlP9PJM8ijFHCsyWcKt5AH8bFkQ/xETPfqPzUIwvLDU7HpVDLZZ6JBi2rxhAAG+NhE3GMmY5i+vMB+g7CCfY200SFxzyjIcag05MGGko8Rv9bHnE3AYj9cxCULyDJyZm/T #{demofile}
142
142
  FULLOUTPUT
143
143
  end
144
144
  end
@@ -163,8 +163,9 @@ FULLOUTPUT
163
163
  demofile = File.join(File.dirname(__FILE__), 'demokey')
164
164
  demodata = File.open(demofile).read
165
165
  agent.add_key(demodata)
166
- `ssh-add -l`.should =~ /^2048 3d:6a:4f:8b:ec:35:da:e9:7e:cc:e8:2d:03:2f:6f:23 .*? \(RSA\)\n$/
167
- `ssh-add -L`.should =~ %r{^ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxJsM8sZ6\+\+Nky/ogLEYhKtKivB37sPB9M6Un0z6PkIRgUsGdntMJqP1U6820jH\+n1/lOH/MnlUsvzoo8DnOdbe9kGOHBmtWmNcjqacZUn9DbpbjvlI7RUUmZ5OBKn8Pjt2qbSXnnci9Q5j5Rgh6DR8A70S04FIUP8AGpCIO23BhA928CiM18zN5mBvzET7L2DYiNhJJFsFWMbN13CdukTjNVNLETEusNVUU09G1NxX4esKky7tHh1c9APFvu98KjYOHkv1o7dB7T4dO3KaKCNWINCHeeoE\+QmAkhAZwI72ijRkPxH\+QMisMsHucPFvgOVVObxHWu9hRlNWIOodANHQ== .*\n$}
166
+ `ssh-add -l`.should =~ /^2048 c7:66:87:fc:17:b5:2f:32:f2:c1:ed:40:a6:8d:17:44 .*? \(RSA\)\n$/
167
+ expected_pubkey = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC18gNzaOwgJkHhUgPPNtCNp0H08ywzH1AquwSca19ZOedGnRWa673t4sXW0BeBn1wd8v0EulHRNwIyn0xJLsEStMOpo4A0qN+B2sM9gjBcY8nMOyUqy5s32pXncGfEwiRuiAxqz45VJqvL3CD8X5WxG300u/DNUbLZN0IT1aPn52Bo6gcGleZklxF1cccrbMelWfXE7KYKjD3/TfLdJeOlP9PJM8ijFHCsyWcKt5AH8bFkQ/xETPfqPzUIwvLDU7HpVDLZZ6JBi2rxhAAG+NhE3GMmY5i+vMB+g7CCfY200SFxzyjIcag05MGGko8Rv9bHnE3AYj9cxCULyDJyZm/T'
168
+ `ssh-add -L`.should =~ %r{^#{Regexp.escape(expected_pubkey)} .*\n$}
168
169
  end
169
170
  end
170
171
  end
@@ -39,7 +39,9 @@ module RightScraper
39
39
  end
40
40
 
41
41
  after(:each) do
42
- FileUtils.remove_entry_secure(@basedir)
42
+ if @basedir && File.directory?(@basedir)
43
+ FileUtils.remove_entry_secure(@basedir)
44
+ end
43
45
  @scraper = nil
44
46
  end
45
47
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_scraper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 3
10
- version: 3.0.3
9
+ - 4
10
+ version: 3.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Graham Hughes
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-08-21 00:00:00 -07:00
19
+ date: 2012-08-27 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency