-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added winrm-elevated gem to solve wirnrm AuthenticationError * Piloting Fixes * review changes with new test cases * Updated README file * Monkey patched elevated shells to resolve issue Co-authored-by: sr070633 <[email protected]>
- Loading branch information
1 parent
2cd568b
commit b3f4a59
Showing
9 changed files
with
116 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
require "winrm-elevated" | ||
|
||
module Remotus | ||
# Core Ruby extensions | ||
module CoreExt | ||
# Elevated extension module | ||
module Elevated | ||
unless method_defined?(:connection_opts) | ||
# | ||
# Returns a hash into a safe method name that can be used for instance variables | ||
# | ||
# @return [Hash] Method name | ||
# | ||
def connection_opts | ||
@shell.connection_opts | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
WinRM::Shells::Elevated.include(Remotus::CoreExt::Elevated) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
|
||
module Remotus | ||
# Remotus gem version | ||
VERSION = "0.3.0" | ||
VERSION = "0.4.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe Remotus::CoreExt::Elevated do | ||
let(:connection_opts) do | ||
{ | ||
user: "username", | ||
password: "password", | ||
domain: "domain_name" | ||
} | ||
end | ||
|
||
let(:winrm_elevated_connection) do | ||
double(WinRM::Connection, shell: double(WinRM::Shells::Elevated), connection_opts: connection_opts) | ||
end | ||
|
||
describe "#connection_opts" do | ||
it "returns connection_opts object" do | ||
expect(winrm_elevated_connection.connection_opts).to eq(connection_opts) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters