winrm-s 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75dccd077fbd8acfe0ffffed3307456ccfc21377
4
- data.tar.gz: 822adb188680aa6817cc4961f489fb7e04ce87cc
3
+ metadata.gz: f1ca75e230abc66bf7c5727a7b7b1cf8a91ba371
4
+ data.tar.gz: 1ea8c69888c111ddaede020425212a12bda2c650
5
5
  SHA512:
6
- metadata.gz: fea5977424fcfe8b8eec5bfba065e84f7f2f5cdbb98883327cff132f049aaaf0e8679243e348c61c71483a1d4610f12ae350c15717ad58def287a5ef67df3d1b
7
- data.tar.gz: e634208bc2d2a68620e2c355e5b2949af1fe1fab2552883d715dffd92cbe0a00a29242d097b7f901aa464cedc4db00ef61ff0b5727f8ddfa74afd4dca1180b47
6
+ metadata.gz: 39fe8cbc177f8d2986758a833a8ead44719951f027b0dc524ac991026cf33f7e374bd8ac4b88209ad05ef5eb74bbd39a952951111dc79212ae306725c18b8fed
7
+ data.tar.gz: 0da71b1d4e730c52036ff527d40771d0933b604f16af7ff86b57ee84fd953cfa47a449ba52d40e983d0fe4d5471b7ab7fd18476674b6dc0223d46357f5b3ae6a
@@ -1,8 +1,8 @@
1
1
  rvm:
2
- # - 1.8.7
3
- # - 1.9.2
4
2
  - 1.9.3
5
3
  - 2.0.0
6
4
  - 2.1.0
7
5
 
8
- script: bundle exec rake spec
6
+ script: bundle exec rake
7
+ before_install:
8
+ - gem update bundler
@@ -2,6 +2,11 @@
2
2
  Unreleased
3
3
  --------------
4
4
 
5
+ Release: 0.3.2
6
+ --------------
7
+ * Strip UTF-8 BOM from response added by win2k8R2 since newer WinRM versions now use UTF-8
8
+ * Decode all authorized payloads, not just successful ones so an unsuccesful command error can be communicated
9
+
5
10
  Release: 0.3.1
6
11
  --------------
7
12
  * [Issue #27](https://github.com/chef/winrm-s/pull/27): Fixes problem with AllowUnencrypted being true and using negotiate
data/Gemfile CHANGED
@@ -2,7 +2,8 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :test, :development do
5
- gem "rspec"
5
+ gem 'pry'
6
+ gem 'rspec'
6
7
  gem 'rake'
7
8
  gem 'nokogiri', '~> 1.6.2'
8
9
  end
data/Rakefile CHANGED
@@ -1 +1,16 @@
1
- require 'bundler/gem_tasks'
1
+ require 'bundler'
2
+ require 'rspec/core/rake_task'
3
+
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ task :default => [:unit_spec]
7
+
8
+ desc "Run all functional specs in spec directory"
9
+ RSpec::Core::RakeTask.new(:functional_spec) do |t|
10
+ t.pattern = 'spec/functional/**/*_spec.rb'
11
+ end
12
+
13
+ desc "Run all unit specs in spec directory"
14
+ RSpec::Core::RakeTask.new(:unit_spec) do |t|
15
+ t.pattern = 'spec/unit/**/*_spec.rb'
16
+ end
@@ -17,6 +17,6 @@
17
17
  #
18
18
 
19
19
  module WinrmS
20
- VERSION = "0.3.1"
20
+ VERSION = "0.3.2"
21
21
  MAJOR, MINOR, TINY = VERSION.split('.')
22
22
  end
@@ -83,7 +83,7 @@ class HTTPClient
83
83
  end
84
84
  # ignore unknown authentication scheme
85
85
  end
86
- elsif res.status == HTTP::Status::OK
86
+ else
87
87
  decrypted_content = res.content
88
88
  @authenticator.each do |auth|
89
89
  next unless auth.set? # hasn't be set, don't use it
@@ -66,7 +66,7 @@ module WinRM
66
66
  output = Output.new
67
67
  REXML::XPath.match(resp_doc, "//#{NS_WIN_SHELL}:Stream").each do |n|
68
68
  next if n.text.nil? || n.text.empty?
69
- stream = { n.attributes['Name'].to_sym => Base64.decode64(n.text) }
69
+ stream = { n.attributes['Name'].to_sym => Base64.decode64(n.text).force_encoding('utf-8').sub("\xEF\xBB\xBF", "") }
70
70
  output[:data] << stream
71
71
  yield stream[:stdout], stream[:stderr] if block_given?
72
72
  end
@@ -10,7 +10,7 @@ def assert_prerequisites
10
10
  end
11
11
 
12
12
 
13
- describe "Test sspinegotiate with encrypt/decrypt via WinRM", :windows_and_func_spec_enabled do
13
+ describe "Test sspinegotiate with encrypt/decrypt via WinRM" do
14
14
  before(:all) do
15
15
  assert_prerequisites
16
16
  # Remember the user setting.
@@ -21,7 +21,7 @@ describe "Test sspinegotiate with encrypt/decrypt via WinRM", :windows_and_func_
21
21
 
22
22
  before do
23
23
  %x{winrm set winrm/config/service @{AllowUnencrypted="false"}}
24
- @winrm = WinRM::WinRMWebService.new(ENV["test_winrm_endpoint"], :sspinegotiate, :user => ENV["test_winrm_user"], :pass => ENV["test_winrm_pass"])
24
+ @winrm = WinRM::WinRMWebService.new(ENV["test_winrm_endpoint"], :sspinegotiate, :user => ENV["test_winrm_user"].dup, :pass => ENV["test_winrm_pass"].dup)
25
25
  end
26
26
 
27
27
  after(:all) do
@@ -47,19 +47,4 @@ describe "Test sspinegotiate with encrypt/decrypt via WinRM", :windows_and_func_
47
47
  end
48
48
  expect(outvar).to match(/Windows IP Configuration/)
49
49
  end
50
-
51
- describe "Negative test:" do
52
- before do
53
- %x{winrm set winrm/config/service @{AllowUnencrypted="true"}}
54
- end
55
- after do
56
- %x{winrm set winrm/config/service @{AllowUnencrypted="false"}}
57
- end
58
-
59
- describe "when AllowUnencrypted is set to true" do
60
- it "should raise an exception" do
61
- expect{@winrm.run_cmd('ipconfig')}.to raise_exception
62
- end
63
- end
64
- end
65
- end
50
+ end
@@ -10,12 +10,7 @@ def unix?
10
10
  !windows?
11
11
  end
12
12
 
13
- def windows_and_func_spec_enabled?
14
- windows? and ENV["enable_winrms_func_spec"]
15
- end
16
-
17
13
  RSpec.configure do |config|
18
14
  config.filter_run_excluding :windows_only => true unless windows?
19
- config.filter_run_excluding :windows_and_func_spec_enabled => true unless windows_and_func_spec_enabled?
20
15
  config.filter_run_excluding :unix_only => true unless unix?
21
16
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.summary = %q{Gem that extends the functionality of the WinRM gem to support the Microsoft Negotiate protocol when authenticating to a remote WinRM endpoint from a Windows system}
15
15
  s.description = s.summary
16
16
 
17
- s.add_dependency "winrm", "~> 1.3.0"
17
+ s.add_dependency "winrm", "~> 1.3", ">= 1.3.6"
18
18
 
19
19
  %w(rspec-core rspec-expectations rspec-mocks rspec_junit_formatter).each { |gem| s.add_development_dependency gem }
20
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winrm-s
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaustubh Deorukhkar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2015-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: winrm
@@ -16,14 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.0
19
+ version: '1.3'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.3.6
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: 1.3.0
29
+ version: '1.3'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.3.6
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rspec-core
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -131,11 +137,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
137
  version: '0'
132
138
  requirements: []
133
139
  rubyforge_project:
134
- rubygems_version: 2.4.4
140
+ rubygems_version: 2.4.8
135
141
  signing_key:
136
142
  specification_version: 4
137
143
  summary: Gem that extends the functionality of the WinRM gem to support the Microsoft
138
144
  Negotiate protocol when authenticating to a remote WinRM endpoint from a Windows
139
145
  system
140
146
  test_files: []
141
- has_rdoc: true