winrm 2.4.0 → 2.4.1

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: 2eac5b65fd2ca16d8146ebedec69c103b016a226c8acb5a2b955d45951137567
4
+ data.tar.gz: 12bc8e0a3f374ff700fd949d64d1ce61e8872ca80adc44c7ba48d12b39177b71
5
5
  SHA512:
6
- metadata.gz: 359c0beed452df2eb17cfc82230bac1f075ce86eedc0ffb2a516681856d097527b6e2ed6eb256d1f7652201882b5e83399312b51e035ba2281611cc3e2ac1b3a
7
- data.tar.gz: 4195fb3f4c60238102b3cd79de8d0840e49ff4425a1590cf9c01ce0563d43b465bfde5e400543f7f2b15915b5d0e8e9f58a9e1321706e6d2ecd55e47f28c3398
6
+ metadata.gz: '08f8207aa1455e8c601eac3434d31a91ea81c3e0f54c282999f5873c8b6b27ade40b49ead180801fc056e7bba6c466fbc0db5f3b3655ff2d8e3304f6080894e0'
7
+ data.tar.gz: 47f61d4ec15725227702f1851b29ced3a6075a118461fd671faff12d436d56b3fdffdcd3c35b8359cb452be85e809393df4cc01d0bf933f6d09555d8bf6578b3
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
 
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.1'.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.1
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-09-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: base64