Skip to content

Commit 809ab95

Browse files
AP-776: Fix "pkeys are immutable on OpenSSL 3.0" (#5)
- Bumps net-ssh/sftp to fix that error. - Resolves issue connecting to LBNL. - Removes special KEX configuration for GOBI which is no longer required.
1 parent bbf5cb3 commit 809ab95

5 files changed

Lines changed: 21 additions & 15 deletions

File tree

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ ruby File.read('.ruby-version').strip
44

55
gem 'berkeley_library-docker', '~> 0.1.1'
66
gem 'chronic', '~> 0.10.2'
7+
gem 'logger'
78
gem 'net-sftp'
89
gem 'thor', '~> 1.1'
910

1011
group :test do
12+
gem 'base64'
13+
gem 'bigdecimal'
1114
gem 'colorize'
1215
gem 'rspec'
1316
gem 'rspec-its', '~> 1.3'

Gemfile.lock

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ GEM
44
addressable (2.9.0)
55
public_suffix (>= 2.0.2, < 8.0)
66
ast (2.4.3)
7+
base64 (0.3.0)
78
berkeley_library-docker (0.1.1)
9+
bigdecimal (4.1.2)
810
chronic (0.10.2)
911
colorize (0.8.1)
1012
crack (0.4.5)
@@ -14,9 +16,10 @@ GEM
1416
json (2.20.0)
1517
language_server-protocol (3.17.0.5)
1618
lint_roller (1.1.0)
17-
net-sftp (3.0.0)
18-
net-ssh (>= 5.0.0, < 7.0.0)
19-
net-ssh (6.1.0)
19+
logger (1.7.0)
20+
net-sftp (4.0.0)
21+
net-ssh (>= 5.0.0, < 8.0.0)
22+
net-ssh (7.3.3)
2023
parallel (2.1.0)
2124
parser (3.3.11.1)
2225
ast (~> 2.4.1)
@@ -79,9 +82,12 @@ PLATFORMS
7982
x86_64-linux
8083

8184
DEPENDENCIES
85+
base64
8286
berkeley_library-docker (~> 0.1.1)
87+
bigdecimal
8388
chronic (~> 0.10.2)
8489
colorize
90+
logger
8591
net-sftp
8692
rspec
8793
rspec-its (~> 1.3)

lib/berkeley_library/sftp_handler/downloader/gobi.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ def default_host
4545
def default_username
4646
ENV.fetch('LIT_GOBI_USERNAME', nil)
4747
end
48-
49-
def ssh_options
50-
super.tap do |opts|
51-
# @note As of 04/28/22, Gobi's server only supports outdated Diffie-Hellman
52-
# key exchange algorithms, which you local sftp client will probably (and
53-
# correctly) refuse. If you want to test manually, then for now you must
54-
# explicitly allow the old algorithm by passing the following option to your
55-
# sftp client: `-oKexAlgorithms=+diffie-hellman-group1-sha1`.
56-
opts[:append_all_supported_algorithms] = true
57-
end
58-
end
5948
end
6049
end
6150
end

spec/downloader/gobi_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
let(:now) { Time.new(2022, 5, 20, 0, 0, 0) }
77

88
its(:default_host) { is_expected.to eq 'ftp.ybp.com' }
9-
its(:ssh_options) { is_expected.to include(append_all_supported_algorithms: true) }
9+
its(:ssh_options) { is_expected.not_to include(:append_all_supported_algorithms) }
1010

1111
its(:default_filename) do
1212
Timecop.freeze(now) do

spec/downloader/lbnl_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
# rubocop:disable Metrics/BlockLength
77
describe BerkeleyLibrary::SftpHandler::Downloader::Lbnl do
8+
around do |example|
9+
old_lbnl_filename = ENV.fetch('LBNL_FILENAME', nil)
10+
ENV['LBNL_FILENAME'] = 'test'
11+
example.run
12+
ensure
13+
old_lbnl_filename.nil? ? ENV.delete('LBNL_FILENAME') : ENV['LBNL_FILENAME'] = old_lbnl_filename
14+
end
15+
816
its(:default_host) { is_expected.to eq 'ncc-1701.lbl.gov' }
917

1018
describe '#download!' do

0 commit comments

Comments
 (0)