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 +4 -4
- data/README.md +1 -1
- data/lib/winrm/connection_opts.rb +7 -0
- data/lib/winrm/http/response_handler.rb +8 -5
- data/lib/winrm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2eac5b65fd2ca16d8146ebedec69c103b016a226c8acb5a2b955d45951137567
|
|
4
|
+
data.tar.gz: 12bc8e0a3f374ff700fd949d64d1ce61e8872ca80adc44c7ba48d12b39177b71
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
107
|
+
response_xml,
|
|
105
108
|
"//*[local-name() = 'Code']/*[local-name() = 'Value']/text()"
|
|
106
109
|
)
|
|
107
110
|
subcode = REXML::XPath.first(
|
|
108
|
-
|
|
111
|
+
response_xml,
|
|
109
112
|
"//*[local-name() = 'Subcode']/*[local-name() = 'Value']/text()"
|
|
110
113
|
)
|
|
111
114
|
reason = REXML::XPath.first(
|
|
112
|
-
|
|
115
|
+
response_xml,
|
|
113
116
|
"//*[local-name() = 'Reason']/*[local-name() = 'Text']/text()"
|
|
114
117
|
)
|
|
115
118
|
|
data/lib/winrm/version.rb
CHANGED
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.
|
|
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-
|
|
13
|
+
date: 2026-09-15 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: base64
|