winrm 2.4.0 → 2.4.2

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: b4edbd0e2fca0dd65b9b1ba172f525b9473c7b07ddd2b5fd25c422f00e32164f
4
- data.tar.gz: dcba3b6b6c8bf4653a588a0d2d2d70d286f19f831c384c107d0b796cdc77e5dc
3
+ metadata.gz: 16c6fef9756795fb84ca51c68a3afee3651767b48efb0916351193ad45133521
4
+ data.tar.gz: 12336420c05042e54506a8030bf765e762675936bf6d4385e3520c8c9a2190c4
5
5
  SHA512:
6
- metadata.gz: 359c0beed452df2eb17cfc82230bac1f075ce86eedc0ffb2a516681856d097527b6e2ed6eb256d1f7652201882b5e83399312b51e035ba2281611cc3e2ac1b3a
7
- data.tar.gz: 4195fb3f4c60238102b3cd79de8d0840e49ff4425a1590cf9c01ce0563d43b465bfde5e400543f7f2b15915b5d0e8e9f58a9e1321706e6d2ecd55e47f28c3398
6
+ metadata.gz: 27414ddbd38503c341e3d1321dc386bffbf0df7e62edabbcc3491e8968a112d2d657f4d64410a3ce57e55168bfe96fa818ab15ad0817a92d16a9d6b2048bd388
7
+ data.tar.gz: 8f3ce97fc3b345a5f7e64f7c9c3ad0399d736448d2ab12d391174716caf21816fdb22417f1cc3961d49c617d1c7585cd52d43866dc60cce85d06c37a777617e4
data/README.md CHANGED
@@ -202,7 +202,7 @@ iex $cmd
202
202
  ## Setting up Certificate based authentication
203
203
  Perform the following steps to authenticate with a certificate instead of a username and password:
204
204
 
205
- 1. Generate a certificate with an Extended Key Usage of Client Authentication and a Subject Alternative Name with the UPN of the user. See this [powershell function](https://github.com/WinRb/WinRM/blob/main/WinrmAppveyor.psm1#L1) as an example of using `openssl` to create a self signed user certificate in `.pem` and `.pfx` formats along with the private key file.
205
+ 1. Generate a certificate with an Extended Key Usage of Client Authentication and a Subject Alternative Name with the UPN of the user. e.g. using `openssl` to create a self signed user certificate in `.pem` and `.pfx` formats along with the private key file.
206
206
 
207
207
  2. Import the pfx file into the `TrustedPeople` directory of the `LocalMachine` certificate store on the windows endpoint.
208
208
 
@@ -69,12 +69,19 @@ module WinRM
69
69
 
70
70
  if self[:client_cert]
71
71
  raise 'path to client key is required' unless self[:client_key]
72
+ elsif self[:transport] == :kerberos
73
+ validate_kerberos_fields
72
74
  else
73
75
  raise 'user is a required option' unless self[:user]
74
76
  raise 'password is a required option' unless self[:password]
75
77
  end
76
78
  end
77
79
 
80
+ def validate_kerberos_fields
81
+ raise 'realm is a required option' unless self[:realm]
82
+ raise 'service is a required option' unless self[:service]
83
+ end
84
+
78
85
  def validate_data_types
79
86
  validate_integer(:retry_limit)
80
87
  validate_integer(:retry_delay)
@@ -60,6 +60,9 @@ module WinRM
60
60
  end
61
61
 
62
62
  def raise_if_wsman_fault
63
+ # NB: search the document, not the soap_errors nodeset. A leading `//`
64
+ # is document-absolute in REXML anyway, and REXML >= 3.4.4 dropped
65
+ # nodeset support in XPath.first (it warns on every fault response).
63
66
  soap_errors = REXML::XPath.match(
64
67
  response_xml,
65
68
  "//*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'Fault']/*"
@@ -67,7 +70,7 @@ module WinRM
67
70
  return if soap_errors.empty?
68
71
 
69
72
  fault = REXML::XPath.first(
70
- soap_errors,
73
+ response_xml,
71
74
  "//*[local-name() = 'WSManFault']"
72
75
  )
73
76
  raise WinRMWSManFault.new(fault.to_s, fault.attributes['Code']) unless fault.nil?
@@ -81,7 +84,7 @@ module WinRM
81
84
  return if soap_errors.empty?
82
85
 
83
86
  error = REXML::XPath.first(
84
- soap_errors,
87
+ response_xml,
85
88
  "//*[local-name() = 'MSFT_WmiError']"
86
89
  )
87
90
  return if error.nil?
@@ -101,15 +104,15 @@ module WinRM
101
104
  return if soap_errors.empty?
102
105
 
103
106
  code = REXML::XPath.first(
104
- soap_errors,
107
+ response_xml,
105
108
  "//*[local-name() = 'Code']/*[local-name() = 'Value']/text()"
106
109
  )
107
110
  subcode = REXML::XPath.first(
108
- soap_errors,
111
+ response_xml,
109
112
  "//*[local-name() = 'Subcode']/*[local-name() = 'Value']/text()"
110
113
  )
111
114
  reason = REXML::XPath.first(
112
- soap_errors,
115
+ response_xml,
113
116
  "//*[local-name() = 'Reason']/*[local-name() = 'Text']/text()"
114
117
  )
115
118
 
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- require 'erubi'
15
+ require 'erb'
16
16
  require_relative 'message'
17
17
 
18
18
  module WinRM
@@ -78,7 +78,7 @@ module WinRM
78
78
  else
79
79
  raise ArgumentError
80
80
  end
81
- b.eval(Erubi::Engine.new(template).src)
81
+ ERB.new(template).result(b)
82
82
  end
83
83
  end
84
84
  end
data/lib/winrm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # WinRM module
2
2
  module WinRM
3
3
  # The version of the WinRM library
4
- VERSION = '2.4.0'.freeze
4
+ VERSION = '2.4.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winrm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Wanek
@@ -10,7 +10,7 @@ authors:
10
10
  - Shawn Neal
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2026-09-10 00:00:00.000000000 Z
13
+ date: 2026-10-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: base64
@@ -40,20 +40,6 @@ dependencies:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: 2.1.2
43
- - !ruby/object:Gem::Dependency
44
- name: erubi
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '1.8'
50
- type: :runtime
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - "~>"
55
- - !ruby/object:Gem::Version
56
- version: '1.8'
57
43
  - !ruby/object:Gem::Dependency
58
44
  name: gssapi
59
45
  requirement: !ruby/object:Gem::Requirement
@@ -108,14 +94,14 @@ dependencies:
108
94
  requirements:
109
95
  - - "~>"
110
96
  - !ruby/object:Gem::Version
111
- version: '1.6'
97
+ version: '1.5'
112
98
  type: :runtime
113
99
  prerelease: false
114
100
  version_requirements: !ruby/object:Gem::Requirement
115
101
  requirements:
116
102
  - - "~>"
117
103
  - !ruby/object:Gem::Version
118
- version: '1.6'
104
+ version: '1.5'
119
105
  - !ruby/object:Gem::Dependency
120
106
  name: nori
121
107
  requirement: !ruby/object:Gem::Requirement