train 2.0.5 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc5c0aaf06370bfbf2ee1308c13dfd87a0da5a736536c4bf3024dd3400a62861
4
- data.tar.gz: 04e7e0b56d0acd587ce5a567e8c81b2a2b701fd87c0165271048158340958d05
3
+ metadata.gz: ca96012fcfe10c8768b55feb8e057d6b7b887d162d4ce811cbccad1a66f965c9
4
+ data.tar.gz: 11d473cbab05ffc7e453c63fd6866c6cd7fcd752db98a0840fe87635cf1f02c0
5
5
  SHA512:
6
- metadata.gz: 68a9846a2638f11c3d5d34f340f20cd42748206307f10b930c4967745d6c6db7e803109322c36f9ee15c5b4c7e15c4c05bcbbc58acad15878ca058b2c05e1f34
7
- data.tar.gz: 343a8c70c0e73ff1c3169e28696ad073c5611afa8bcd8425b27b25ff6bd0220084c02139ef96a95c074737df29e8418b03bb91790646c1675b552010b1514f19
6
+ metadata.gz: 82bb4f9c938a0038fcc17d15741faac47cd7a825c89d43df9d2ddcb95c435cb9575650ffaf5caa3ff439b6f51b4d5b761f82fefea29921c9800adda28ec24882
7
+ data.tar.gz: 97f5a213e528421a5b11ffbbea69d1b130cd2b93170cabb56e3ed24da05e7e1c3837208a03aa4014f9b5130605243356d298bd6334c844f8a3f0dab3021af32d
@@ -167,9 +167,9 @@ module Train::Transports
167
167
  non_interactive: opts[:non_interactive],
168
168
  transport_options: opts,
169
169
  }
170
- # disable host key verification. The hash key to use
170
+ # disable host key verification. The hash key and value to use
171
171
  # depends on the version of net-ssh in use.
172
- connection_options[verify_host_key_option] = opts[:verify_host_key] || false
172
+ connection_options[verify_host_key_option] = verify_host_key_value(opts[:verify_host_key])
173
173
 
174
174
  connection_options
175
175
  end
@@ -193,6 +193,35 @@ module Train::Transports
193
193
  current_net_ssh >= new_option_version ? :verify_host_key : :paranoid
194
194
  end
195
195
 
196
+ # Likewise, version <5 accepted false; 5+ requires :never or will
197
+ # issue a deprecation warning. This method allows a lot of common
198
+ # things through.
199
+ def verify_host_key_value(given)
200
+ current_net_ssh = Net::SSH::Version::CURRENT
201
+ new_value_version = Net::SSH::Version[5, 0, 0]
202
+ if current_net_ssh >= new_value_version
203
+ # 5.0+ style
204
+ {
205
+ # It's not a boolean anymore.
206
+ 'true' => :always,
207
+ 'false' => :never,
208
+ true => :always,
209
+ false => :never,
210
+ # May be correct value, but strings from JSON config
211
+ 'always' => :always,
212
+ 'never' => :never,
213
+ nil => :never,
214
+ }.fetch(given, given)
215
+ else
216
+ # up to 4.2 style
217
+ {
218
+ 'true' => true,
219
+ 'false' => false,
220
+ nil => false,
221
+ }.fetch(given, given)
222
+ end
223
+ end
224
+
196
225
  # Creates a new SSH Connection instance and save it for potential future
197
226
  # reuse.
198
227
  #
data/lib/train/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '2.0.5'.freeze
6
+ VERSION = '2.0.8'.freeze
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-10 00:00:00.000000000 Z
11
+ date: 2019-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -90,6 +90,34 @@ dependencies:
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
92
  version: '3.0'
93
+ - !ruby/object:Gem::Dependency
94
+ name: ed25519
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '1.2'
100
+ type: :runtime
101
+ prerelease: false
102
+ version_requirements: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '1.2'
107
+ - !ruby/object:Gem::Dependency
108
+ name: bcrypt_pbkdf
109
+ requirement: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '1.0'
114
+ type: :runtime
115
+ prerelease: false
116
+ version_requirements: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - "~>"
119
+ - !ruby/object:Gem::Version
120
+ version: '1.0'
93
121
  - !ruby/object:Gem::Dependency
94
122
  name: winrm
95
123
  requirement: !ruby/object:Gem::Requirement