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.
- data/lib/right_scraper/retrievers/git.rb +34 -6
- data/right_scraper.gemspec +1 -1
- data/spec/cookbook_s3_upload_spec.rb +10 -10
- data/spec/git/demokey +25 -25
- data/spec/git/demokey.pub +1 -1
- data/spec/git/password_key +26 -26
- data/spec/git/password_key.pub +1 -1
- data/spec/git/retriever_spec.rb +25 -1
- data/spec/git/ssh_spec.rb +5 -4
- data/spec/scraper_helper.rb +3 -1
- metadata +4 -4
@@ -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.
|
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
|
-
|
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
|
-
#
|
163
|
-
|
164
|
-
|
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
|
data/right_scraper.gemspec
CHANGED
@@ -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.
|
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
|
60
|
-
ENV['
|
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['
|
77
|
-
aws_secret_access_key=ENV['
|
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['
|
92
|
-
:s3_secret => ENV['
|
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['
|
116
|
-
:s3_secret => ENV['
|
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['
|
121
|
-
aws_secret_access_key=ENV['
|
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/spec/git/demokey
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
-----BEGIN RSA PRIVATE KEY-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
2
|
+
MIIEpAIBAAKCAQEAtfIDc2jsICZB4VIDzzbQjadB9PMsMx9QKrsEnGtfWTnnRp0V
|
3
|
+
muu97eLF1tAXgZ9cHfL9BLpR0TcCMp9MSS7BErTDqaOANKjfgdrDPYIwXGPJzDsl
|
4
|
+
KsubN9qV53BnxMIkbogMas+OVSary9wg/F+VsRt9NLvwzVGy2TdCE9Wj5+dgaOoH
|
5
|
+
BpXmZJcRdXHHK2zHpVn1xOymCow9/03y3SXjpT/TyTPIoxRwrMlnCreQB/GxZEP8
|
6
|
+
REz36j81CMLyw1Ox6VQy2WeiQYtq8YQABvjYRNxjJmOYvr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7SQPwAiECgYBHDuHlh58rvsd0WmVkEWdSAq+qC6h23iPGw8J1
|
22
|
+
0+W7Dk2dNmvkqnamJI/rOk3ZcznKQ3uraDKzivBNHubNoiIeF/OJh4lSppZErUjh
|
23
|
+
KVnQao2AZ4Zlzs3s/P9HVH/iNDwy7t5Y8zJNycbz1tfJ5PiY7xfWRCZj453/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
|
1
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC18gNzaOwgJkHhUgPPNtCNp0H08ywzH1AquwSca19ZOedGnRWa673t4sXW0BeBn1wd8v0EulHRNwIyn0xJLsEStMOpo4A0qN+B2sM9gjBcY8nMOyUqy5s32pXncGfEwiRuiAxqz45VJqvL3CD8X5WxG300u/DNUbLZN0IT1aPn52Bo6gcGleZklxF1cccrbMelWfXE7KYKjD3/TfLdJeOlP9PJM8ijFHCsyWcKt5AH8bFkQ/xETPfqPzUIwvLDU7HpVDLZZ6JBi2rxhAAG+NhE3GMmY5i+vMB+g7CCfY200SFxzyjIcag05MGGko8Rv9bHnE3AYj9cxCULyDJyZm/T nobody@localhost.localdomain
|
data/spec/git/password_key
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
-----BEGIN RSA PRIVATE KEY-----
|
2
2
|
Proc-Type: 4,ENCRYPTED
|
3
|
-
DEK-Info:
|
3
|
+
DEK-Info: AES-128-CBC,6DF3FE56B08906976427C247F02F8EF1
|
4
4
|
|
5
|
-
/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3NzaC1yc2EAAAADAQABAAABAQChbg3Sbijezv1ycd8itx5pWjmsa6g0yhL6Q9OW2F7OFx+qILcsU7rgIQh7THhYMD8OpAdw8A3lyw0jFIfp0acmKMUorrO3oFK2cLauvVXCBaz6GpDq4wiAvJHdQlW7mSFOx86Niem7/LiuR48fMJ1RgNMDUIlpk19ZMCxhEd53ZJfzFWrrFKhtxhJnCbRMm1RtkVkGWNvJFRHm7JKpZJBne4CYBBYjTiG97CGb1D8mYuGxneMlt/ImYt+D3W+wa9j17+UdamFKJl+3lZC3k3WJXyfLHFYFkkW2NeJNqYefAXgULIyMdybcOvI++/hXxJmh5p6cML4yA08IFqYHQY/f nobody@localhost.localdomain
|
data/spec/git/retriever_spec.rb
CHANGED
@@ -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:
|
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
|
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
|
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
|
167
|
-
|
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
|
data/spec/scraper_helper.rb
CHANGED
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:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
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-
|
19
|
+
date: 2012-08-27 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|