Commit f6539522 authored by Mark Lapierre's avatar Mark Lapierre

Don't use .netrc with SSH

There was a bug that required credentials when using SSH key auth when
using LFS. That bug was fixed so we shouldn't need to add credentials to
.netrc when using SSH anymore.
parent 02c3c9da
...@@ -117,8 +117,6 @@ module QA ...@@ -117,8 +117,6 @@ module QA
File.binwrite(private_key_file, key.private_key) File.binwrite(private_key_file, key.private_key)
File.chmod(0700, private_key_file) File.chmod(0700, private_key_file)
try_add_credentials_to_netrc
@known_hosts_file = Tempfile.new("known_hosts_#{SecureRandom.hex(8)}") @known_hosts_file = Tempfile.new("known_hosts_#{SecureRandom.hex(8)}")
keyscan_params = ['-H'] keyscan_params = ['-H']
keyscan_params << "-p #{uri.port}" if uri.port keyscan_params << "-p #{uri.port}" if uri.port
...@@ -180,7 +178,6 @@ module QA ...@@ -180,7 +178,6 @@ module QA
def add_credentials? def add_credentials?
return false if !username || !password return false if !username || !password
return true unless ssh_key_set? return true unless ssh_key_set?
return true if ssh_key_set? && use_lfs?
false false
end end
......
...@@ -115,16 +115,5 @@ describe QA::Git::Repository do ...@@ -115,16 +115,5 @@ describe QA::Git::Repository do
.to eq("machine foo login user password foo\n") .to eq("machine foo login user password foo\n")
end end
end end
describe '#use_ssh_key' do
it 'does not add credentials to .netrc' do
key = Struct.new(:private_key).new('foo')
expect(repository).to receive(:try_add_credentials_to_netrc).and_call_original
expect(repository).not_to receive(:save_netrc_content)
repository.use_ssh_key(key)
end
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment