smart_proxy_remote_execution_ssh 0.10.3 → 0.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bc5fac79b7bea854a28d0e8d26af6851ec0937015b88ffad4f8cea5215b3f8f
4
- data.tar.gz: d4e14b27b7b2c02b441f2161473abe6aa629d1dac75d8045f83537f69cba197e
3
+ metadata.gz: 243be2829c2dded953adf5e312e936d3ec6d6ef19ce3474d4f174fd5bd8d89f2
4
+ data.tar.gz: fb9b33c7dabf90b89921cfbee5bfe6e94b130cc224b7889941171de01c087860
5
5
  SHA512:
6
- metadata.gz: bd4e101e224717ae4e607b54692cf2f1cbcf0c1512ba912e3255aaaa934addcf4829e27b7dc75453d416527257d8dec0cb4ba388a33ee93ccc4db030ac06ea9f
7
- data.tar.gz: 2dc61c86cfef3d383e41fad38bc0818f4a3231763bd74633102076bc8a9d9ebc3b01a4e927b9e00dd0e7cbb9e977b9e49dc5d05afb0a78e8d097384dcb74cba7
6
+ metadata.gz: 97d3dd475293be10577c24ecf99679bf8e1d68712246d547f791f995e1b9c93661580343aaf10a45a7b62a479be34e2602ad817b20258b29cf48de7ac049ef12
7
+ data.tar.gz: 5deb80acfeecb4185acd0ec5eca8cf190e05fc01883f7a7a5dac25b0b2be26135f8b7a8905ad55f4ed80d8aa58835d41eded4b313d121d1c53d419450d7d7175
@@ -22,10 +22,12 @@ module Proxy::RemoteExecution::Ssh::Runners
22
22
 
23
23
  class AuthenticationMethod
24
24
  attr_reader :name
25
+ attr_accessor :errors
25
26
  def initialize(name, prompt: nil, password: nil)
26
27
  @name = name
27
28
  @prompt = prompt
28
29
  @password = password
30
+ @errors = nil
29
31
  end
30
32
 
31
33
  def ssh_command_prefix
@@ -67,12 +69,18 @@ module Proxy::RemoteExecution::Ssh::Runners
67
69
  def establish!
68
70
  @available_auth_methods ||= available_authentication_methods
69
71
  method = @available_auth_methods.find do |method|
70
- if try_auth_method(method)
72
+ pm = try_auth_method(method)
73
+ method.errors = pm.stderr
74
+ if pm.status.zero?
71
75
  @available_auth_methods.unshift(method).uniq!
72
76
  true
73
77
  end
74
78
  end
75
- method || raise("Could not establish connection to remote host using any available authentication method, tried #{@available_auth_methods.map(&:name).join(', ')}")
79
+ return method if method
80
+
81
+ msg = "Could not establish connection to remote host using any available authentication method, tried #{@available_auth_methods.map(&:name).join(', ')}"
82
+ method_errors = @available_auth_methods.map { |method| "Authentication method '#{method.name}' failed with:\n#{method.errors}" }.join("\n")
83
+ raise "#{msg}\n\n#{method_errors}"
76
84
  end
77
85
 
78
86
  def disconnect!
@@ -119,11 +127,10 @@ module Proxy::RemoteExecution::Ssh::Runners
119
127
  if pm.status.zero?
120
128
  logger.debug("Established connection using authentication method #{method.name}")
121
129
  @socket = socket_file
122
- true
123
130
  else
124
131
  logger.debug("Failed to establish connection using authentication method #{method.name}")
125
- false
126
132
  end
133
+ pm
127
134
  end
128
135
 
129
136
  def settings
@@ -148,7 +155,7 @@ module Proxy::RemoteExecution::Ssh::Runners
148
155
  ssh_options << "-o Port=#{@ssh_port}" if @ssh_port
149
156
  ssh_options << "-o IdentityFile=#{@client_private_key_file}" if @client_private_key_file
150
157
  ssh_options << "-o IdentitiesOnly=yes"
151
- ssh_options << "-o StrictHostKeyChecking=no"
158
+ ssh_options << "-o StrictHostKeyChecking=accept-new"
152
159
  ssh_options << "-o UserKnownHostsFile=#{prepare_known_hosts}" if @host_public_key
153
160
  ssh_options << "-o LogLevel=#{ssh_log_level(true)}"
154
161
  ssh_options << "-o ControlMaster=auto"
@@ -1,7 +1,7 @@
1
1
  module Proxy
2
2
  module RemoteExecution
3
3
  module Ssh
4
- VERSION = '0.10.3'
4
+ VERSION = '0.10.4'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_remote_execution_ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-14 00:00:00.000000000 Z
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -192,7 +192,7 @@ homepage: https://github.com/theforeman/smart_proxy_remote_execution_ssh
192
192
  licenses:
193
193
  - GPL-3.0
194
194
  metadata: {}
195
- post_install_message:
195
+ post_install_message:
196
196
  rdoc_options: []
197
197
  require_paths:
198
198
  - lib
@@ -207,8 +207,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  requirements: []
210
- rubygems_version: 3.1.6
211
- signing_key:
210
+ rubygems_version: 3.3.26
211
+ signing_key:
212
212
  specification_version: 4
213
213
  summary: Ssh remote execution provider for Foreman Smart-Proxy
214
214
  test_files: []