winrm 2.2.3 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +13 -1
  3. data/.travis.yml +10 -11
  4. data/Gemfile +2 -3
  5. data/README.md +1 -1
  6. data/Rakefile +3 -4
  7. data/appveyor.yml +1 -2
  8. data/bin/rwinrm +90 -97
  9. data/changelog.md +5 -0
  10. data/lib/winrm.rb +3 -5
  11. data/lib/winrm/connection.rb +84 -86
  12. data/lib/winrm/connection_opts.rb +90 -91
  13. data/lib/winrm/exceptions.rb +14 -2
  14. data/lib/winrm/http/response_handler.rb +127 -96
  15. data/lib/winrm/http/transport.rb +462 -427
  16. data/lib/winrm/http/transport_factory.rb +1 -5
  17. data/lib/winrm/output.rb +1 -2
  18. data/lib/winrm/psrp/fragment.rb +0 -2
  19. data/lib/winrm/psrp/message.rb +1 -3
  20. data/lib/winrm/psrp/message_data.rb +0 -2
  21. data/lib/winrm/psrp/message_data/base.rb +0 -2
  22. data/lib/winrm/psrp/message_data/error_record.rb +0 -2
  23. data/lib/winrm/psrp/message_data/pipeline_host_call.rb +0 -2
  24. data/lib/winrm/psrp/message_data/pipeline_output.rb +48 -54
  25. data/lib/winrm/psrp/message_data/pipeline_state.rb +0 -2
  26. data/lib/winrm/psrp/message_data/runspacepool_host_call.rb +0 -2
  27. data/lib/winrm/psrp/message_data/runspacepool_state.rb +0 -2
  28. data/lib/winrm/psrp/message_data/session_capability.rb +0 -2
  29. data/lib/winrm/psrp/message_defragmenter.rb +2 -2
  30. data/lib/winrm/psrp/message_factory.rb +2 -3
  31. data/lib/winrm/psrp/message_fragmenter.rb +1 -3
  32. data/lib/winrm/psrp/powershell_output_decoder.rb +0 -2
  33. data/lib/winrm/psrp/receive_response_reader.rb +3 -5
  34. data/lib/winrm/psrp/uuid.rb +1 -2
  35. data/lib/winrm/shells/base.rb +6 -4
  36. data/lib/winrm/shells/cmd.rb +63 -65
  37. data/lib/winrm/shells/power_shell.rb +207 -202
  38. data/lib/winrm/shells/retryable.rb +44 -45
  39. data/lib/winrm/shells/shell_factory.rb +0 -2
  40. data/lib/winrm/version.rb +1 -3
  41. data/lib/winrm/wsmv/base.rb +0 -2
  42. data/lib/winrm/wsmv/cleanup_command.rb +1 -2
  43. data/lib/winrm/wsmv/close_shell.rb +1 -2
  44. data/lib/winrm/wsmv/command.rb +2 -3
  45. data/lib/winrm/wsmv/command_output.rb +2 -3
  46. data/lib/winrm/wsmv/command_output_decoder.rb +1 -2
  47. data/lib/winrm/wsmv/configuration.rb +0 -2
  48. data/lib/winrm/wsmv/create_pipeline.rb +0 -2
  49. data/lib/winrm/wsmv/create_shell.rb +2 -6
  50. data/lib/winrm/wsmv/header.rb +213 -215
  51. data/lib/winrm/wsmv/init_runspace_pool.rb +96 -95
  52. data/lib/winrm/wsmv/iso8601_duration.rb +0 -2
  53. data/lib/winrm/wsmv/keep_alive.rb +0 -2
  54. data/lib/winrm/wsmv/receive_response_reader.rb +128 -126
  55. data/lib/winrm/wsmv/send_data.rb +0 -2
  56. data/lib/winrm/wsmv/soap.rb +0 -2
  57. data/lib/winrm/wsmv/wql_pull.rb +54 -56
  58. data/lib/winrm/wsmv/wql_query.rb +98 -99
  59. data/lib/winrm/wsmv/write_stdin.rb +0 -2
  60. data/tests/integration/auth_timeout_spec.rb +0 -1
  61. data/tests/integration/cmd_spec.rb +2 -3
  62. data/tests/integration/issue_59_spec.rb +0 -1
  63. data/tests/integration/powershell_spec.rb +4 -5
  64. data/tests/integration/spec_helper.rb +3 -6
  65. data/tests/integration/transport_spec.rb +0 -1
  66. data/tests/integration/wql_spec.rb +33 -34
  67. data/tests/matchers.rb +2 -3
  68. data/tests/spec/configuration_spec.rb +0 -1
  69. data/tests/spec/connection_spec.rb +0 -2
  70. data/tests/spec/exception_spec.rb +0 -1
  71. data/tests/spec/http/transport_factory_spec.rb +1 -3
  72. data/tests/spec/http/transport_spec.rb +0 -1
  73. data/tests/spec/output_spec.rb +4 -3
  74. data/tests/spec/psrp/fragment_spec.rb +0 -2
  75. data/tests/spec/psrp/message_data/base_spec.rb +0 -2
  76. data/tests/spec/psrp/message_data/error_record_spec.rb +0 -2
  77. data/tests/spec/psrp/message_data/pipeline_host_call_spec.rb +0 -2
  78. data/tests/spec/psrp/message_data/pipeline_output_spec.rb +0 -2
  79. data/tests/spec/psrp/message_data/pipeline_state_spec.rb +0 -2
  80. data/tests/spec/psrp/message_data/runspace_pool_host_call_spec.rb +0 -2
  81. data/tests/spec/psrp/message_data/runspacepool_state_spec.rb +0 -2
  82. data/tests/spec/psrp/message_data/session_capability_spec.rb +0 -2
  83. data/tests/spec/psrp/message_data_spec.rb +0 -2
  84. data/tests/spec/psrp/message_defragmenter_spec.rb +0 -2
  85. data/tests/spec/psrp/message_fragmenter_spec.rb +0 -2
  86. data/tests/spec/psrp/powershell_output_decoder_spec.rb +0 -2
  87. data/tests/spec/psrp/psrp_message_spec.rb +10 -7
  88. data/tests/spec/psrp/recieve_response_reader_spec.rb +0 -2
  89. data/tests/spec/psrp/uuid_spec.rb +2 -2
  90. data/tests/spec/response_handler_spec.rb +69 -61
  91. data/tests/spec/shells/base_spec.rb +7 -5
  92. data/tests/spec/shells/cmd_spec.rb +4 -4
  93. data/tests/spec/shells/powershell_spec.rb +221 -175
  94. data/tests/spec/spec_helper.rb +0 -1
  95. data/tests/spec/stubs/responses/get_omi_command_output_response.xml.erb +23 -0
  96. data/tests/spec/stubs/responses/get_omi_command_output_response_not_done.xml.erb +24 -0
  97. data/tests/spec/stubs/responses/get_omi_config_response.xml +45 -0
  98. data/tests/spec/stubs/responses/get_omi_powershell_keepalive_response.xml.erb +33 -0
  99. data/tests/spec/stubs/responses/open_shell_omi.xml +43 -0
  100. data/tests/spec/stubs/responses/soap_fault_omi.xml +31 -0
  101. data/tests/spec/wsmv/cleanup_command_spec.rb +0 -2
  102. data/tests/spec/wsmv/close_shell_spec.rb +0 -2
  103. data/tests/spec/wsmv/command_output_decoder_spec.rb +0 -2
  104. data/tests/spec/wsmv/command_output_spec.rb +1 -3
  105. data/tests/spec/wsmv/command_spec.rb +0 -2
  106. data/tests/spec/wsmv/configuration_spec.rb +0 -2
  107. data/tests/spec/wsmv/create_pipeline_spec.rb +2 -3
  108. data/tests/spec/wsmv/create_shell_spec.rb +6 -5
  109. data/tests/spec/wsmv/init_runspace_pool_spec.rb +38 -36
  110. data/tests/spec/wsmv/keep_alive_spec.rb +4 -4
  111. data/tests/spec/wsmv/receive_response_reader_spec.rb +124 -123
  112. data/tests/spec/wsmv/send_data_spec.rb +4 -4
  113. data/tests/spec/wsmv/wql_query_spec.rb +11 -13
  114. data/tests/spec/wsmv/write_stdin_spec.rb +0 -2
  115. data/winrm.gemspec +11 -12
  116. metadata +73 -67
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8
2
-
3
1
  require 'winrm/wsmv/send_data'
4
2
 
5
3
  describe WinRM::WSMV::SendData do
@@ -22,9 +20,11 @@ describe WinRM::WSMV::SendData do
22
20
  expect(xml).to include('<w:OperationTimeout>PT60S</w:OperationTimeout>')
23
21
  expect(xml).to include(
24
22
  '<w:SelectorSet><w:Selector Name="ShellId">' \
25
- "#{shell_id}</w:Selector></w:SelectorSet>")
23
+ "#{shell_id}</w:Selector></w:SelectorSet>"
24
+ )
26
25
  expect(xml).to include(
27
- "<rsp:Stream Name=\"stdin\" CommandId=\"#{command_id}\">#{pipeline}</rsp:Stream>")
26
+ "<rsp:Stream Name=\"stdin\" CommandId=\"#{command_id}\">#{pipeline}</rsp:Stream>"
27
+ )
28
28
  end
29
29
  end
30
30
  end
@@ -1,13 +1,11 @@
1
- # encoding: UTF-8
2
-
3
- require 'winrm/wsmv/wql_query'
4
-
5
- describe WinRM::WSMV::WqlQuery do
6
- context 'default session options' do
7
- subject { described_class.new(nil, default_connection_opts, 'SELECT * FROM Win32') }
8
- let(:xml) { subject.build }
9
- it 'creates a well formed message' do
10
- expect(xml).to include('<w:OperationTimeout>PT60S</w:OperationTimeout>')
11
- end
12
- end
13
- end
1
+ require 'winrm/wsmv/wql_query'
2
+
3
+ describe WinRM::WSMV::WqlQuery do
4
+ context 'default session options' do
5
+ subject { described_class.new(nil, default_connection_opts, 'SELECT * FROM Win32') }
6
+ let(:xml) { subject.build }
7
+ it 'creates a well formed message' do
8
+ expect(xml).to include('<w:OperationTimeout>PT60S</w:OperationTimeout>')
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8
2
-
3
1
  require 'base64'
4
2
  require 'winrm/wsmv/write_stdin'
5
3
 
data/winrm.gemspec CHANGED
@@ -1,6 +1,5 @@
1
- # encoding: UTF-8
2
1
  require 'date'
3
- require File.expand_path('../lib/winrm/version', __FILE__)
2
+ require File.expand_path('lib/winrm/version', __dir__)
4
3
 
5
4
  Gem::Specification.new do |s|
6
5
  s.platform = Gem::Platform::RUBY
@@ -25,23 +24,23 @@ Gem::Specification.new do |s|
25
24
 
26
25
  s.files = `git ls-files`.split(/\n/)
27
26
  s.require_path = 'lib'
28
- s.rdoc_options = %w(-x test/ -x examples/)
29
- s.extra_rdoc_files = %w(README.md LICENSE)
27
+ s.rdoc_options = %w[-x test/ -x examples/]
28
+ s.extra_rdoc_files = %w[README.md LICENSE]
30
29
 
31
30
  s.bindir = 'bin'
32
31
  s.executables = ['rwinrm']
33
- s.required_ruby_version = '>= 2.0'
32
+ s.required_ruby_version = '>= 2.2.0'
33
+ s.add_runtime_dependency 'builder', '>= 2.1.2'
34
+ s.add_runtime_dependency 'erubis', '~> 2.7'
34
35
  s.add_runtime_dependency 'gssapi', '~> 1.2'
36
+ s.add_runtime_dependency 'gyoku', '~> 1.0'
35
37
  s.add_runtime_dependency 'httpclient', '~> 2.2', '>= 2.2.0.2'
36
- s.add_runtime_dependency 'rubyntlm', '~> 0.6.0', '>= 0.6.1'
37
38
  s.add_runtime_dependency 'logging', ['>= 1.6.1', '< 3.0']
38
39
  s.add_runtime_dependency 'nori', '~> 2.0'
39
- s.add_runtime_dependency 'gyoku', '~> 1.0'
40
- s.add_runtime_dependency 'builder', '>= 2.1.2'
41
- s.add_runtime_dependency 'erubis', '~> 2.7'
42
- s.add_development_dependency 'rspec', '~> 3.2'
43
- s.add_development_dependency 'rake', '~> 10.3'
44
- s.add_development_dependency 'rubocop', '~> 0.39.0'
45
40
  s.add_development_dependency 'pry'
41
+ s.add_development_dependency 'rake', '~> 10.3'
46
42
  s.add_development_dependency 'rb-readline'
43
+ s.add_development_dependency 'rspec', '~> 3.2'
44
+ s.add_development_dependency 'rubocop', '~> 0.51'
45
+ s.add_runtime_dependency 'rubyntlm', '~> 0.6.0', '>= 0.6.1'
47
46
  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.2.3
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Wanek
@@ -11,8 +11,36 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-05-09 00:00:00.000000000 Z
14
+ date: 2018-10-15 00:00:00.000000000 Z
15
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: builder
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.1.2
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 2.1.2
30
+ - !ruby/object:Gem::Dependency
31
+ name: erubis
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - "~>"
35
+ - !ruby/object:Gem::Version
36
+ version: '2.7'
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '2.7'
16
44
  - !ruby/object:Gem::Dependency
17
45
  name: gssapi
18
46
  requirement: !ruby/object:Gem::Requirement
@@ -28,45 +56,39 @@ dependencies:
28
56
  - !ruby/object:Gem::Version
29
57
  version: '1.2'
30
58
  - !ruby/object:Gem::Dependency
31
- name: httpclient
59
+ name: gyoku
32
60
  requirement: !ruby/object:Gem::Requirement
33
61
  requirements:
34
62
  - - "~>"
35
63
  - !ruby/object:Gem::Version
36
- version: '2.2'
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: 2.2.0.2
64
+ version: '1.0'
40
65
  type: :runtime
41
66
  prerelease: false
42
67
  version_requirements: !ruby/object:Gem::Requirement
43
68
  requirements:
44
69
  - - "~>"
45
70
  - !ruby/object:Gem::Version
46
- version: '2.2'
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: 2.2.0.2
71
+ version: '1.0'
50
72
  - !ruby/object:Gem::Dependency
51
- name: rubyntlm
73
+ name: httpclient
52
74
  requirement: !ruby/object:Gem::Requirement
53
75
  requirements:
54
76
  - - "~>"
55
77
  - !ruby/object:Gem::Version
56
- version: 0.6.0
78
+ version: '2.2'
57
79
  - - ">="
58
80
  - !ruby/object:Gem::Version
59
- version: 0.6.1
81
+ version: 2.2.0.2
60
82
  type: :runtime
61
83
  prerelease: false
62
84
  version_requirements: !ruby/object:Gem::Requirement
63
85
  requirements:
64
86
  - - "~>"
65
87
  - !ruby/object:Gem::Version
66
- version: 0.6.0
88
+ version: '2.2'
67
89
  - - ">="
68
90
  - !ruby/object:Gem::Version
69
- version: 0.6.1
91
+ version: 2.2.0.2
70
92
  - !ruby/object:Gem::Dependency
71
93
  name: logging
72
94
  requirement: !ruby/object:Gem::Requirement
@@ -102,117 +124,95 @@ dependencies:
102
124
  - !ruby/object:Gem::Version
103
125
  version: '2.0'
104
126
  - !ruby/object:Gem::Dependency
105
- name: gyoku
106
- requirement: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '1.0'
111
- type: :runtime
112
- prerelease: false
113
- version_requirements: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '1.0'
118
- - !ruby/object:Gem::Dependency
119
- name: builder
127
+ name: pry
120
128
  requirement: !ruby/object:Gem::Requirement
121
129
  requirements:
122
130
  - - ">="
123
131
  - !ruby/object:Gem::Version
124
- version: 2.1.2
125
- type: :runtime
132
+ version: '0'
133
+ type: :development
126
134
  prerelease: false
127
135
  version_requirements: !ruby/object:Gem::Requirement
128
136
  requirements:
129
137
  - - ">="
130
138
  - !ruby/object:Gem::Version
131
- version: 2.1.2
139
+ version: '0'
132
140
  - !ruby/object:Gem::Dependency
133
- name: erubis
141
+ name: rake
134
142
  requirement: !ruby/object:Gem::Requirement
135
143
  requirements:
136
144
  - - "~>"
137
145
  - !ruby/object:Gem::Version
138
- version: '2.7'
139
- type: :runtime
146
+ version: '10.3'
147
+ type: :development
140
148
  prerelease: false
141
149
  version_requirements: !ruby/object:Gem::Requirement
142
150
  requirements:
143
151
  - - "~>"
144
152
  - !ruby/object:Gem::Version
145
- version: '2.7'
153
+ version: '10.3'
146
154
  - !ruby/object:Gem::Dependency
147
- name: rspec
155
+ name: rb-readline
148
156
  requirement: !ruby/object:Gem::Requirement
149
157
  requirements:
150
- - - "~>"
158
+ - - ">="
151
159
  - !ruby/object:Gem::Version
152
- version: '3.2'
160
+ version: '0'
153
161
  type: :development
154
162
  prerelease: false
155
163
  version_requirements: !ruby/object:Gem::Requirement
156
164
  requirements:
157
- - - "~>"
165
+ - - ">="
158
166
  - !ruby/object:Gem::Version
159
- version: '3.2'
167
+ version: '0'
160
168
  - !ruby/object:Gem::Dependency
161
- name: rake
169
+ name: rspec
162
170
  requirement: !ruby/object:Gem::Requirement
163
171
  requirements:
164
172
  - - "~>"
165
173
  - !ruby/object:Gem::Version
166
- version: '10.3'
174
+ version: '3.2'
167
175
  type: :development
168
176
  prerelease: false
169
177
  version_requirements: !ruby/object:Gem::Requirement
170
178
  requirements:
171
179
  - - "~>"
172
180
  - !ruby/object:Gem::Version
173
- version: '10.3'
181
+ version: '3.2'
174
182
  - !ruby/object:Gem::Dependency
175
183
  name: rubocop
176
184
  requirement: !ruby/object:Gem::Requirement
177
185
  requirements:
178
186
  - - "~>"
179
187
  - !ruby/object:Gem::Version
180
- version: 0.39.0
188
+ version: '0.51'
181
189
  type: :development
182
190
  prerelease: false
183
191
  version_requirements: !ruby/object:Gem::Requirement
184
192
  requirements:
185
193
  - - "~>"
186
194
  - !ruby/object:Gem::Version
187
- version: 0.39.0
195
+ version: '0.51'
188
196
  - !ruby/object:Gem::Dependency
189
- name: pry
197
+ name: rubyntlm
190
198
  requirement: !ruby/object:Gem::Requirement
191
199
  requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- type: :development
196
- prerelease: false
197
- version_requirements: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
+ - - "~>"
200
201
  - !ruby/object:Gem::Version
201
- version: '0'
202
- - !ruby/object:Gem::Dependency
203
- name: rb-readline
204
- requirement: !ruby/object:Gem::Requirement
205
- requirements:
202
+ version: 0.6.0
206
203
  - - ">="
207
204
  - !ruby/object:Gem::Version
208
- version: '0'
209
- type: :development
205
+ version: 0.6.1
206
+ type: :runtime
210
207
  prerelease: false
211
208
  version_requirements: !ruby/object:Gem::Requirement
212
209
  requirements:
210
+ - - "~>"
211
+ - !ruby/object:Gem::Version
212
+ version: 0.6.0
213
213
  - - ">="
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: 0.6.1
216
216
  description: " Ruby library for Windows Remote Management\n"
217
217
  email:
218
218
  - dan.wanek@gmail.com
@@ -332,11 +332,17 @@ files:
332
332
  - tests/spec/stubs/clixml/pipeline_state.xml.erb
333
333
  - tests/spec/stubs/responses/get_command_output_response.xml.erb
334
334
  - tests/spec/stubs/responses/get_command_output_response_not_done.xml.erb
335
+ - tests/spec/stubs/responses/get_omi_command_output_response.xml.erb
336
+ - tests/spec/stubs/responses/get_omi_command_output_response_not_done.xml.erb
337
+ - tests/spec/stubs/responses/get_omi_config_response.xml
338
+ - tests/spec/stubs/responses/get_omi_powershell_keepalive_response.xml.erb
335
339
  - tests/spec/stubs/responses/get_powershell_keepalive_response.xml.erb
336
340
  - tests/spec/stubs/responses/get_powershell_output_response.xml.erb
337
341
  - tests/spec/stubs/responses/get_powershell_output_response_not_done.xml.erb
342
+ - tests/spec/stubs/responses/open_shell_omi.xml
338
343
  - tests/spec/stubs/responses/open_shell_v1.xml
339
344
  - tests/spec/stubs/responses/open_shell_v2.xml
345
+ - tests/spec/stubs/responses/soap_fault_omi.xml
340
346
  - tests/spec/stubs/responses/soap_fault_v1.xml
341
347
  - tests/spec/stubs/responses/soap_fault_v2.xml
342
348
  - tests/spec/stubs/responses/wmi_error_v2.xml
@@ -371,7 +377,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
371
377
  requirements:
372
378
  - - ">="
373
379
  - !ruby/object:Gem::Version
374
- version: '2.0'
380
+ version: 2.2.0
375
381
  required_rubygems_version: !ruby/object:Gem::Requirement
376
382
  requirements:
377
383
  - - ">="
@@ -379,7 +385,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
379
385
  version: '0'
380
386
  requirements: []
381
387
  rubyforge_project:
382
- rubygems_version: 2.6.11
388
+ rubygems_version: 2.7.6
383
389
  signing_key:
384
390
  specification_version: 4
385
391
  summary: Ruby library for Windows Remote Management