opswalrus 1.0.80 → 1.0.82

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
  SHA256:
3
- metadata.gz: 73707be947e289a10bef406e63ecb61a9e76b12d129dc6db87d388bd7f7d8ff3
4
- data.tar.gz: 1280bc435f28db028e8f8c9e70afa8da14cd2451f6ceb0cb939da2c0420e52fc
3
+ metadata.gz: b7751fc1fdbd7e97363d3043313cc04d260f9f612e66b4978107fde6b58b394e
4
+ data.tar.gz: 050f76316d29dfae709e865ba2dfb8e6d8973f66b9b144c7423446dc3b7432d5
5
5
  SHA512:
6
- metadata.gz: 353b75a4ed41dfe7f5d6c65c40064ef73a59e2ba5b2b533efb0688e788886ea04fd2a2a749bab3f93c7cfd7ae57cc56a0249deb08b5a34dbb9a78055a0c59dbc
7
- data.tar.gz: 83cf798c78753ebafa4e806ec3bc77a272dd53875b467763075c57e9299adfce141f006cc72a18c01ba59f15ed5c996ea03e023507726c26fbc626267dffccc2
6
+ metadata.gz: 6de1073c37df7abb963772cbde6a36fd001cfc7b7dedd44f992b5bdf3b800304f0fb207d61805d9080dd28979eeb49c4289538e134815b97c14c5499312a3c54
7
+ data.tar.gz: 9c744adc28ba82988c62d091e5bfef7d18f2f9c317bd1c28758dddc437da1e71bc5c8581855a5a0c31fa859df82c0881aa0b6dc5d7220943f682cf2499e36b48
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.80)
4
+ opswalrus (1.0.82)
5
5
  activesupport (~> 7.0)
6
6
  bcrypt_pbkdf (~> 1.1)
7
7
  binding_of_caller (~> 1.0)
@@ -4,8 +4,8 @@ require 'sshkit'
4
4
  module OpsWalrus
5
5
 
6
6
  class ScopedMappingInteractionHandler
7
- STANDARD_SUDO_PASSWORD_PROMPT = /\[sudo\] password for .*?:\s*/
8
- STANDARD_SSH_PASSWORD_PROMPT = /.*?@.*?'s password:\s*/
7
+ STANDARD_SUDO_PASSWORD_PROMPT = /\[sudo\] password for .*?:/
8
+ STANDARD_SSH_PASSWORD_PROMPT = /.*?@.*?'s password:/
9
9
 
10
10
  attr_accessor :input_mappings # Hash[ String | Regex => (String | Proc) ]
11
11
 
@@ -60,16 +60,16 @@ module OpsWalrus
60
60
  end
61
61
  new_mapping.merge!(password_mappings) if password_mappings
62
62
 
63
- # trace(Style.green("mapping: #{mapping}"))
64
- # trace(Style.green("new_mapping: #{new_mapping}"))
65
- # trace(Style.green("new_mapping.empty?: #{new_mapping.empty?}"))
66
- # trace(Style.green("new_mapping == @input_mappings: #{new_mapping == @input_mappings}"))
63
+ debug(Style.green("mapping: #{mapping}"))
64
+ debug(Style.green("new_mapping: #{new_mapping}"))
65
+ debug(Style.green("new_mapping.empty?: #{new_mapping.empty?}"))
66
+ debug(Style.green("new_mapping == @input_mappings: #{new_mapping == @input_mappings}"))
67
67
  if new_mapping.empty? || new_mapping == @input_mappings
68
- trace(Style.red("with_mapping -> reset"))
68
+ debug(Style.red("with_mapping -> reset"))
69
69
  @online_matcher.reset
70
70
  yield self
71
71
  else
72
- trace(Style.red("with_mapping -> new mapping"))
72
+ debug(Style.red("with_mapping -> new mapping"))
73
73
  yield ScopedMappingInteractionHandler.new(new_mapping, lookback_window_chars)
74
74
  end
75
75
  end
@@ -97,7 +97,7 @@ module OpsWalrus
97
97
  # trace(Style.yellow("data=`#{data}`"))
98
98
  # trace(Style.yellow("buffer=#{@online_matcher.instance_exec { @buffer } }"))
99
99
  new_matches = @online_matcher.ingest(data)
100
- # trace(Style.yellow("new_matches=`#{new_matches}`"))
100
+ debug(Style.yellow("new_matches=`#{new_matches}`"))
101
101
  response_data = new_matches.find_map do |online_match|
102
102
  mapped_output_value = @input_mappings[online_match.regex]
103
103
  case mapped_output_value
@@ -107,7 +107,7 @@ module OpsWalrus
107
107
  mapped_output_value
108
108
  end
109
109
  end
110
- # trace(Style.yellow("response_data=`#{response_data.inspect}`"))
110
+ debug(Style.yellow("response_data=`#{response_data.inspect}`"))
111
111
 
112
112
  # response_data = @input_mappings.find_map do |pattern, mapped_output_value|
113
113
  # pattern = pattern.is_a?(String) ? Regexp.new(Regexp.escape(pattern)) : pattern
@@ -124,8 +124,8 @@ module OpsWalrus
124
124
  if response_data.nil?
125
125
  trace(Style.red("No interaction handler mapping for #{stream_name}: `#{data}` so no response was sent"))
126
126
  else
127
- debug(Style.cyan("Handling #{stream_name} message #{data}"))
128
- debug(Style.cyan("Sending response #{response_data}"))
127
+ debug(Style.yellow("Handling #{stream_name} message |>#{data}<|"))
128
+ debug(Style.yellow("Sending response |>#{response_data}<|"))
129
129
  if response_channel.respond_to?(:send_data) # Net SSH Channel
130
130
  App.instance.trace "writing: #{response_data.to_s} to Net SSH Channel"
131
131
  response_channel.send_data(response_data.to_s)
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.80"
2
+ VERSION = "1.0.82"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opswalrus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.80
4
+ version: 1.0.82
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ellis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-11 00:00:00.000000000 Z
11
+ date: 2023-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport